Skip to content

Mutation testing: environment parsing and category default survivors #38

Description

@leynos

Context

Mutation-testing run against main (b850e2fec11b1966d2b73670ae56b5eff195284e), mutmut 3.6.0, local run 2026-07-10: 1025 mutants, 151 killed, 235 survived, 639 no-tests.

This issue covers environment parsing and category defaults in hooks/post-turn-quality-stop-hook.py: 23 real-gap survivors across parse_env, parse_max_output, and default_categories (a further two parse_env mutants are equivalent and recorded in the worklist).

Surviving mutants

  • hooks/post-turn-quality-stop-hook.py:881os.environ.get("POST_TURN_BASE_REF", "origin/main"): variable-name mutations (XX…XX, lower-case), default-value mutations (None, removed, "XXorigin/mainXX", "ORIGIN/MAIN"), and base_ref = None (x_parse_env__mutmut_1, 39).
  • hooks/post-turn-quality-stop-hook.py:882POST_TURN_ALWAYS_FETCH variable-name mutations and always_fetch = None (x_parse_env__mutmut_10, 16, 17).
  • hooks/post-turn-quality-stop-hook.py:883POST_TURN_MAX_OUTPUT_CHARS variable-name and default mutations ("XX12000XX") and max_out = None (x_parse_env__mutmut_19, 2527).
  • hooks/post-turn-quality-stop-hook.py:852parse_max_output signature default 1200012001 (x_parse_max_output__mutmut_1).
  • hooks/post-turn-quality-stop-hook.py:69default_categories() key and value mutations: each of "python_ts", "rust", "markdown" wrapped as XX…XX or upper-cased, and each FalseTrue (x_default_categories__mutmut_19).

Analysis

TestParseEnvCompush asserts only the compush element of the four-tuple, so the base-ref, always-fetch, and max-output elements mutate freely, including the environment-variable names themselves (case-sensitive on Linux, so the lower-case mutants are observable). parse_max_output is exercised only with a valid "12000", leaving the fallback default unasserted. default_categories() has no direct test; its survivors also feed detect_categories, which sits in the no-tests bucket.

Suggested tests

  1. Parametrized parse_env tests that set and unset each of POST_TURN_BASE_REF, POST_TURN_ALWAYS_FETCH, and POST_TURN_MAX_OUTPUT_CHARS, asserting all four returned values exactly (defaults ("origin/main", False, 12000, False); overridden values respected).
  2. parse_max_output("not-a-number") returns exactly 12000 (kills the 12001 signature mutant).
  3. default_categories() == {"python_ts": False, "rust": False, "markdown": False} asserted by equality (kills all nine key/value mutants).

Full worklist: triage worklist.md; dataset SHA b850e2f.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions