-
Notifications
You must be signed in to change notification settings - Fork 110
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
Bazel + Jest: Dynamic location for jest-junit's xml file #167
Comments
Hey! Thanks for raising this issue. I'd be happy to accept a PR contribution that adds this functionality. Just curious wouldn't you be able to make use of jest-junit's environment variable to make this work?
|
Thanks @palmerj3 for the quick response. I found out bazelbuild's rules_nodejs recently added the However, we still need another config like We need the full path (dir + filename) to be dynamic because bazel has the capability to retry on flaky tests. Each retry produces a different xml filepath and we need to store and process all the xmls (both failed and passed attempts) to get better reporting on flaky tests. So given that rules_nodejs added the
Please let me know if anything is not clear. |
Thank you! I just published https://github.com/jest-community/jest-junit/releases/tag/v12.1.0 with your changes included. |
As mentioned in #34 (comment), when we run jest with Bazel, the tests are run in a test sandbox and the directory to the sandbox is not deterministic until the execution phase.
When bazel runs jest, bazel writes
test.xml
differently fromjest-junit
.test.xml
(generated by bazel) is in written in/private/var/tmp/[computer_name]/[unconsistent_hash]/execroot/[workspace_name]/bazel-out/darwin-fastbuild/testlogs/package_name/jest/test.log
whilejest-junit
writes to a folder defined by the config orJEST_JUNIT_OUTPUT_DIR
env var.The path to the testlogs (e.g.
XML_OUTPUT_FILE
) isn't defined until jest is executed by bazel. So we don't know the value to pass inJEST_JUNIT_OUTPUT_DIR
or the config statically.It would be great if we can pass in a global variable name for
jest-junit
to look at runtime. Something likeI'm happy to put up a PR for the proposed feature if you think it's a good idea.
The text was updated successfully, but these errors were encountered: