Skip to content

Commit 9b565a6

Browse files
aeiwzclaude
andcommitted
test(ci): rewrite test-gate section with JUnit output, coverage artifacts, stricter threshold
- Add pyproject.toml to register slow/perf marks (enables --strict-markers) - Remove --no-header and -q so Python/pytest version appear in CI logs - Add --junit-xml per Python version for GitHub test annotations - Add --cov-report=xml per Python version for coverage tracking - Raise --cov-fail-under from 43 to 48 (actual coverage is ~50%) - Upload test results and coverage XML as artifacts on every run (pass or fail) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 798340a commit 9b565a6

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,26 @@ jobs:
5656

5757
- name: Run functional tests (excluding slow/perf)
5858
run: |
59-
pytest -q --no-header \
59+
pytest \
6060
-m "not slow and not perf" \
61+
--junit-xml=test-results/py${{ matrix.python-version }}.xml \
6162
--cov=metbit \
62-
--cov-fail-under=43
63+
--cov-report=xml:coverage-py${{ matrix.python-version }}.xml \
64+
--cov-fail-under=48
65+
66+
- name: Upload test results
67+
if: always()
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: test-results-py${{ matrix.python-version }}
71+
path: test-results/
72+
73+
- name: Upload coverage report
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: coverage-py${{ matrix.python-version }}
78+
path: coverage-py${{ matrix.python-version }}.xml
6379

6480
# ---------------------------------------------------------------------------
6581
# 2. Source distribution

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tool.pytest.ini_options]
2+
minversion = "7.0"
3+
addopts = "--tb=short --strict-markers"
4+
testpaths = ["tests"]
5+
markers = [
6+
"slow: tests that take more than a few seconds (deselect with '-m not slow')",
7+
"perf: performance and throughput benchmarks (deselect with '-m not perf')",
8+
]

0 commit comments

Comments
 (0)