Skip to content

fix(tests): add --cov-append to gapic-generator and proto-plus to preserve monorepo coverage#17603

Merged
parthea merged 4 commits into
mainfrom
add-cov-append
Jun 30, 2026
Merged

fix(tests): add --cov-append to gapic-generator and proto-plus to preserve monorepo coverage#17603
parthea merged 4 commits into
mainfrom
add-cov-append

Conversation

@parthea

@parthea parthea commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The cover presubmit job failed in https://github.com/googleapis/google-cloud-python/actions/runs/28464524723/job/84362399849?pr=17600 with No data to report for db-dtypes.

While most packages correctly use the --cov-append flag, both gapic-generator and proto-plus were missing it in their respective noxfile.py configurations. When their test suites executed, pytest-cov fell 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 as db-dtypes), causing the downstream coverage aggregation job to fail.

Changes

  • Added the --cov-append flag to the pytest commands in packages/gapic-generator/noxfile.py.
  • Added the --cov-append flag to the pytest commands in packages/proto-plus/noxfile.py.
  • Use "--cov-fail-under=0", when running pytest in gapic-generator. Each package should specify fail_under in .coveragerc

This ensures these packages safely add their coverage data to the shared file without destroying the results of any packages that were tested before them.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/gapic-generator/noxfile.py Outdated
Comment thread packages/proto-plus/noxfile.py Outdated
@parthea parthea changed the title fix: add --cov-append to all unit test sessions fix(tests): add --cov-append to gapic-generator and proto-plus to preserve monorepo coverage Jun 30, 2026
@parthea parthea marked this pull request as ready for review June 30, 2026 19:13
@parthea parthea requested a review from a team as a code owner June 30, 2026 19:13

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@parthea parthea enabled auto-merge (squash) June 30, 2026 19:36
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2026
@parthea parthea merged commit 2ddcf4d into main Jun 30, 2026
96 checks passed
@parthea parthea deleted the add-cov-append branch June 30, 2026 19:40
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.

3 participants