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

Closed
leonida/mandy
KoLolX3 wants to merge 0 commits from fix/semantic-positive-jobs into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

KoLolX3 commented 2026-11-25 08:44:31 +00:00

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.)
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 reviewed 2026-11-25 10:29:24 +00:00
lixonik left a comment
No description provided.
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

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

**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

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

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

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.

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.
Sign in to join this conversation.
No description provided.