-
Notifications
You must be signed in to change notification settings - Fork 17
[PIE-1380] Send failure_expanded to Test Analytics #48
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think I know enough about Jest to approve this review, but the approach looks sensible, and is similar to what the ruby test collector does.
One thing I was wondering was if it was possible to integration test this before the package was released, but I have no idea how you'd do this in node. Like doing the node equivalent of bundling to a local version of test collector ruby and running the test and seeing if the right output is generated. Might be sending you on a wild goose chase tho!
plugins: | ||
- docker#v3.7.0: | ||
image: node:latest | ||
image: node:lts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is this image change and the node version bump essential for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see that you merged a branch in with these changes to get the tests to pass. Perhaps it would be good to call that out and merge the other branch before this one? Or perhaps rebase this branch onto the branch with the node update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niceking Good point! I tested the integration with Test Analytics locally (i.e. running example tests and sending the results to local analytics API), and I can write documentation for that. But I think it also worth making the API URL configurable to easily debug/test the integration locally; similar to what we did for Ruby collector)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niceking as for the node
update, I'll make sure to merge the other one first and rebase this branch. I'll put this PR back to draft.
90076e9
to
c67ce1f
Compare
Perhaps its my unfamiliarity with the npm development pipeline, but I don't believe these instructions are sufficient for locally testing a package under development?
I believe that doing Did you confirm that running the jest collector this way locally generates the appropriate S3 file in minio locally, and the data for |
} | ||
|
||
axios.post('https://analytics-api.buildkite.com/v1/uploads', data, config) | ||
const buildkiteAnalyticsUrl = process.env.BUILDKITE_ANALYTICS_URL || DEFAULT_BUILDKITE_ANALYTICS_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely makes testing easier, nice!
@niceking Thanks for the feedback 💚. The examples are configured as
I checked what the collector is sending to the analytics API and can see the |
Cool! Actually, I don't even know if the jest collector is set up to operate with our local minio set up, so this could just be a misunderstanding on my part :) Would still love a zoom to sync on this though just so I understand how the local package development works! |
@nprizal Is it fine to use From the docs:
|
@iampatbrown 💯 that's been overloaded and will break the collector if used. Thanks 🧡 @nprizal is on it! |
@iampatbrown thanks for the feedback 💚. It has been fixed in v1.4.1. |
Description
Currently,
test-collector-javascript
for Jest sends a full failure message asfailure_reason
and skipsfailure_expanded
. It should send a full failure message asfailure_expanded
and send a summary asfailure_reason
.Context
We want to limit the length of
failure_reason
that can be stored by Test Analytics in the upcoming changes. Therefore, we need to split the failure messages into a short summary that goes intofailure_reason
and the detail that goes intofailure_expanded
Changes
jest
reporter will now send the first line offailureMessages
asfailureReason
and the rest of the lines asfailureExpanded
(resolves Sendfailure_expanded
on Jest failures #17)BUILDKITE_ANALYTICS_URL
env (resolves Support configurable API endpoint URL for debugging purposes #46)Verification
Test the integration with Test Analytics API by following these steps:
npm install
cd examples/jest
BUILDKITE_ANALYTICS_TOKEN=<YOUR_SUITE_TOKEN> npm test
note:
If you want to verify against local Test Analytics, add
BUILDKITE_ANALYTICS_URL=http://analytics-api.buildkite.localhost/v1/uploads
env when running the command:Deployment
Publish to NPM registry