-
Notifications
You must be signed in to change notification settings - Fork 115
Description
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 from jest-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 while jest-junit writes to a folder defined by the config or JEST_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 in JEST_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 like
"jest-junit": {
"outputName": "env_var:JEST_JUNIT_OUTPUT_DIR"
}
I'm happy to put up a PR for the proposed feature if you think it's a good idea.