Skip to content

Commit 9247535

Browse files
chore: Finish factoring unit tests from presubmit (#1492)
* chore: Finish factoring unit tests from presubmit * adjust cover requirement to 83 * add back test directory coverage * ignore some non-prod directories for coverage * amend omit arg in cover to work properly * reduce cov threshold to 84
1 parent bb45db8 commit 9247535

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

noxfile.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@
119119
# Sessions are executed in the order so putting the smaller sessions
120120
# ahead to fail fast at presubmit running.
121121
nox.options.sessions = [
122-
"unit",
123122
"system-3.9",
124123
"system-3.12",
125124
"cover",
125+
# TODO(b/401609005): remove
126126
"cleanup",
127127
]
128128

@@ -471,20 +471,31 @@ def cover(session):
471471
session.install("coverage", "pytest-cov")
472472

473473
# Create a coverage report that includes only the product code.
474+
omitted_paths = [
475+
# non-prod, unit tested
476+
"bigframes/core/compile/polars/*",
477+
"bigframes/core/compile/sqlglot/*",
478+
# untested
479+
"bigframes/streaming/*",
480+
# utils
481+
"bigframes/testing/*",
482+
]
483+
474484
session.run(
475485
"coverage",
476486
"report",
477487
"--include=bigframes/*",
488+
# Only unit tested
489+
f"--omit={','.join(omitted_paths)}",
478490
"--show-missing",
479-
"--fail-under=85",
491+
"--fail-under=84",
480492
)
481493

482-
# Make sure there is no dead code in our test directories.
494+
# Make sure there is no dead code in our system test directories.
483495
session.run(
484496
"coverage",
485497
"report",
486498
"--show-missing",
487-
"--include=tests/unit/*",
488499
"--include=tests/system/small/*",
489500
# TODO(b/353775058) resume coverage to 100 when the issue is fixed.
490501
"--fail-under=99",

0 commit comments

Comments
 (0)