Skip to content

test: pin the env parsers; reframe mutation guidance as an occasional audit#53

Merged
rodrigobnogueira merged 1 commit into
mainfrom
test/env-parsing-survivors
Jul 6, 2026
Merged

test: pin the env parsers; reframe mutation guidance as an occasional audit#53
rodrigobnogueira merged 1 commit into
mainfrom
test/env-parsing-survivors

Conversation

@rodrigobnogueira

Copy link
Copy Markdown
Contributor

A scoped mutation audit of src/config/env.ts found its parsers under-asserted — there was no env spec at all, so the fallback / NaN-reject / sign-and-range-reject branches of readPort, readIntFromEnv, and readNonNegativeIntFromEnv survived.

Added a focused loadEnv spec covering each parser's cases — including the deliberate contrast between readIntFromEnv (rejects <= 0) and readNonNegativeIntFromEnv (0 is valid: "due immediately", which the reminder tests rely on) and readPort's range check. Verified by hand-applying the <= 0< 0 mutant — the readIntFromEnv test fails on it.

Kept targeted, per this app's pragmatic-coverage constitution (Rule 3: full-source mutation is a non-goal): the env parsers are genuine config-correctness logic worth pinning; the rest of src/ is deliberately not chased.

Also reframes the mutation-testing guidance (guidelines + CLAUDE.md) as an occasional, targeted audit — not a per-PR gate, and documents the fast hand-verification method (apply the mutant, run the suite, revert). Base suite green (84 tests, the live-Kafka e2e self-skips). No behavior change.

… audit

A scoped mutation audit of src/config/env.ts left its parsers under-asserted —
there was no env spec, so the fallback / NaN-reject / sign-and-range-reject
branches of readPort, readIntFromEnv, and readNonNegativeIntFromEnv all
survived. Added a focused loadEnv spec covering each parser's four cases,
including the deliberate difference between readIntFromEnv (rejects <= 0) and
readNonNegativeIntFromEnv (0 is valid — 'due immediately'). Verified by
hand-applying the <= 0 -> < 0 mutant (the readIntFromEnv test fails on it).

Per the app's pragmatic-coverage constitution this stays targeted — the env
parsers are genuine config-correctness logic; the rest of src/ is not chased.
Also reframes the mutation guidance (guidelines + CLAUDE.md) as an occasional,
scoped audit rather than a per-PR gate, and documents hand-verification.
@rodrigobnogueira rodrigobnogueira merged commit 31089ea into main Jul 6, 2026
1 check passed
@rodrigobnogueira rodrigobnogueira deleted the test/env-parsing-survivors branch July 6, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant