Skip to content

tests: skip spirv_gs_to_compute without llvm-mc - #1476

Closed
Kam471 wants to merge 1 commit into
ItsNotRexed:mainfrom
Kam471:testfix/windows-triage
Closed

Kam471 wants to merge 1 commit into
ItsNotRexed:mainfrom
Kam471:testfix/windows-triage

Conversation

@Kam471

@Kam471 Kam471 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

What was wrong

tests/test_spirv_gs_to_compute.py uses the make_shader fixture, which shells out to llvm-mc, but it was the only translator test module not gated by requires_tools. On a machine without llvm-mc, pytest crashes in fixture setup instead of skipping:

tests\conftest.py:166: TypeError
E   TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
FAILED tests/test_spirv_gs_to_compute.py::test_rejects_non_geometry
ERROR tests/test_spirv_gs_to_compute.py::test_layout
ERROR tests/test_spirv_gs_to_compute.py::test_compute_module
ERROR tests/test_spirv_gs_to_compute.py::test_cli_writes_module_and_layout
1 failed, 3 errors in 0.14s

All four tests take make_shader (directly or through the gs_tri fixture), so the module-level marker is correct. Sibling modules (test_translate.py, test_mesh_compute.py, test_image_load_d16_typed.py) already use it; this module (d1474ee1, SHADER-159) missed it.

Fix

-from conftest import make_dxbc, signature_chunk
+from conftest import make_dxbc, requires_tools, signature_chunk
+
+pytestmark = requires_tools

Before / after on the same machine (no llvm-mc)

Before: 1 failed, 3 errors as above.

After:

ssss                                                                     [100%]
SKIPPED [4] ... needs an llvm-mc built with the amdgcn target, and spirv-as/spirv-val on PATH;
                LLVM_MC=None, found llvm-mc: None, spirv-as/val: True
4 skipped in 0.05s

With the documented WSL tool setup (LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc), the same four tests still run: 4 passed.

Full suite after the change: 4273 passed, 456 skipped, 24922 subtests passed (0 failures). The documented Windows CI loop also passes 151/151 stdlib test files, and the semantic suite is 1194 tests, OK.

Test-only change; no game data.

The module uses the make_shader fixture, which needs llvm-mc, but unlike the other translator tests it was not gated by requires_tools. Without llvm-mc, pytest fails in fixture setup with TypeError: unsupported operand type(s) for +: 'NoneType' and 'list' instead of skipping.

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared both patches: #1418 already adds the same module-level pytestmark = requires_tools to this exact test file, with the same skip behavior. The coordinator has also flagged this TEST-203 overlap in #1380. Please close this duplicate or coordinate a distinct change before merge; #1418 is the earlier complete fix.

@Kam471

Kam471 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by 8a79601b on main ("spirv_gs_to_compute: fix OpPhi from the split entry block; skip tests without llvm-mc"), which adds @requires_tools to each of the four tests.

Verified on origin/main (99f99890) in a clean worktree, with no LLVM_MC set:

python -m pytest tests/test_spirv_gs_to_compute.py -q -rs
ssss.                                                                    [100%]
1 passed, 4 skipped in 0.30s

The same failure the PR fixed is already gone, so I'm closing it rather than rebasing a duplicate. The branch Kam471:testfix/windows-triage can be deleted. Thanks to whoever landed the per-test fix first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants