run_semantic_tests: refuse the repository's tests folder, name tests/semantic (SEMANTIC-RUNNER-WRONG-FOLDER) #1442

Open
github-bot wants to merge 1 commit from github-bot/gh-1442 into main AGit
Owner

@⁠Anonymous78e on GitHub · 2026-11-25 00:18 UTC · original
Anonymous78e:scripts/semantic-runner-wrong-folder → main · +26 −0 · 2 files · 1 commits · open

Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (#14)

What and why

@⁠GTAVIB4GTAVI's finding: python -I scripts/run_semantic_tests.py tests (the parent folder instead of tests/semantic) puts the whole tests/ tree through unittest. It reports 42 failed files, and 36 of them are not real failures. 30 are files CI hands to pytest (PYTEST_FILE_MARKERS in ci.yml), which cannot import under python -I. 6 are script-style files with a __main__ block and no TestCase. The runner's usage lines name tests/semantic, so this is a trap rather than a supported path.

The runner now stops with a usage error (exit 2) when the directory is this repository's tests folder under any spelling (os.path.samefile). The message names the semantic subfolder and .github/workflows/ci.yml:

run_semantic_tests.py: error: tests is the repository's tests folder; the translator suite is its semantic subfolder (tests\semantic). The other files in tests/ run under pytest or as scripts in CI (.github/workflows/ci.yml), not through this runner

Every documented call (README, AGENTS.md, CONTRIBUTING.md, docs/linux.md) and the CI call (ci.yml:194) passes tests/semantic and is unchanged; any other folder, such as the throwaway suites the runner's own tests build, is unaffected. Separate from #1051, which changes how failures are reported.

Tested

Windows 11 Pro 26H2, CPython 3.13.15, on main 1154976d4:

  • python -I tests/test_run_semantic_tests.py: 23 tests OK, including the new test_the_repository_tests_folder_is_refused_before_running_anything (exit 2, -j 1 and -j 2, nothing run, and tests/semantic is not refused).
  • python -I scripts/run_semantic_tests.py tests -j 4: the usage error above, immediately.
  • python -I scripts/run_semantic_tests.py tests/semantic -p test_exec_computed.py: 1 file, 2 tests, 0 failed.
  • python -I tests/test_ci_registration.py: OK. python -m compileall -q and scripts/check_no_game_data.py on both files: clean.

GPUs tested: n/a

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo

**@⁠Anonymous78e** on GitHub · 2026-11-25 00:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1442) `Anonymous78e:scripts/semantic-runner-wrong-folder` → `main` · +26 −0 · 2 files · 1 commits · open Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why @⁠GTAVIB4GTAVI's [finding](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14): `python -I scripts/run_semantic_tests.py tests` (the parent folder instead of `tests/semantic`) puts the whole `tests/` tree through unittest. It reports 42 failed files, and 36 of them are not real failures. 30 are files CI hands to pytest (`PYTEST_FILE_MARKERS` in `ci.yml`), which cannot import under `python -I`. 6 are script-style files with a `__main__` block and no `TestCase`. The runner's usage lines name `tests/semantic`, so this is a trap rather than a supported path. The runner now stops with a usage error (exit 2) when the directory is this repository's `tests` folder under any spelling (`os.path.samefile`). The message names the semantic subfolder and `.github/workflows/ci.yml`: ``` run_semantic_tests.py: error: tests is the repository's tests folder; the translator suite is its semantic subfolder (tests\semantic). The other files in tests/ run under pytest or as scripts in CI (.github/workflows/ci.yml), not through this runner ``` Every documented call (README, AGENTS.md, CONTRIBUTING.md, docs/linux.md) and the CI call (`ci.yml:194`) passes `tests/semantic` and is unchanged; any other folder, such as the throwaway suites the runner's own tests build, is unaffected. Separate from #1051, which changes how failures are reported. ### Tested Windows 11 Pro 26H2, CPython 3.13.15, on `main` 1154976d4: - `python -I tests/test_run_semantic_tests.py`: 23 tests OK, including the new `test_the_repository_tests_folder_is_refused_before_running_anything` (exit 2, `-j 1` and `-j 2`, nothing run, and `tests/semantic` is not refused). - `python -I scripts/run_semantic_tests.py tests -j 4`: the usage error above, immediately. - `python -I scripts/run_semantic_tests.py tests/semantic -p test_exec_computed.py`: 1 file, 2 tests, 0 failed. - `python -I tests/test_ci_registration.py`: OK. `python -m compileall -q` and `scripts/check_no_game_data.py` on both files: clean. GPUs tested: n/a AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
Pointed at tests/ instead of tests/semantic, the runner put the whole tree
through unittest and reported 36 failed files that CI runs under pytest or as
scripts. It now stops with a usage error that names the semantic subfolder and
ci.yml. Every documented and CI call passes tests/semantic and is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:34 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:29 UTC · original

Reviewed a5459a61: the translator-suite runner now refuses the repository's tests folder (any spelling, isdir + samefile) with a usage error naming tests/semantic and CI's pytest/scripts split, before running anything. Ran python -I tests/test_run_semantic_tests.py on the PR tree (23 tests OK) and the same file over main's code (only the new test fails there: main runs the whole tests tree until the test's 15 s limit); probed both trees: the PR exits 2 with the refusal, main reports a CI-pytest file as "FAILED ... NO TESTS RAN". tests/semantic and throwaway suites behave identically on both. No findings; no game data touched.
AI-assisted review.
Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1442#issuecomment-7166915483) Reviewed a5459a61: the translator-suite runner now refuses the repository's tests folder (any spelling, isdir + samefile) with a usage error naming tests/semantic and CI's pytest/scripts split, before running anything. Ran `python -I tests/test_run_semantic_tests.py` on the PR tree (23 tests OK) and the same file over main's code (only the new test fails there: main runs the whole tests tree until the test's 15 s limit); probed both trees: the PR exits 2 with the refusal, main reports a CI-pytest file as "FAILED ... NO TESTS RAN". tests/semantic and throwaway suites behave identically on both. No findings; no game data touched. AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1442/head:github-bot/gh-1442'
git switch 'github-bot/gh-1442'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1442'
git switch 'github-bot/gh-1442'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1442'
git switch 'github-bot/gh-1442'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1442'
git switch 'main'
git merge --squash 'github-bot/gh-1442'
git switch 'main'
git merge --ff-only 'github-bot/gh-1442'
git switch 'main'
git merge 'github-bot/gh-1442'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.