-
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
Fix bazel coverage false negative #14807
Fix bazel coverage false negative #14807
Conversation
Previously this short circuit meant the tests weren't actually run, and they would always exit 0, in the case the test rule didn't set the lcov related attributes. More context: bazelbuild#13978
Maybe it would be safer to no-op LCOV_MERGER instead in case any of the test setup below this short circuit is expected even without this attribute |
Part of me agrees; I didn't really like the early exit in the first place and this makes the collect_coverage script more complicated. I think, for now, this best preserves the "old" behaviour, where effectively no coverage information is collected and none of the coverage outputs are generated (modulo the empty $COVERAGE_OUTPUT_FILE). |
Missing variables like But looking at the script a bit more, even though you would have missed some variable setup I think in the past this would have just failed when |
In the past this script wouldn't be run, it then started being run without the full setup. From my perspective, the early exit without full setup in this case isn't too bad for the time being, but this isn't a state of affairs I would be happy with for ever. |
Sg, should we merge and cherry pick for 5.1? |
@bazel-io fork 5.1 |
Previously this short circuit meant the tests weren't actually run, and they would always exit 0, in the case the test rule didn't set the lcov related attributes. More context: bazelbuild#13978 Closes bazelbuild#14807. RELNOTES: Fixed an issue where Bazel could erroneously report a test passes in coverage mode without actually running the test. PiperOrigin-RevId: 428756211 (cherry picked from commit 16de035)
Previously this short circuit meant the tests weren't actually run, and they would always exit 0, in the case the test rule didn't set the lcov related attributes. More context: #13978 Closes #14807. RELNOTES: Fixed an issue where Bazel could erroneously report a test passes in coverage mode without actually running the test. PiperOrigin-RevId: 428756211 (cherry picked from commit 16de035) Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
Previously this short circuit meant the tests weren't actually run, and
they would always exit 0, in the case the test rule didn't set the lcov
related attributes.
More context: #13978