Skip to content

restore coveralls.io test coverage reporting#22700

Merged
cburroughs merged 13 commits intopantsbuild:mainfrom
cburroughs:csb/coveralls
Sep 30, 2025
Merged

restore coveralls.io test coverage reporting#22700
cburroughs merged 13 commits intopantsbuild:mainfrom
cburroughs:csb/coveralls

Conversation

@cburroughs
Copy link
Copy Markdown
Contributor

@cburroughs cburroughs commented Sep 25, 2025

coveralls.io is a (free for open source) service for visualization and reporting code coverage. It cane do basic things like chart coverage over time, aggregate statistics, and visualize individual files. The Pants project appears to have had at least some nascent integration circa 2021 and when I logged in the pantsbuild/ pants repo was already here. This PR re-enabled integration using their stock GitHub Action: https://github.com/coverallsapp/github-action

90% of the complication & code has to due with how we do test sharding. Because we shard the tests we need to both report the coverage for each shard, name the test suites, and then setup the GitHub needs dependencies so that we can tell coveralls when we are "done". That required some rejiggering so that jobs know their own id.

Next steps after this lands and all is well:

  • Informational links in PRs
  • Cool README badge

@cburroughs cburroughs self-assigned this Sep 25, 2025
@cburroughs cburroughs added the release-notes:not-required [CI] PR doesn't require mention in release notes label Sep 25, 2025
@cburroughs cburroughs changed the title coveralls wip restore coveralls.io test coverage reporting Sep 26, 2025
@cburroughs
Copy link
Copy Markdown
Contributor Author

cburroughs commented Sep 29, 2025

Example PR report: https://coveralls.io/builds/75741961

image

@cburroughs cburroughs marked this pull request as ready for review September 29, 2025 20:01
@benjyw
Copy link
Copy Markdown
Contributor

benjyw commented Sep 29, 2025

Neat!

I find those 20-something numbers surprising. Every integration test should cover a lot of the core and the relevant backend, at least.

I wonder if we should run unit tests separately and only measure coverage on them? That would be for a followup of course.

- test_python_macos13_x86_64
- classify_changes
runs-on:
- ubuntu-22.04
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any particular reason 22?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, it is what our generator script spit out.

name: logs-python-test-Linux-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confirming: This means coveralls can't break a build, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not quite, that one is to satisfy the GitHub Action rules so that we upload coverage even if one of the test fails so we can see what code was executed when the test failed.

I added fail-on-error: false which should accomplish the "can't break a build" run.

Copy link
Copy Markdown
Member

@sureshjoshi sureshjoshi left a comment

Choose a reason for hiding this comment

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

Approving assuming this doesn't have any significant impact on CI time (which I can't imagine it does compared to how long CI takes) - and that it failing for any reason won't break our CI... We have enough of that going around recently.

@cburroughs cburroughs enabled auto-merge (squash) September 30, 2025 18:17
@cburroughs cburroughs merged commit 007669f into pantsbuild:main Sep 30, 2025
25 checks passed
cburroughs added a commit to cburroughs/pants that referenced this pull request Oct 20, 2025
The coverage.io reporting was restored in pantsbuild#22700.  It was run mostly
successfully for a few weeks now, so let's add pretty coverage badge.
cburroughs added a commit that referenced this pull request Oct 21, 2025
The coverage.io reporting was restored in #22700. It was run mostly
successfully for a few weeks now, so let's add pretty coverage badge.

<img width="499" height="133" alt="image"
src="https://github.com/user-attachments/assets/5a2d3e81-b9db-4fd2-a3c1-50912d68ecd0"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants