Skip to content

Commit 1370e4c

Browse files
committed
test: fail coverage if tests/test_*.py is < 100
1 parent d5aa5d7 commit 1370e4c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,15 @@ jobs:
223223
set -xe
224224
python igor.py combine_html
225225
226+
- name: "Check targets"
227+
run: |
228+
# Maybe someday goals will be a real feature
229+
python -m pip install wcmatch
230+
# Very crude check that nothing catastrophic has happened.
231+
python lab/goals.py --group 90 "coverage/*.py" "tests/*.py"
232+
# Absolutely all of our test code should be covered.
233+
python lab/goals.py --file 100 "tests/test_*.py"
234+
226235
- name: "Upload HTML report"
227236
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
228237
with:

igor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def do_combine_html():
265265
)
266266
total = cov.html_report(show_contexts=show_contexts)
267267
print(f"Total: {total:.3f}%")
268+
cov.json_report()
268269

269270

270271
def do_test_with_core(core, *runner_args):

0 commit comments

Comments
 (0)