Commit 9055ade
Add docs-tests.yml workflow; carve test_doc_snippets.py out of rust-test.yml
PR igerber#389 (Batch A) shipped six broken HAD doc snippets in 2026-04 that
no CI run caught because rust-test.yml only triggers on
rust/, diff_diff/, tests/, pyproject.toml, and the workflow file —
none of which include docs/. PR igerber#396 patched the snippets but did not
address the structural gap. This PR addresses it.
Two changes:
1. New .github/workflows/docs-tests.yml — separate workflow that
runs `pytest tests/test_doc_snippets.py -v` on a single
ubuntu-latest / py3.14 / pure-Python runner. Triggers on
docs/, diff_diff/, tests/test_doc_snippets.py, pyproject.toml,
and the workflow file itself; same ready-for-ci label gate as
rust-test.yml / notebooks.yml. Mirrors notebooks.yml's shape
(the existing precedent for `pytest`-validated docs assets) so
the two doc-validation workflows look like siblings.
2. .github/workflows/rust-test.yml: add
--ignore=tests/test_doc_snippets.py to all three pytest
invocations so doc snippets stop riding the code workflow.
The Pure Python Fallback edit (line 193) is the only one that
changes CI signal: that job runs from the repo root and was the
ONLY place where test_doc_snippets.py actually executed. The two
Rust-matrix edits (lines 158, 165) are defensive consistency: the
matrix copies tests/ to /tmp/tests (rust-test.yml:138, 142)
without docs/, so DOCS_DIR resolves to /tmp/docs/ which doesn't
exist; the test collector silently skips every RST file via the
guard at tests/test_doc_snippets.py:129. Adding --ignore there
prevents the no-op from becoming a real run if anyone later adds
`cp -r docs ...` to the copy steps. Each invocation now carries
an in-YAML comment documenting which case it's the defensive vs
behavior-changing edit.
Verification:
- python -c "import yaml; yaml.safe_load(open('.github/workflows/
docs-tests.yml')); yaml.safe_load(open('.github/workflows/
rust-test.yml'))" — both files well-formed.
- pytest tests/ --ignore=tests/test_doc_snippets.py
--ignore=tests/test_rust_backend.py --collect-only — 0 occurrences
of test_doc_snippets in the collected set (was 115 cases collected
when not ignored), confirming pytest accepts repeated --ignore
flags as the existing line-193 pattern with --ignore=tests/
test_rust_backend.py already showed.
After this PR opens, the workflow file itself triggers docs-tests.yml
on its own change, providing the first end-to-end CI validation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8e1282b commit 9055ade
2 files changed
Lines changed: 67 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | | - | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
193 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
0 commit comments