-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script to test live API integration #128
Conversation
6406f08
to
ebfe508
Compare
I updated this to not depend on #125, which is a lot more complicated to review. I also moved this script and a couple others from the @dbader any chance you are able to add credentials for a test Datadog account to the repository secrets? Then I can add a CI workflow for this. I have usable credentials if you don’t; just send me an e-mail if you want them. |
This basic script sends some metrics to Datadog using this library, then queries the API for those same values to make sure they were successfully ingested and will be visible in Datadog's UI. This is mainly meant as a simple test to ensure changes to the underlying Datadog client keep sending things in the correct form. Unit tests *mostly* cover this use case, so the check here is pretty lightweight. We don't check every metric type, for example. But this is still important. Fixes #89.
It turns out Mocha was seeing these (or at least the ones that are JS) and at least executing the top-level code. We could adjust Mocha's settings, but it's probably better to separate these checks anyway, since they aren't really unit tests.
Since distributions get send through an entirely different API endpoint, we should include them in the test.
57d0203
to
dd03893
Compare
CI works!!! Thanks, @dbader 🎉 |
This adds a
npm run check-integration
script that sends some metrics to Datadog using this library, then queries the API for those same metric values to make sure they were successfully ingested and will be visible in Datadog's UI.The goal here is to provide a minimal check of real, live integration in case a change to the actual reporter or Datadog client breaks or mis-formats something in a way that our unit tests don’t effectively catch. In most cases, our unit tests should be enough (this is why we use nock instead of just mocking the Datadog client), so this check is pretty lightweight (it only checks one metric type, for example).
I haven’t included any CI changes since @dbader would need to configure CI with working credentials. If we get that going, great, otherwise this will just have to be something maintainers run locally as needed (mainly before publishing releases).
Fixes #89.