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

Open
opened 2026-11-26 20:21:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1442
Author: @Anonymous78e
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: scripts/semantic-runner-wrong-folder


📝 Commits (1)

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

📊 Changes

2 files changed (+26 additions, -0 deletions)

View changed files

📝 scripts/run_semantic_tests.py (+15 -0)
📝 tests/test_run_semantic_tests.py (+11 -0)

📄 Description

Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148344085)

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1442 **Author:** [@Anonymous78e](https://github.com/Anonymous78e) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `scripts/semantic-runner-wrong-folder` --- ### 📝 Commits (1) - [`a5459a6`](https://github.com/ubiquitarianism/leonida/commit/a5459a6136d6cdeb31eb1109c9f5a6aee68c7e30) run_semantic_tests: refuse the repository's tests folder, name tests/semantic (SEMANTIC-RUNNER-WRONG-FOLDER) ### 📊 Changes **2 files changed** (+26 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `scripts/run_semantic_tests.py` (+15 -0) 📝 `tests/test_run_semantic_tests.py` (+11 -0) </details> ### 📄 Description Claimed in the coordination issue as: SEMANTIC-RUNNER-WRONG-FOLDER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148344085) ### What and why @GTAVIB4GTAVI's [finding](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147793888): `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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1472
No description provided.