Skip to content

Cleanup coverage CI job #6606

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

Merged
merged 2 commits into from
Jan 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -699,15 +699,13 @@ jobs:
run: cmake --build build -- -j2
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cmake --build build --target coverage -- -j2
- name: Collect coverage statistics
- name: Run CTest and collect coverage statistics
run: |
lcov --capture --directory build --output-file lcov.info
lcov --remove lcov.info '/usr/*' --output-file lcov.info
echo "lcov_excl_line = UNREACHABLE" > ~/.lcovrc
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! I'm not massively familiar with lcov (to my shame) so apologies if these are dumb questions... but:

  • Does this exclude only lines containing UNREACHABLE, or also any other lines following that in the same block/trace?
  • Do we want/need to do something similar for branch coverage with lcov_excl_br_line ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it only affects exactly that one line that has "UNREACHABLE." There are ways to mark entire blocks (details in https://linux.die.net/man/1/geninfo), which we could consider if deemed useful.

I don't think we measure branch coverage at this time, but if needed we could certainly extend the configuration.

cmake --build build --target coverage -- -j2
- name: Upload coverage statistics to Codecov
uses: codecov/codecov-action@v2
with:
files: ./lcov.info
files: build/html/coverage.info
fail_ci_if_error: true
verbose: true