intellij
intellij copied to clipboard
fix(test-go): add test_env to output all test results
Checklist
- [x] I have filed an issue about this change and discussed potential changes with the maintainers.
- [N/A see note below] I have received the approval from the maintainers to make this change.
- [x] This is not a stylistic, refactoring, or cleanup change.
Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See the Contributions section in the README for more details.
Discussion thread for this change
Issue number: https://github.com/bazelbuild/intellij/issues/2989
Description of this change
Root cause of the issue
By default Bazel running Go flavor tests doesn't output successful tests to the test.xml file. Which is what causes the "No tests were found" message.
Solution
To make Go log successful tests as well, we need to set -test.v
(verbose test output) on the test runner. Bazel Rules Go offers an environment variable (GO_TEST_WRAP_TESTV=1
) to set -test.v
on the test runner.
Changes explained
Since this is Go specific, I wanted to add the test_env
variable to GoTestContextProvider
, however the TestContext.Builder
doesn't offer that as a feature. So I added a new BlazeFlagsModification
as well as added an addTestEnv
method on Builder
.
Note on checklist
I made this change before I read about the approval to make change thing. Hope we can have the discussion here instead!
Hello @JamyDev, Thank you for contributing on the above PR. Could you please rebase as mentioned here and help us in submitting it.
Sorry for the long cycle time. Rebased! @sgowroji
Hi @sgowroji @tpasternak, do you think this could be reviewed/merged soon? We'd love to start using it.