Repository navigation
CI: install SPIRV-Tools in the semantic-tests job; a missing tool fails instead of skipping (TEST-604) - #3091
Conversation
… when it is missing (TEST-604)
|
From the closed duplicate #3111: one addition you could consider. On the Linux leg, also fail when unittest's summary reports any log="$RUNNER_TEMP/semantic.log"
python -m unittest discover -s tests/semantic -v 2>&1 | tee "$log"
if [[ "$FAIL_ON_SKIP" == true ]] && grep -Eq '^(OK|FAILED) \(.*skipped=[0-9]+' "$log"; then
echo "::error::semantic tests were skipped on a runner that has every tool they need:"
grep -E '\.\.\. skipped' "$log" || true
exit 1
fi( |
|
Thanks @Vyral1978. I checked the idea against our fork run: on the Linux leg the suite is 4143 tests with no skips today, so a fail-on-skip step would pass now. I did not add it, because it turns any test that later skips on Linux for a legitimate reason (a missing GPU or driver, a platform check) into a red job for whoever adds it, and the cost of that falls on contributors rather than on the tests that were going quiet. The SPIRV-Tools case, which was the silent one, is covered by the install step plus test_spirv_tools_required.py, and the guard in tests/test_ci_registration.py keeps ci.yml doing both. If @ItsNotRexed or @KoertLichtendonk would rather have the blanket rule, I'll add your step (with an allowlist for skips that are expected on a runner) on this PR. Your note on test_cmp_class_f32_mods.py is already covered: the guard's scan picks it up through its |
|
Tested 8d56b13 on Windows 11 (Python 3.13.7, Vulkan SDK 1.4.363 SPIRV-Tools on PATH, no game files): pass for the Python side; the workflow step itself can't run locally
Not run: the |
Claimed in the coordination issue as: TEST-604 (claim); found by @tupacfan04.
What and why
The
semantic-testsjob installs nothing, and the runner images have neitherspirv-asnorspirv-val. Every semantic test that assembles or validates the translator's output with them skips (test_fma_khr,test_bary_fallback,test_image_coherent, and others), so the job reports green for tests that never ran..github/workflows/ci.yml: the Linux leg ofsemantic-testsinstallsspirv-toolsand runs withLEONIDA_REQUIRE_SPIRV_TOOLS=1. The Windows leg is unchanged (it has no SPIRV-Tools and keeps skipping those tests).tests/semantic/test_spirv_tools_required.py(new): withLEONIDA_REQUIRE_SPIRV_TOOLS=1, a missing or non-runningspirv-as/spirv-valis a failure. Without the variable it skips, so a developer's machine is unaffected.tests/test_ci_registration.py(the tests: guard CI test registration across both jobs #2188 guard): finds thetests/semanticfiles that skip without SPIRV-Tools and fails when thesemantic-testsjob does notapt-get installspirv-toolsor does not setLEONIDA_REQUIRE_SPIRV_TOOLSto1. It reads the job fromci.yml, not from a copy. A second test builds broken copies of the workflow and checks that each problem is named.Tested
workflow_dispatch, run 45059604321): bothsemantic-testslegs pass. Onubuntu-latestthe suite is 4143 tests, none skipped, in 267 s (under the job's 10 minute limit), andtest_fma_khr.test_spirv_tools_accept_itand the new test both reportok, with the distro'sspirv-tools. Onwindows-latestthe same tests reportskippedas before (OK, skipped=5).python -I tests/test_ci_registration.py7/7. WithLEONIDA_REQUIRE_SPIRV_TOOLS=1and the tools offPATH,test_spirv_tools_required.pyfails with "spirv-as is not on PATH"; with them onPATHit passes; without the variable it skips.ci.ymlthe new guard test fails with "it does notapt-get installspirv-tools; it never sets LEONIDA_REQUIRE_SPIRV_TOOLS to 1".checkjob fails onwindows-latestintests/test_report_paths.py::test_macos_case_sensitive_volume_keeps_case(path_keylower-cases a Windows path), and it fails the same way on a clean checkout ofmain16282101. tests: pass the no-game Python tests on Windows with a non-ASCII profile path #2984 already fixes it, so that job should go green once it lands.Open question: should the Windows leg get SPIRV-Tools too (for example
choco install vulkan-sdk)? I left it out because it is a large install against a 10 minute job limit.AI-assisted (Claude Code). No game data.
Checklist
docs/design.md, with how it was confirmed. (No translator rule in this change.)