build: suppress per-shard pytest coverage table in unit-tests CI#38768
Open
feanil wants to merge 1 commit into
Open
build: suppress per-shard pytest coverage table in unit-tests CI#38768feanil wants to merge 1 commit into
feanil wants to merge 1 commit into
Conversation
Each unit-test shard was printing a ~3,700-line per-file coverage table at the end of its log (the default `--cov=.` behavior is `--cov-report=term`). The numbers are also misleading per shard because each shard only runs a subset of the suite. The dedicated `coverage` job already does the meaningful work: it downloads every shard's `.coverage` artifact, runs `coverage combine` + `coverage report` + `coverage xml`, and uploads the result to codecov. Passing `--cov-report=""` to pytest disables the terminal report while leaving the `.coverage` data file intact, so codecov reporting is unaffected and the failure summary is much easier to find in the CI log. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each unit-test shard was printing a ~3,700-line per-file coverage table at the end of its log (default
--cov=.behavior is--cov-report=term). On a failing run, that table sits between the test progress dots and the end of the log, making it tedious to scroll to the failure summary. The numbers are also misleading per shard, since each shard runs only a subset of the suite.The dedicated
coveragejob in this same workflow already does the meaningful work: it downloads every shard's.coverageartifact, runscoverage combine+coverage report+coverage xml, and pushes the combined result to codecov.Passing
--cov-report=""to pytest disables only the terminal coverage report. The.coveragedata file is still written and uploaded as an artifact, so thecoveragejob and codecov reporting are unaffected.What changed
.github/workflows/unit-tests.yml: add--cov-report=""to thepytestinvocation in therun testsstep, with an inline comment explaining the intent.What this does NOT change
.coveragedata file is still produced and uploaded as an artifact.coveragejob still combines all shard artifacts and uploads to codecov.FAILED ...lines) is unchanged — it will now sit near the bottom of each shard's log instead of being buried above a 3.7k-line table.Motivated by trying to debug failures in #38763, where the failing-test lines were drowned out by per-shard coverage tables.