Skip to content

Commit b4739ec

Browse files
authored
chore: count */core/*.py files for code coverage tests (#1080)
* chore: count */core/*.py files for code coverage tests * counts test coverage for product and test codes seperately * fail-under=87
1 parent bd23ec3 commit b4739ec

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.coveragerc

-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ exclude_lines =
3434
omit =
3535
*/gapic/*.py
3636
*/proto/*.py
37-
*/core/*.py
3837
*/site-packages/*.py
3938
google/cloud/__init__.py

noxfile.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,15 @@ def cover(session):
432432
(including system test runs), and then erases coverage data.
433433
"""
434434
session.install("coverage", "pytest-cov")
435-
session.run("coverage", "report", "--show-missing", "--fail-under=90")
435+
436+
# Create a coverage report that includes only the product code.
437+
session.run(
438+
"coverage",
439+
"report",
440+
"--include=bigframes/*",
441+
"--show-missing",
442+
"--fail-under=86",
443+
)
436444

437445
# Make sure there is no dead code in our test directories.
438446
session.run(

owlbot.py

+7
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@
130130
"BigQuery DataFrames provides DataFrame APIs on the BigQuery engine",
131131
)
132132

133+
# Don't omit `*/core/*.py` when counting test coverages
134+
assert 1 == s.replace(
135+
[".coveragerc"],
136+
re.escape(" */core/*.py\n"),
137+
"",
138+
)
139+
133140
# ----------------------------------------------------------------------------
134141
# Samples templates
135142
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)