ci: a docs-only pull request runs every test that reads the document it changes (OLD-799) #374
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/374"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by ItsMrDubey on 2026-11-24T04:03:53Z.
Claimed in the coordination issue as: OLD-799 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982)
What and why
OLD-799 asks for the CI path-filter blind spots: a file whose change would not start a job that depends on it. The workflow-linting half is already covered by
jactionlint.yml(.github/**), so this PR only covers the filters.I went through every workflow's filters, and through what each job reads:
runtime.yml(windows, wine, linux, macos)paths:listtools/*.pythroughruntime/test/shaders/build.py,runtime/cmake/translator_deps.cmake,scripts/run_gpu_tests.py, CMake../tools/*.py,scripts/**,.gitattributes,third_party/**tests/test_runtime_paths.pyalready recomputes the import chain and everytools/entry is listed. (build.pynamestests/semantic/fixtures/ps_mullit, but that file isn't tracked and no CI job runsmullit_readback.py.)xma2-decoder.ymlruntime/xma_decoder/**,third_party/xma/**, itselfxmacrate comes from git throughCargo.lock(in the tree)jactionlint.yml.github/**no-game-data.yml,conflict-label.ymlci.ymlcheck,stdlib-tests-linux,macos-pythonchange-scopewhen onlyREADME.md,CONTRIBUTING.md,AGENTS.mdordocs/**/*.mdchangedtests/test_docs_*.pyread those documents from the repositoryThe four documentation readers that a docs-only pull request skips:
tests/test_design_contract_rows.pyreadsdocs/design.md(rows repeated within a table).tests/test_exe_checklist.pytest_this_repositoryrunsexe_checklist.collect(ROOT)over everydocs/*.mdand expects the UNVERIFIED/ASSUMPTION notes inruntime_imports.md,d3d12_vulkan.mdandmodding.md.tests/test_make_game_preflight.pytest_ensure_submodule_names_the_clone_command_the_readme_givesreadsREADME.md.tests/test_progress_dashboard.pytest_default_repo_is_the_one_the_readme_clonesreadsREADME.md.So a PR that only edits the README clone line, drops one of those notes or duplicates a design.md row goes green, and main fails after the merge. To confirm the list, I ran every test file under a
sys.addaudithookopenhook that records each document it reads from the repository. Outsidetest_docs_*/test_i18n_indexit found the first, second and fourth. The make_game file errors out early under 3.11 (ntpath.isjunction, which is 3.12+), so the hook never reached its README case. That case was run on its own and opensREADME.mddirectly (line 690).Fix: the docs-only step now runs
test_design_contract_rows.pyin its loop. For the other three it runs only the cases that read a document, named one by one, so the docs-only job stays a few seconds long. No filter was removed.tests/test_ci_registration.pynow checks this too. It scans every tracked test with the AST foros.path.join(<root>, ...)calls that build a document path, where<root>is__file__or a module-level name derived from it (synthetic trees under a temporary folder don't count). It also keeps a short list of tests that reach the documents through a tool (test_exe_checklist.py). It fails when one of these tests isn't run by the docs-only step. Like the existing docs-only check, it uses the standard library only, with no PyYAML and regex/AST parsing.Tested
Windows 11, Python 3.11.9, no GPU needed.
python -I tests/test_ci_registration.py: 19 tests OK. Before theci.ymlchange, the new repository test fails and lists the four files.python -I tests/test_runtime_paths.py: 5 tests OK (Runtime filter unchanged and complete).test_docs_*.py,test_i18n_index.py,test_design_contract_rows.pyand the three named cases pass.tests/test_*.py(stdlib files underpython -I, pytest files under pytest): document reads only in the files above.python -I scripts/check_no_game_data.py .github/workflows/ci.yml tests/test_ci_registration.py: clean.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. n/a: no translator ruleImported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:34:03Z.
Looks good. With the PR on current
main,tests/test_ci_registration.pypasses, and the three single cases the docs-only step now runs exist and pass by name (ExeChecklist.test_this_repository,PreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives,Github.test_default_repo_is_the_one_the_readme_clones), as doestests/test_design_contract_rows.py. Ship. AI-assisted review.Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T06:24:47Z.
I ran the docs step from
13d0c9d10onmaind1dff7949in Git Bash on Windows. All 69 tests passed. I then changed only the README clone URL in the test checkout. The original step passed, and the new step caught it inPreflightPrerequisiteTest.test_ensure_submodule_names_the_clone_command_the_readme_gives.One limit I reproduced in the guard: if two methods in the same test file read repository docs and the workflow invokes only one by name,
document_readers_not_run_for_docs_onlyreports no missing coverage. The four current readers are covered.AI-assisted testing.