Skip to content

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

Merged
turegjorup merged 1 commit into
developfrom
test/infection-mutation-testing
Jun 11, 2026
Merged

test: add Infection mutation testing with enforced score and dashboard reporting#49
turegjorup merged 1 commit into
developfrom
test/infection-mutation-testing

Conversation

@turegjorup

Copy link
Copy Markdown
Collaborator

Summary

Mirrors the mutation-testing setup from itk-dev/openid-connect-bundle#44#51. Baseline: 198 mutants, 141 killed — Covered Code MSI 71% against 100% line coverage; the full run takes ~14 seconds. All 57 escaped mutants are in OpenIdConfigurationProvider (the library's one public class); follow-up PRs will kill them and ratchet the threshold.

Features Added

  • Infection as a dev dependency with infection.json5minCoveredMsi: 68 and threads: max live in the config as the single source of truth (no flags duplicated across Taskfile/CI)
  • task test:mutation, also appended to task pr:actions
  • CI job Mutation tests (8.3, prefer-stable) — single-entry matrix names the PHP version; runs --logger-github for inline PR annotations; GITHUB_* env vars passed into the container for Infection's CI detection
  • Stryker dashboard reporting for develop (uses the repo's 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 (normalized)
  • infection.json5 (new) - config incl. threshold and Stryker dashboard logger
  • Taskfile.yml - test:mutation, added to pr:actions
  • .github/workflows/php.yaml - mutation-tests job
  • README.md - badge + Mutation Testing section
  • CHANGELOG.md - Unreleased bullet
  • .gitignore - generated infection.log/infection.html

Test Plan

  • task test:mutation — passes locally (71% ≥ 68%), dashboard upload correctly skipped outside CI
  • task lint:yaml / task lint:markdown — pass
  • The new CI job should run on this PR; badge populates on first push to develop after merge

🤖 Generated with Claude Code

…d reporting

Baseline run: 198 mutants, 141 killed, Covered Code MSI 71% against
100% line coverage; full run completes in ~14 seconds. The minimum
score (minCoveredMsi: 68) lives in infection.json5 only, shared by
task test:mutation, pr:actions and the CI job. CI annotates escaped
mutants inline on PRs via --logger-github and publishes develop
results to the Stryker dashboard, feeding the README badge.

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

codecov Bot 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 (f241f67) to head (feb3bc2).

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #49   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        71        71           
===========================================
  Files              1         1           
  Lines            185       185           
===========================================
  Hits             185       185           
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.

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