-
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
Run tests in runfiles directory without LCOV_MERGER
#15030
Conversation
`collect_coverage.sh` has the execution root as it's working directory, but tests should still be run from their runfiles directory if `LCOV_MERGER` is missing.
As discovered in bazelbuild#15030 there was another bug with the short circuiting coverage logic where tests were not run from the correct directory. In that PR this issue is fixed directly, with this change we instead make missing LCOV_MERGER be deferred until after all test setup and run, which I think is more future proof to other changes here, and also allows users to know their tests are being run with coverage, and output the correct files, even in the case they don't setup the coverage merger infrastructure.
Thanks for submitting this! Seeing another issue with this setup code I submitted this alternative that I think would be more future proof, but it's up to @c-mita to decide on which approach makes sense. Can you add a test similar to the runfiles tests I added in my PR to catch regressions in the case @c-mita wants to go with this change? |
As discovered in bazelbuild#15030 there was another bug with the short circuiting coverage logic where tests were not run from the correct directory. In that PR this issue is fixed directly, with this change we instead make missing LCOV_MERGER be deferred until after all test setup and run, which I think is more future proof to other changes here, and also allows users to know their tests are being run with coverage, and output the correct files, even in the case they don't setup the coverage merger infrastructure.
I also think that the approach of #15031 is more future-proof. I can't edit the PR at the moment, but will do so in case the other PR can't be used for some reason. |
I think @keith's approach is better here; deferring the |
As discovered in #15030 there was another bug with the short circuiting coverage logic where tests were not run from the correct directory. In that PR this issue is fixed directly, with this change we instead make missing LCOV_MERGER be deferred until after all test setup and run, which I think is more future proof to other changes here, and also allows users to know their tests are being run with coverage, and output the correct files, even in the case they don't setup the coverage merger infrastructure. Closes #15031. PiperOrigin-RevId: 434715347
As discovered in bazelbuild#15030 there was another bug with the short circuiting coverage logic where tests were not run from the correct directory. In that PR this issue is fixed directly, with this change we instead make missing LCOV_MERGER be deferred until after all test setup and run, which I think is more future proof to other changes here, and also allows users to know their tests are being run with coverage, and output the correct files, even in the case they don't setup the coverage merger infrastructure. Closes bazelbuild#15031. PiperOrigin-RevId: 434715347
As discovered in #15030 there was another bug with the short circuiting coverage logic where tests were not run from the correct directory. In that PR this issue is fixed directly, with this change we instead make missing LCOV_MERGER be deferred until after all test setup and run, which I think is more future proof to other changes here, and also allows users to know their tests are being run with coverage, and output the correct files, even in the case they don't setup the coverage merger infrastructure. Closes #15031. PiperOrigin-RevId: 434715347 Co-authored-by: Keith Smiley <[email protected]>
collect_coverage.sh
has the execution root as it's working directory, but tests should still be run from their runfiles directory ifLCOV_MERGER
is missing.