Skip to content

Fail Wine tests with invalid mapped working directories - #4547

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

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

Conversation

@AGInformatique81

Copy link
Copy Markdown

When a CTest WORKING_DIRECTORY maps inside the local checkout but the mapped path is missing or is a file, the Wine runner used to launch the test in the executable's directory. The test could then succeed with the wrong working directory. Report that test as failed before launch and include both paths. The fallback for entries without a mapped working directory stays as it is.

Native CTest 4.5.1 reported Not Run for a synthetic test with an explicitly missing working directory. The Wine runner's new regression covers both a missing directory and a file at the mapped path. Both cases falsely passed on main. A synthetic CLI run also confirmed the runner continues with the next test and exits 1 when the failing test is required.

  • python -I tests/test_run_wine_tests.py on Windows 11 / CPython 3.15.2: 46 passed, 5 POSIX-only skips.
  • python3 -I tests/test_run_wine_tests.py on WSL / CPython 3.14.7: 51 passed.
  • Clean trial merge with Apply CTest environment modifications under Wine #4378. The tests use synthetic files and a subprocess stand-in for Wine. No game files or GPU required.

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

@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 26d24733 on Windows 11: python -I tests/test_run_wine_tests.py -> 51 tests, OK (5 skipped); git diff --check clean.

A Wine test with an invalid mapped working directory now fails with the directory error instead of running in the wrong place; the runner tests pass. No blocking issue.

@Atomic258

Copy link
Copy Markdown

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

  • python -I tests/test_run_wine_tests.py → 51/51.
  • Negative control on main's scripts/run_wine_tests.py: 2 failures, so the invalid-working-directory cases discriminate.
  • Wine itself not run here; script logic only.
  • git diff --check and check_no_game_data.py clean.

AI-assisted (Devin).

@tupacfan04

Copy link
Copy Markdown
Contributor

PASS. tests/test_run_wine_tests.py 51 OK with 5 POSIX skips, compileall and git diff --check clean, merge clean. Negative control: main's script with these tests gives 2 failures ('pass' != 'fail'), one per subcase, so the bug is real and pinned. The caller prints the detail and counts a pre-launch fail, with exit 1 via --require (scripts/run_wine_tests.py:266-281).

Non-blocking gap: a listed WORKING_DIRECTORY outside --windows-root maps to None and still silently falls back to the exe dir (:140-144); tests/test_run_wine_tests.py:303 only covers mapped-inside paths. An explicit fail (or a warning) for an unmappable directory would match the new behaviour.

Approve. AI-assisted review, no game files, no GPU.

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.

4 participants