Skip to content

test: add Infection mutation testing with enforced score and dashboard reporting#44

Merged
turegjorup merged 3 commits into
developfrom
test/infection-mutation-testing
Jun 11, 2026
Merged

test: add Infection mutation testing with enforced score and dashboard reporting#44
turegjorup merged 3 commits into
developfrom
test/infection-mutation-testing

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Adds Infection mutation testing to evaluate test suite sensitivity. Baseline run: 115 mutants, Covered Code MSI 80–84% against 100% line coverage, full run completes in ~14 seconds.

Features Added

  • Infection as a dev dependency with infection.json5 config — minCoveredMsi: 78 and threads: max live in the config file as the single source of truth, so no command line flags are duplicated across Taskfile/CI
  • task test:mutation task, also appended to task pr:actions
  • CI job mutation-tests running with --logger-github (inline PR annotations for escaped mutants); GITHUB_* env vars are passed into the container so Infection's CI detection works
  • Stryker dashboard reporting for develop (uses the STRYKER_DASHBOARD_API_KEY secret), feeding a new mutation score badge in the README
  • README "Mutation Testing" section in the development docs

Files Changed

  • composer.json - infection/infection dev dependency + allow-plugins entry
  • infection.json5 (new) - Infection config incl. threshold and Stryker dashboard logger
  • Taskfile.yml - test:mutation task, added to pr:actions
  • .github/workflows/php.yaml - mutation-tests job
  • README.md - badge + Mutation Testing section
  • CHANGELOG.md - Unreleased/Added bullet
  • .gitignore - generated infection.log/infection.html

Test Plan

  • task test:mutation — passes locally (Covered MSI 84% ≥ 78%), dashboard upload correctly skipped outside CI
  • task lint:markdown / task lint:yaml — pass
  • CI on this PR should run the new mutation-tests job; dashboard upload and badge activate on first push to develop after merge

Notes

  • The mutation score fluctuates a few points between runs (93–97 of 115 killed), so the threshold has headroom; follow-up PRs will kill the surviving mutants and ratchet minCoveredMsi above 90
  • Badge shows "unknown" until the first develop run seeds the dashboard

🤖 Generated with Claude Code

turegjorup and others added 2 commits June 11, 2026 08:07
Baseline run: 115 mutants, 93 killed, Covered Code MSI 80% against
100% line coverage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The minimum mutation score (minCoveredMsi: 78) lives in infection.json5
only, so the Taskfile, CI and local runs all share one threshold without
repeating command line flags. CI annotates escaped mutants inline on PRs
via --logger-github and publishes develop results to the Stryker
dashboard, which feeds the new README mutation score badge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c826902) to head (e7148d4).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #44   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        62        62           
===========================================
  Files              9         9           
  Lines            282       282           
===========================================
  Hits             282       282           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@turegjorup turegjorup merged commit 25afc4c into develop Jun 11, 2026
16 checks passed
@turegjorup turegjorup deleted the test/infection-mutation-testing branch June 11, 2026 08:15
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.

2 participants