Repository navigation
test(manage-parseus): kill mutation survivors in env-file and manifest helpers - #15
Merged
Ethane98 merged 2 commits intoNov 19, 2026
Conversation
…t helpers Adds tests/test_manage_parseus_lib_survivors.py covering behaviour of the installer config loader, env-file helpers and manifest state helpers: config path that is missing or a directory, blank config values, unreadable certificate files, filling/preserving keys in managed env files, generating the full set of env files (with and without gpib), health-threshold validation boundaries (zero, one, equal warn/critical), compose.env create/merge/no-op, public URL validation, PermissionError messaging, image tag parsing, manifest save/archive (no-op, history copy, name collision suffix, sorted JSON with trailing newline) and obsolete/purged image removal. Also covers a few neighbouring helpers (parse_env_file quoting, fingerprint, manifest diffing, utc_now_iso). All tests use tmp_path and monkeypatch; no chown, Docker or network. Mutation score (killed/total) before -> after: loader.py 30/68 -> 37/68, env_files.py 32/59 -> 55/59, manifest.py 11/29 -> 28/29. Every survivor named in the task is now killed. Remaining loader.py survivors are in untouched port/health/certificate validation helpers outside this scope. Equivalent or low-value survivors left: env_files.py:95 (or -> and in parse_env_file's skip condition: a line lacking "=" is still skipped by the later split, or yields the same dict), env_files.py:100/102 (len(v) >= 2 and 1 -> 0 guards: only differ for a single-character quoted value, where the stripped result is the same), manifest.py:159 (isinstance tuple check in normalize_for_fingerprint: the str() fallback hashes identically). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ethane98
requested changes
Nov 18, 2026
Ethane98
left a comment
Collaborator
There was a problem hiding this comment.
test(manage-parseus): tighten survivor tests per PR #15 review
Strengthen three tests that still let mutants survive:
- ensure_compose_env_file: seed an extra key ("C") so the merge
must keep existing entries rather than replace the file, and
assert that a call with no changes does not rewrite compose.env. - parse_env_file: make the comment line contain "=" so it only
passes if comments are skipped before key=value parsing. - stable_config_fingerprint: assert that int and str values
({"a": 1} vs {"a": "1"}) produce different fingerprints.
Co-Authored-By: Claude noreply@anthropic.com
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Took all three. The compose.env test now seeds C and fails if a no-op call rewrites the file, the comment line has an = in it, and the fingerprint test checks 1 vs "1". I broke the code each way to confirm the tests catch it now and didn't before. The manage-parseus tests all pass (165). |
|
Horrifying, you're killing survivors? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
tests/test_manage_parseus_lib_survivors.py(53 tests, test-only change) covering the installer config loader, env-file helpers and manifest state helpers that mutation testing showed were under-tested: missing/directory config paths, blank config values, unreadable certificates, managed env-file fill/preserve, compose.env create/merge/no-op, health-threshold boundaries, image tag parsing, and manifest save/archive (no-op, history copy, name-collision suffix, sorted JSON with trailing newline). All tests usetmp_path/monkeypatch; no chown, Docker or network.Mutation score (killed/total) before -> after:
config/loader.pyinstall/env_files.pystate/manifest.pyRemaining
loader.pysurvivors are in the port/HTTPS/certificate validation helpers, left for a follow-up. The four left inenv_files.py/manifest.pyare equivalent or near-equivalent mutants (listed in the commit message).Related Issues/PRs
apply_compose_nginx_network_defaults,parse_env_file,validate_installer_config_values); independent of it, no shared files.Type of Change
fix)feat)docs)refactor)chore)test)Checklist
Testing
main(513 passed there).🤖 Generated with Claude Code