-
Notifications
You must be signed in to change notification settings - Fork 332
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
test: [M3-7844] - Add script to generate JSON payload for TOD test results #10422
test: [M3-7844] - Add script to generate JSON payload for TOD test results #10422
Conversation
Coverage Report: β
|
@@ -45,6 +45,7 @@ | |||
"coverage": "yarn workspace linode-manager coverage", | |||
"coverage:summary": "yarn workspace linode-manager coverage:summary", | |||
"junit:summary": "ts-node scripts/junit-summary/index.ts", | |||
"generate-tod": "ts-node scripts/tod-payload/index.ts", |
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.
In the future it would be nice to run these helper scripts with bun so we don't have to depend on ts-node
I guess we'd have to update our Jenkins pipelines and Github Actions to install bun first
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.
I doubt that'd be a big lift! I'll follow up with a ticket soon
Tested the commands and was able to successfully execute them. There was a warning message, I'll paste here for your attention:
Also, would this be an issue for maintainability in the future?
|
Thanks @carrillo-erik, and sorry for the slow response!
This one's new to me! I haven't been able to reproduce it, but
The usefulness of these warnings is debatable, but I think the intent is to let outside contributors know if they're running Cloud/the tests on a version of Node that isn't compatible with our codebase. The "supported" version is Node 18.x just because that's the version of Node we use in our test and deploy pipelines, but I'd be extremely surprised if there are compatibility issues with modern versions of Node. I was on the fence about getting rid of this warning when we upgraded from Node 14 -- curious if you have any opinion on that? Seems like it might cause more confusion than anything else |
Description π
This adds another script in
scripts/
to generate a payload for our internal test result store, TOD. See M3-7843 for the Cloud/TOD epic which provides more context and outlines our plan to integrate Cloud with TOD.The purpose of this script is to consume a JUnit XML file (or a bunch of JUnit XML files) and output a TOD-compatible JSON payload. This payload contains the JUnit data itself, along with various metadata describing the project and test run.
I opted to add the script here because it will need to be invoked from Jenkins and from GitHub Actions, and wanted to avoid having to implement the same script twice.
Changes π
yarn generate-tod
scriptHow to test π§ͺ
Pre-Requisites
You'll need at least one JUnit XML file to test with. The quickest way to generate one is to pass
--reporter=junit
when invokingyarn test
, like this:Alternatively, you can generate JUnit files using Cypress:
CY_TEST_JUNIT_REPORT=1 yarn cy:run -s "cypress/e2e/core/account/account-cancellation.spec.ts"
The JUnit files will be output to
cypress/results
.Testing
Confirm that
yarn generate-tod
script works as expected. Runyarn generate-tod --help
for a detailed breakdown of command syntax and optional parameters. Some scenarios to test:--appName
,--appBuild
,--appBuildUrl
,--fail
,--tag
, and related parametersAs an Author I have considered π€
Check all that apply