Skip to content

Commit 3878538

Browse files
chrisguidryclaude
andcommitted
Scope CLI coverage to cli.py and _cli_support.py, enforce 100%
The previous attempt used --cov with file paths, but --cov only accepts packages/directories. Now using --cov=src/docket --cov=tests/cli with an explicit omit list in .coveragerc-cli that excludes all non-CLI source. Only cli.py, _cli_support.py, and tests/cli/ helper modules are measured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fb68fe2 commit 3878538

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

.coveragerc-cli

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22
branch = true
33
parallel = true
44
omit =
5-
src/docket/__main__.py
6-
src/docket/_uuid7.py
5+
src/docket/__*.py
6+
src/docket/_cancellation.py
7+
src/docket/_docket_snapshot.py
8+
src/docket/_execution_progress.py
79
src/docket/_prometheus_exporter.py
10+
src/docket/_redis.py
811
src/docket/_result_store.py
12+
src/docket/_telemetry.py
13+
src/docket/_uuid7.py
14+
src/docket/agenda.py
15+
src/docket/annotations.py
16+
src/docket/dependencies/*
17+
src/docket/docket.py
18+
src/docket/execution.py
19+
src/docket/instrumentation.py
20+
src/docket/strikelist.py
21+
src/docket/tasks.py
22+
src/docket/testing.py
23+
src/docket/worker.py
924
**/conftest.py
10-
tests/_key_leak_checker.py
11-
tests/_container.py
25+
tests/_*.py
26+
tests/test_*.py
27+
tests/cluster/*
28+
tests/concurrency_limits/*
29+
tests/fundamentals/*
30+
tests/instrumentation/*
31+
tests/worker/*
1232

1333
[report]
1434
exclude_also = ["\\.\\.\\.$"]

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,14 @@ jobs:
160160
- name: Run CLI tests
161161
env:
162162
REDIS_VERSION: "8.0"
163-
run: uv run pytest tests/cli/ --cov-config=.coveragerc-cli --cov-fail-under=0 --cov-report=xml --cov-report=term-missing:skip-covered
163+
run: >
164+
uv run pytest tests/cli/
165+
-o 'addopts=--import-mode=importlib'
166+
--numprocesses=logical --maxprocesses=4
167+
--cov=src/docket --cov=tests/cli
168+
--cov-branch --cov-config=.coveragerc-cli --cov-fail-under=100
169+
--cov-report=xml --cov-report=term-missing:skip-covered
170+
--timeout=30
164171
165172
- name: Upload coverage reports to Codecov
166173
uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)