From efaf2a76e71d0b45dd73762112dea2fa2b01bee4 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 20 Nov 2026 19:24:48 +0400 Subject: [PATCH 1/3] chore: install Infection with the Testo adapter The adapter hands testFrameworkOptions to Testo as a single argument, so several --suite flags cannot be listed there; DB_DRIVERS=sqlite in the scripts registers only the SQLite suites next to Unit, which CI runs without database servers. Assisted-By: Claude Opus 5.5 --- composer.json | 16 ++++++++++++++++ infection.json | 18 ++++++++++++++++++ vendor-bin/infection/.gitignore | 4 ++++ vendor-bin/infection/composer.json | 11 +++++++++++ 4 files changed, 49 insertions(+) create mode 100644 infection.json create mode 100644 vendor-bin/infection/.gitignore create mode 100644 vendor-bin/infection/composer.json diff --git a/composer.json b/composer.json index ce693ca..67921c9 100644 --- a/composer.json +++ b/composer.json @@ -94,6 +94,18 @@ "db:up": "docker compose -f resources/docker/compose.yaml up -d --wait", "cs:diff": "php-cs-fixer fix --dry-run -v --diff --config=vendor-bin/code-style/.php-cs-fixer.dist.php", "cs:fix": "php-cs-fixer fix -v --config=vendor-bin/code-style/.php-cs-fixer.dist.php", + "infect": [ + "Composer\\Config::disableProcessTimeout", + "@putenv XDEBUG_MODE=coverage", + "@putenv DB_DRIVERS=sqlite", + "infection --configuration=infection.json --threads=max" + ], + "infect:ci": [ + "Composer\\Config::disableProcessTimeout", + "@putenv XDEBUG_MODE=coverage", + "@putenv DB_DRIVERS=sqlite", + "infection --ansi --configuration=infection.json --logger-github --threads=max --show-mutations=0" + ], "psalm": "psalm -c vendor-bin/psalm/psalm.xml", "psalm:baseline": "psalm -c vendor-bin/psalm/psalm.xml --set-baseline=vendor-bin/psalm/psalm-baseline.xml", "psalm:ci": "psalm -c vendor-bin/psalm/psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4", @@ -107,5 +119,9 @@ "test:sqlite": "testo --suite=Feature/SQLite --suite=Acceptance/SQLite --suite=Regression/SQLite", "test:sqlserver": "testo --suite=Feature/SQLServer --suite=Acceptance/SQLServer --suite=Regression/SQLServer", "test:unit": "testo --suite=Unit" + }, + "scripts-descriptions": { + "infect": "Run mutation testing with Infection against the Unit and SQLite suites", + "infect:ci": "Run mutation testing in CI: GitHub annotations, the Stryker dashboard report and the MSI gate" } } diff --git a/infection.json b/infection.json new file mode 100644 index 0000000..c0c2a5a --- /dev/null +++ b/infection.json @@ -0,0 +1,18 @@ +{ + "$schema": "vendor-bin/infection/vendor/infection/infection/resources/schema.json", + "source": { + "directories": [ + "src" + ] + }, + "timeout": 10, + "minMsi": 54, + "minCoveredMsi": 54, + "testFramework": "testo", + "tmpDir": "runtime", + "logs": { + "stryker": { + "report": "1.x" + } + } +} diff --git a/vendor-bin/infection/.gitignore b/vendor-bin/infection/.gitignore new file mode 100644 index 0000000..d4da745 --- /dev/null +++ b/vendor-bin/infection/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/vendor-bin/infection/composer.json b/vendor-bin/infection/composer.json new file mode 100644 index 0000000..8436e13 --- /dev/null +++ b/vendor-bin/infection/composer.json @@ -0,0 +1,11 @@ +{ + "require": { + "infection/infection": "^0.35", + "testo/bridge-infection": "^0.1.9" + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } + } +} From b07a3a40a9007e2c1ccc0c15b2812a36fb1efa4d Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 20 Nov 2026 19:24:49 +0400 Subject: [PATCH 2/3] ci: run mutation testing through the shared cycle/gh-actions workflow Assisted-By: Claude Opus 5.5 --- .github/workflows/infection.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/infection.yml diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml new file mode 100644 index 0000000..e9d5af7 --- /dev/null +++ b/.github/workflows/infection.yml @@ -0,0 +1,24 @@ +--- + +on: # yamllint disable-line rule:truthy + pull_request: + push: + branches: + - 1.x + +name: 🧬 Mutation Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + +jobs: + infection: + name: Infection + uses: cycle/gh-actions/.github/workflows/infection.yml@master + secrets: inherit + +... From 6e39ffaead675de3a6dba6373abeb74ba02f5340 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 20 Nov 2026 19:24:50 +0400 Subject: [PATCH 3/3] docs: add the mutation testing badge Assisted-By: Claude Opus 5.5 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b930100..4685751 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ [![Psalm Level](https://shepherd.dev/github/cycle/testing/level.svg)](https://shepherd.dev/github/cycle/testing) [![Type Coverage](https://shepherd.dev/github/cycle/testing/coverage.svg)](https://shepherd.dev/github/cycle/testing) [![Codecov](https://img.shields.io/codecov/c/github/cycle/testing/1.x?style=flat-square&logo=codecov)](https://app.codecov.io/gh/cycle/testing/tree/1.x) +[![Mutation testing badge](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fcycle%2Ftesting%2F1.x)](https://dashboard.stryker-mutator.io/reports/github.com/cycle/testing/1.x)