fix(tests): add --cov-append to gapic-generator and proto-plus to preserve monorepo coverage#17603
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds the '--cov-append' flag to the unit test configurations in 'packages/gapic-generator/noxfile.py' and 'packages/proto-plus/noxfile.py', but the flag is currently commented out in both files. The review comments correctly identify this issue and suggest uncommenting the flag to ensure coverage results are properly appended.
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.
The cover presubmit job failed in https://github.com/googleapis/google-cloud-python/actions/runs/28464524723/job/84362399849?pr=17600 with
No data to reportfordb-dtypes.While most packages correctly use the
--cov-appendflag, bothgapic-generatorandproto-pluswere missing it in their respectivenoxfile.pyconfigurations. When their test suites executed,pytest-covfell back to its default behavior and truncated the shared coverage file. This silently wiped out the coverage data of any packages that ran before them (such asdb-dtypes), causing the downstream coverage aggregation job to fail.Changes
--cov-appendflag to the pytest commands inpackages/gapic-generator/noxfile.py.--cov-appendflag to the pytest commands inpackages/proto-plus/noxfile.py."--cov-fail-under=0",when runningpytestingapic-generator. Each package should specifyfail_underin.coveragercThis ensures these packages safely add their coverage data to the shared file without destroying the results of any packages that were tested before them.