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

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

@⁠KoLolX3 on GitHub · 2026-11-25 08:44 UTC · original
KoLolX3:fix/semantic-positive-jobs → main · +24 −3 · 2 files · 1 commits · open

Claimed in the coordination issue as: SEMANTIC-JOBS-POSITIVE (#1608)

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.)
**@⁠KoLolX3** on GitHub · 2026-11-25 08:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1700) `KoLolX3:fix/semantic-positive-jobs` → `main` · +24 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: SEMANTIC-JOBS-POSITIVE (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### 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.)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:01:22 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 10:29 UTC · original · reviewed

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.

**@⁠lixonik** on GitHub · 2026-11-25 10:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1700#pullrequestreview-6055864523) · **reviewed** 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.
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 14:20 UTC · original

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

**@⁠Tyrannys** on GitHub · 2026-11-25 14:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1700#issuecomment-7165131636) **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).
This pull request has changes conflicting with the target branch.
  • scripts/run_semantic_tests.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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