Skip to content
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 coverage runfiles directory issue #15031

Conversation

keith
Copy link
Member

@keith keith commented Mar 12, 2022

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.

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.
@keith keith force-pushed the ks/fix-coverage-runfiles-directory-issue branch from 68f65ab to 607809e Compare March 12, 2022 19:39
@keith
Copy link
Member Author

keith commented Mar 12, 2022

@c-mita checkout this comment #15030 (comment) for more context, I think this is the better long term option so we don't have more issues like this, and so users can rely on $COVERAGE == 1 even if they don't use coverage merging, but up to you!

Copy link
Member

@c-mita c-mita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

collect_coverage.sh is quickly becoming one of my least favourite files...

@bazel-io bazel-io closed this in a570f5f Mar 15, 2022
fmeum pushed a commit to fmeum/bazel that referenced this pull request Mar 15, 2022
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
Wyverald pushed a commit that referenced this pull request Mar 15, 2022
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]>
@keith keith deleted the ks/fix-coverage-runfiles-directory-issue branch March 22, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants