-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Export BAZEL_TEST=1
for bazel test
executables
#15393
Export BAZEL_TEST=1
for bazel test
executables
#15393
Conversation
It is possible to pass extra env var with --test_env, for example, |
Well, yes, that would work. However, do we expect anyone that uses {{catch2}} (or other test frameworks) to add {{--test_env}} to their {{.bazelrc}}. I would say that would be a UX/DX regression for usage of test frameworks. Unless we can propagate a test environment variable upon the usage of Bazel does test framework specific stuff in the test runner: # Tell googletest about Bazel sharding.
if [[ -n "${TEST_TOTAL_SHARDS+x}" ]] && ((TEST_TOTAL_SHARDS != 0)); then
export GTEST_SHARD_INDEX="${TEST_SHARD_INDEX}"
export GTEST_TOTAL_SHARDS="${TEST_TOTAL_SHARDS}"
fi
export GTEST_TMP_DIR="${TEST_TMPDIR}"
# TODO(ulfjack): Update Gunit to accept XML_OUTPUT_FILE and drop this env
# variable.
GUNIT_OUTPUT="xml:${XML_OUTPUT_FILE}" Removing |
I see, seems like we should go with this option. But maybe choosing a more explicit name? Like |
Sure. Maybe I'm not here for bikeshedding though and Depending on the naming I can respin the patch and PR description to match. |
|
def2219
to
2c7aa70
Compare
[Catch2][catch2] has [learnt][pr2399] how to output JUnit to the `XML_OUTPUT_FILE`. However, the upstream developers [felt][comment] that `XML_OUTPUT_FILE` is too generic to blanket enable JUnit output to the file as there are various XML reporters for Catch2. This patch enables exporting `BAZEL_TEST` environment variable so that Catch2 can enable JUnit output support unconditionally in their build when both `BAZEL_TEST` _and_ `XML_OUTPUT_FILE` are available. [catch2]: https://github.com/catchorg/Catch2 [pr2399]: catchorg/Catch2#2399 [comment]: catchorg/Catch2#2399 (comment)
2c7aa70
to
967ae3d
Compare
BAZEL_XML_OUTPUT_FILE
BAZEL_TEST=1
for bazel test
executables
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.
Thank you!
@sgowroji Please help import this PR once the tests pass ;) |
Catch2 has learnt how to output JUnit to the
XML_OUTPUT_FILE
. However, the upstream developersfelt that
XML_OUTPUT_FILE
is too generic to blanket enable JUnit output to the file as there are variousXML reporters for Catch2.
This patch enables exporting
BAZEL_TEST
environment variable so that Catch2 can enable JUnit output supportunconditionally in their build when both
BAZEL_TEST
andXML_OUTPUT_FILE
are available.