Repository navigation
Conversation
A CI step that pipes strain's output, such as `strain run … | tee log`, passes whatever strain returns unless the step says `shell: bash`, because GitHub Actions only adds -o pipefail then. The README gains a CI section: - what the exit status means; - why `shell: bash` matters; - a GitHub Actions job that tests a pull request's changes with --since, appends summary.md to the job summary and uploads the report, both even when strain fails. tests/test_ci.py checks the documented job keeps those properties. With --since, a run without mutants passes, but its summary used to say only "No mutants were generated", which reads like a clean run. Now summary.md and index.html start with "Nothing was mutation tested" and say why: no source line changed since the ref, or none of the changed lines is executed and has something to mutate. The console summary says the same. The Reports section also lists index.html and summary.md. Fixes #45. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #45.
CI section in the README
What the exit status means:
--since;--threshold;--sinceand nothing to mutate.Why
shell: bashmatters: without ashell:key, GitHub Actions runsbash -ewith nopipefail, sostrain run … | tee strain.logpasses whatever strain found. Withshell: bash, GitHub adds-o pipefail.A GitHub Actions job that:
strain run --ui log --since origin/<base> --threshold 80 | tee strain.logwithshell: bash;strain-report/summary.mdto$GITHUB_STEP_SUMMARY;strain-report/and the log. The last two steps run withif: always(), so the report survives a failing run.Tests in
tests/test_ci.pythat read that job from the README and check:shell: bash;--sincecomes withfetch-depth: 0.I also parsed the job with PyYAML to check its structure.
The Reports section now lists
index.htmlandsummary.md."Nothing was mutation tested", with the reason
Without
--since, a run with no mutants already fails (require_mutants). With--since, it passes, which is right: a change that touches no line the tests run has nothing to test. But the summary said only "No mutants were generated.", which can read like success. Nowsummary.md,index.htmland the console summary say Nothing was mutation tested, followed by one of these reasons:What I left out
cpp-best-practices/mutant_strain/action@…). It would need a release and tag scheme for the action, and strain isn't published to PyPI yet. The documented job is the same few steps, and the test keeps it correct.--sinceand nothing to mutate stays 0. Making it non-zero would fail every pull request that changes only docs or untested code, even with--threshold. The issue's acceptance asks for the summary to say so explicitly, which it now does.Tests
--since HEADwith no changes exits 0. Itssummary.mdis exactly the heading plus "Nothing was mutation tested. No source line changed since HEAD, so there was nothing to mutate."--since HEAD~1after a commit that only adds a comment says no mutant was generated on the 1 changed line.python -W error -m pytest: 259 passed, 9 skipped.ruff format --check,ruff checkand lizard are clean.🤖 Generated with Claude Code