Skip to content

Honor CTest fixture setup dependencies in the Wine runner - #4558

Open
AGInformatique81 wants to merge 1 commit into
ItsNotRexed:mainfrom
AGInformatique81:fix/wine-ctest-fixtures
Open

AGInformatique81 wants to merge 1 commit into
ItsNotRexed:mainfrom
AGInformatique81:fix/wine-ctest-fixtures

Conversation

@AGInformatique81

Copy link
Copy Markdown

The Wine runner used to execute the CTest JSON in list order and ignore fixture setup failures. For example, the XDXR checks consume files made by fixture setup tests. Launching a check after setup failed can inspect stale artifacts or report a second, misleading failure.

Order the listed tests by CTest's DEPENDS edges and fixture setup requirements. Report a fixture consumer as failed without starting it when a setup test fails. Plain ordering dependencies still run after a failure, including cleanup tests. A cycle in the listing produces one error before launch.

  • Compared three runs using actual ctest --show-only=json-v1 output and synthetic processes. The Wine runner had the same execution order as CTest 4.5.1 for a passing, failing, and skipped setup. Both runners ran cleanup after the failed setup without launching its consumer.
  • python -I tests/test_run_wine_tests.py: 47 passed on Windows 11 / Python 3.15.2, with five POSIX-only skips. All 52 passed on WSL / Python 3.14.7. The new cases fail against the base.
  • A trial merge with Fail Wine tests with invalid mapped working directories #4547 was clean. The tests used a Python stand-in for Wine and did not require a GPU or game files.

Claimed as a new TEST item in the coordination thread. This builds directly on main. AI-assisted with Codex.

@Atomic258

Copy link
Copy Markdown

Tested e7ac88ea83 on Linux, Python 3.10, CPU only, synthetic fixtures, no game files: pass.

  • python -I tests/test_run_wine_tests.py → 52/52; tests/test_first_look_rebuild.py → 2 skipped (PowerShell-only).
  • Negative control on main's scripts/run_wine_tests.py: 4 failures, so the CTest fixture-setup dependency cases discriminate.
  • Wine itself not run here; script logic only.
  • git diff --check and check_no_game_data.py clean.

AI-assisted (Devin).

@Kam471 Kam471 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.

Ran this at e7ac88ea on Windows 11: python -I tests/test_run_wine_tests.py -> 52 tests, OK (5 skipped); git diff --check clean.

The Wine runner now honors CTest fixture setup dependencies, so fixtures run before the tests that need them; the added cases pass. No blocking issue.

@whattheflop whattheflop 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.

AI-assisted Windows CPU comparison at e7ac88ea and parent d0835dd9, uv CPython 3.12.13, CTest 4.4.5. I used actual ctest --show-only=json-v1 output from generated synthetic projects and a Python stand-in for Wine. The PR matches ctest -j1 in five fixture scenarios, including two setups with one failure, chained failure propagation, skipped/disabled setup, cleanup listed first, and plain DEPENDS after a failing consumer.

One ordinary ordering difference remains. List five tests as z, y, x, dep, w and give only dep a DEPENDS z property. CTest and the parent run z, y, x, dep, w. The PR runs z, y, x, w, dep because TopologicalSorter.static_order() drains its initial ready batch before considering the newly ready dep. All exits still match in this fixture. Selecting the earliest listed ready test after each completion would preserve the prior order here while honoring dependencies.

@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.

The setup dependency edges are present, but cleanup fixtures are not ordered after their consumers.

Comment thread scripts/run_wine_tests.py
required = list(dict.fromkeys(setup for fixture in values.get("FIXTURES_REQUIRED", [])
for setup in setups_by_fixture.get(fixture, [])))
requirements.append(required)
depends = [dependency for name in values.get("DEPENDS", []) for dependency in indexes_by_name.get(name, [])]

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.

[P2] The graph adds edges from setup to FIXTURES_REQUIRED consumers, but never from those consumers to tests marked FIXTURES_CLEANUP. With input order [cleanup, consumer, setup], static_order() can run cleanup before setup and consumer, deleting the fixture before its users. CTest guarantees cleanup runs after all tests requiring that fixture (https://cmake.org/cmake/help/latest/prop_test/FIXTURES_CLEANUP.html). The new test masks this by giving cleanup explicit DEPENDS on consumer and setup. Please model the consumer-to-cleanup edges and cover the unadorned fixture properties.

@Halfect

Halfect commented Nov 23, 2026

Copy link
Copy Markdown

Tested e7ac88ea on macOS 15.6.1 (Apple M2 Max), CPython 3.12, CPU only, no game files: pass, with one environment note that also clears the overlap with #4562.

AI-assisted.

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.

6 participants