[PR #987] semantic_mutants: reject zero-test baselines (MUTANTS-ZERO-TEST-BASELINE) #1023

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/987
Author: @TheGeogeo
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/semantic-mutants-zero-test-baseline


📝 Commits (1)

  • e8fa6b1 semantic_mutants: reject zero-test baselines

📊 Changes

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

View changed files

📝 tests/test_semantic_mutants.py (+23 -10)
📝 tools/semantic_mutants.py (+3 -1)

📄 Description

Claimed in the coordination issue as: MUTANTS-ZERO-TEST-BASELINE — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137474008

What and why

When setUpClass skips the only test class before any test starts, unittest reports Ran 0 tests and exits successfully. semantic_mutants.py then runs the mutations against that empty baseline and reports them all as survivors. Recognize the zero-test summary as a baseline error and stop before running mutants. A synthetic CLI regression checks the exit code, diagnostic and absence of mutant results.

Tested

After a rebase on main 6293c1c4 (e8fa6b12, same patch as f2346123), on Windows 11, Python 3.12.4: tests/test_semantic_mutants.py 21 OK; test_tool_stdout_encoding.py, test_docs_cli_flags.py and test_text_write_line_endings.py OK; git diff --check and the no-game-data check clean.

  • Windows, Python 3.12.4. On main at cf4c00cb, the synthetic regression returned 1 and reported three survivors. It now returns 2 with no tests ran.
  • python -I -B tests/test_semantic_mutants.py: 21 passed.
  • python -I -B tests/test_run_semantic_tests.py: 19 passed. The nested failing fixture is intentional.
  • Combined with #863 at 1f76d4a7 in a temporary worktree: clean application, 22 mutation-tool tests and 20 semantic-runner tests passed.
  • git diff --check and python -I -B scripts/check_no_game_data.py tools/semantic_mutants.py tests/test_semantic_mutants.py: passed.

GPUs tested: n/a (CPU-only test tooling)

AI-assisted: yes (Codex).

Checklist

  • Based on current main when branched; two-file diff checked against main before publication.
  • One topic.
  • No game data, keys or decryption.

🔄 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/987 **Author:** [@TheGeogeo](https://github.com/TheGeogeo) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/semantic-mutants-zero-test-baseline` --- ### 📝 Commits (1) - [`e8fa6b1`](https://github.com/ubiquitarianism/leonida/commit/e8fa6b1258ec10fdcf0d44514f5b4511abc55087) semantic_mutants: reject zero-test baselines ### 📊 Changes **2 files changed** (+26 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_semantic_mutants.py` (+23 -10) 📝 `tools/semantic_mutants.py` (+3 -1) </details> ### 📄 Description Claimed in the coordination issue as: MUTANTS-ZERO-TEST-BASELINE — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137474008 ### What and why When `setUpClass` skips the only test class before any test starts, `unittest` reports `Ran 0 tests` and exits successfully. `semantic_mutants.py` then runs the mutations against that empty baseline and reports them all as survivors. Recognize the zero-test summary as a baseline error and stop before running mutants. A synthetic CLI regression checks the exit code, diagnostic and absence of mutant results. ### Tested After a rebase on `main` `6293c1c4` (`e8fa6b12`, same patch as `f2346123`), on Windows 11, Python 3.12.4: `tests/test_semantic_mutants.py` 21 OK; `test_tool_stdout_encoding.py`, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` OK; `git diff --check` and the no-game-data check clean. - Windows, Python 3.12.4. On `main` at `cf4c00cb`, the synthetic regression returned 1 and reported three survivors. It now returns 2 with `no tests ran`. - `python -I -B tests/test_semantic_mutants.py`: 21 passed. - `python -I -B tests/test_run_semantic_tests.py`: 19 passed. The nested failing fixture is intentional. - Combined with #863 at `1f76d4a7` in a temporary worktree: clean application, 22 mutation-tool tests and 20 semantic-runner tests passed. - `git diff --check` and `python -I -B scripts/check_no_game_data.py tools/semantic_mutants.py tests/test_semantic_mutants.py`: passed. GPUs tested: n/a (CPU-only test tooling) AI-assisted: yes (Codex). ### Checklist - [x] Based on current `main` when branched; two-file diff checked against `main` before publication. - [x] One topic. - [x] No game data, keys or decryption. --- <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#1023
No description provided.