run_semantic_tests: reject nonpositive job counts (SEMANTIC-JOBS-POSITIVE) #1700

Closed
KoLolX3 wants to merge 1 commit from upstream-pr/1700 into main
KoLolX3 commented 2026-11-25 08:44:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KoLolX3 on 2026-11-25T08:44:31Z.


Claimed in the coordination issue as: SEMANTIC-JOBS-POSITIVE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157357875)

What and why

run_semantic_tests.py -j 0 and negative values silently ran the suite serially. Reject nonpositive or noninteger worker counts as usage errors, before loading any tests; keep -j 1 for serial discovery and document the constraint. A synthetic CLI regression checks that invalid values do not import the test file.

Tested

  • python -I tests/test_run_semantic_tests.py (23 tests)
  • python -I scripts/run_semantic_tests.py tests/semantic (487 files, 6,279 tests, zero files failed)
  • python -I tests/test_text_write_line_endings.py (3 tests)
  • python -m compileall -q make_game.py tools tests, both CLI help commands, python -I scripts/check_no_game_data.py scripts/run_semantic_tests.py tests/test_run_semantic_tests.py, and git diff --check
  • Linux; synthetic tests only.

GPUs tested: n/a

AI-assisted: yes (OpenAI Codex)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5488020031 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1700). Originally posted by [KoLolX3](https://github.com/KoLolX3) on 2026-11-25T08:44:31Z. --- Claimed in the coordination issue as: SEMANTIC-JOBS-POSITIVE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157357875) ### What and why `run_semantic_tests.py -j 0` and negative values silently ran the suite serially. Reject nonpositive or noninteger worker counts as usage errors, before loading any tests; keep `-j 1` for serial discovery and document the constraint. A synthetic CLI regression checks that invalid values do not import the test file. ### Tested - `python -I tests/test_run_semantic_tests.py` (23 tests) - `python -I scripts/run_semantic_tests.py tests/semantic` (487 files, 6,279 tests, zero files failed) - `python -I tests/test_text_write_line_endings.py` (3 tests) - `python -m compileall -q make_game.py tools tests`, both CLI help commands, `python -I scripts/check_no_game_data.py scripts/run_semantic_tests.py tests/test_run_semantic_tests.py`, and `git diff --check` - Linux; synthetic tests only. GPUs tested: n/a AI-assisted: yes (OpenAI Codex) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable.)
lixonik commented 2026-11-25 10:29:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T10:29:24Z.

Review: COMMENTED


Independent native Windows verification at 7aae8e37 against 237deb64. In a CLI check with a synthetic import marker, the base accepted -j0 and --jobs=-2 and imported the fixture. The PR rejected both, as well as --jobs 0.5 and -j bad, with exit 2 before importing anything. The same fixture ran successfully with -j1, --jobs=2, and the default. All 23 runner tests passed on the PR head.

AI-assisted testing. CPU only, synthetic fixture.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6055864523 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1700#pullrequestreview-6055864523). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-25T10:29:24Z. **Review:** COMMENTED --- Independent native Windows verification at `7aae8e37` against `237deb64`. In a CLI check with a synthetic import marker, the base accepted `-j0` and `--jobs=-2` and imported the fixture. The PR rejected both, as well as `--jobs 0.5` and `-j bad`, with exit 2 before importing anything. The same fixture ran successfully with `-j1`, `--jobs=2`, and the default. All 23 runner tests passed on the PR head. AI-assisted testing. CPU only, synthetic fixture.
Tyrannys commented 2026-11-25 14:20:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-25T14:20:40Z.


Independent verification of head 7aae8e370 (Windows 11 Pro 26300, Python 3.14.4).

  • python -I tests/test_run_semantic_tests.py: 23/23 OK at this head.
  • The same test file run against main's scripts/run_semantic_tests.py (main hasn't changed it since this PR's base): test_jobs_must_be_positive_before_running_tests fails for all three values (0, -1, nope); the other 22 pass. So the new test shows the bug this fixes.
  • Diff read: positive_jobs rejects in argparse before any test module runs, and the serial branch is now a.jobs == 1, which is the only value that can reach it. No problem found.

No game files. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165131636 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1700#issuecomment-7165131636). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-25T14:20:40Z. --- **Independent verification** of head `7aae8e370` (Windows 11 Pro 26300, Python 3.14.4). - `python -I tests/test_run_semantic_tests.py`: **23/23 OK** at this head. - The same test file run against `main`'s `scripts/run_semantic_tests.py` (`main` hasn't changed it since this PR's base): **`test_jobs_must_be_positive_before_running_tests` fails for all three values** (`0`, `-1`, `nope`); the other 22 pass. So the new test shows the bug this fixes. - Diff read: `positive_jobs` rejects in argparse before any test module runs, and the serial branch is now `a.jobs == 1`, which is the only value that can reach it. No problem found. No game files. AI-assisted (Claude Code).
MoonEyes commented 2026-11-28 02:53:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T02:53:12Z.


Hi @KoLolX3, thanks for this pull request. It currently conflicts with main (conflicting file(s): scripts/run_semantic_tests.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232656656 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1700#issuecomment-7232656656). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T02:53:12Z. --- Hi @KoLolX3, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `scripts/run_semantic_tests.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
DadaCap commented 2026-11-28 10:32:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:32:55Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: low value and conflicting.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237967455 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1700#issuecomment-7237967455). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:32:55Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: low value and conflicting. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1700
No description provided.