Repository navigation
run_semantic_tests: preserve package discovery in parallel - #7073
ODanielAtaide wants to merge 5 commits into
Conversation
|
I reproduced a serial/parallel discrepancy at Could the runner treat a package job with exit 5 and zero discovered tests as empty, while still failing if the entire suite runs zero tests? It would keep the initializer/import-error coverage without turning a passing suite red because it contains a helper package. A mixed passing-file/empty-package regression test would cover the difference. AI-assisted (Codex). Synthetic inputs only. |
Keep all-empty runs failing and preserve unittest skip results. Reported-by: Yedayaa
|
Thanks for the reproducer. I confirmed the same false failure with CPython 3.14.7 on Windows. The updated runner passed all 11 tests, including the new empty-package, empty-file, all-empty, and explicit-skip cases. A clean three-way merge with #6515 at No Game Data and whitespace checks passed. AI-assisted: yes (Codex). |
|
Tested 99e3b43 merged with main 8575d36 on Linux/Python 3.12.16: pass
|
Fail discovery before launching unittest workers when a standalone test and a package import under the same name.
|
On Windows with CPython 3.14.7 I compared serial and parallel discovery with two synthetic files: test_real.py containing one passing unittest, and an identical backup named test_real.saved.py. At d3821ab, running scripts/run_semantic_tests.py SUITE -j 1 passes one test (exit 0). With -j 2 the runner also schedules test_real.saved and reports AttributeError from unittest (exit 1). On main 7ec3056 the parallel path instead fails in getsize on test_real/saved.py. Would you include the standalone filename filtering in this PR? We have left that selector with your change. AI-assisted. |
|
Thanks for the reproducer. I pushed |
Keep the valid module filename check and preserve the filename's spelling when loading it. Cover mixed-case prefixes and extensions on Windows.
Claimed in the coordination issue.
What and why
The CI runner schedules nested
test*.pyfiles directly when using multiple jobs. This skips tests and import errors in package initializers and bypasses the package'sload_testshook. A failing initializer can produce a green run, and an excluded test can produce a red run.Schedule each top-level test package as one standard
unittest discoverjob, with the suite directory as the import root. Standalone test files still run one per worker. The package regressions cover initializer tests, import errors,load_testsselection, and recursive discovery.Tested
python -I tests/test_run_semantic_tests.py -vpassed all 8 tests. Before the runner change, the new regressions reproduced two false passes and one false failure.-j 2 -vCLI.e6c4d25aapplied cleanly; the combined runner suite passed all 10 tests.AI-assisted: yes (Codex).
Checklist