Skip to content

chore(ndb): restore fail_under=100 in .coveragerc and noxfile#17771

Merged
parthea merged 6 commits into
mainfrom
fix-ndb-coverage
Jul 20, 2026
Merged

chore(ndb): restore fail_under=100 in .coveragerc and noxfile#17771
parthea merged 6 commits into
mainfrom
fix-ndb-coverage

Conversation

@ohmayr

@ohmayr ohmayr commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Restore coverage for google-cloud-ndb

Towards #17459 🦕

@ohmayr
ohmayr requested a review from a team as a code owner July 20, 2026 08:57

@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 increases the coverage requirement to 100% for google-cloud-ndb, updates the excluded lines and omitted paths in .coveragerc, and adds the --fail-under=100 flag to the nox coverage report. Feedback highlights that globally excluding 'raise TypeError' from coverage is risky as it may mask untested validation paths, and recommends using individual pragmas instead. Additionally, specifying --fail-under=100 in noxfile.py is redundant since it is already defined in .coveragerc.

Comment on lines +14 to +15
# Ignore defensive assertions
raise TypeError

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.

medium

Globally excluding raise TypeError from coverage reporting is risky. TypeError is commonly raised during input validation, which is a critical part of the public API contract and should be thoroughly unit-tested. Excluding it globally can mask untested validation paths, defeating the purpose of a 100% coverage requirement. If there are specific, untestable defensive type checks, it is safer to exclude them individually using # pragma: no cover rather than ignoring all TypeError exceptions globally.

Comment thread packages/google-cloud-ndb/noxfile.py Outdated
@ohmayr
ohmayr force-pushed the fix-ndb-coverage branch from ef32454 to 89b574f Compare July 20, 2026 09:27
@parthea
parthea merged commit 38091ad into main Jul 20, 2026
39 checks passed
@parthea
parthea deleted the fix-ndb-coverage branch July 20, 2026 17:52
hebaalazzeh pushed a commit that referenced this pull request Jul 20, 2026
Restore coverage for google-cloud-ndb

Towards #17459 🦕
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.

2 participants