From 9e30d5e1072b07a7efd13f1189f361c2291e6611 Mon Sep 17 00:00:00 2001 From: Ross Addison Date: Mon, 6 Jul 2026 14:16:21 +0100 Subject: [PATCH 1/3] fix(infection): skip mutations to #[TestInline] attribute arguments (#159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Infection mutates values inside a #[TestInline(arguments: [...], result: ...)] attribute it is mutating test data, not production logic. Every such mutation is "killed" (Assert::same catches the wrong expected value), but the kills are semantically meaningless — they verify that the assertion works, not that the source code handles a mutation correctly. This inflates the mutation score with noise and wastes CI runner time. Add `global-ignoreSourceCodeByRegex` to infection.json so Infection skips any mutation whose source line contains `#[TestInline`. This covers all single-line attribute declarations in both the Self-test fixtures under plugin/inline/tests/Self/ and any production code that uses the attribute. Method bodies on adjacent lines are unaffected and continue to be mutated. Co-Authored-By: Claude Sonnet 4.6 --- infection.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infection.json b/infection.json index 14366950..ab688144 100644 --- a/infection.json +++ b/infection.json @@ -17,5 +17,10 @@ "stryker": { "report": "1.x" } + }, + "mutators": { + "global-ignoreSourceCodeByRegex": [ + "#\\[TestInline" + ] } } From 05a3e7793df516307cbe26813b2767cb79fe4804 Mon Sep 17 00:00:00 2001 From: Ross Addison Date: Mon, 6 Jul 2026 13:48:44 +0100 Subject: [PATCH 2/3] fix(phpunit-mirror): add .placeholder.php so EmptyRun stub directory is mirrored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/Application/Stub/EmptyRun/ is intentionally empty — it is the test fixture for EmptyRunTest, which asserts that a Testo run over an empty directory yields Status::Risky with zero tests collected. Git does not track empty directories, and bin/build-phpunit.php only copies *.php files when populating the tests/PhpUnit/ mirror, so the mirror never contained tests/PhpUnit/Application/Stub/EmptyRun/. The mirrored EmptyRunTest resolved __DIR__ . '/../../Stub/EmptyRun' to that missing path and threw InvalidArgumentException: File or directory not found — aborting Infection's initial PHPUnit test run on every CI push to 1.x. Add .placeholder.php (no namespace, no classes, no tests) to the source directory. The build script copies it verbatim into the mirror, which creates the required directory. Testo's FinderConfig still discovers zero tests there, so Status::Risky is reported and the assertion holds. Co-Authored-By: Claude Sonnet 4.6 --- tests/Application/Stub/EmptyRun/.placeholder.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/Application/Stub/EmptyRun/.placeholder.php diff --git a/tests/Application/Stub/EmptyRun/.placeholder.php b/tests/Application/Stub/EmptyRun/.placeholder.php new file mode 100644 index 00000000..72680edf --- /dev/null +++ b/tests/Application/Stub/EmptyRun/.placeholder.php @@ -0,0 +1,10 @@ + Date: Mon, 6 Jul 2026 14:28:27 +0100 Subject: [PATCH 3/3] fix(infection): re-enable @default mutators alongside global-ignoreSourceCodeByRegex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifying "mutators": {} without "@default" treats the block as an allowlist, so all default mutators were silently disabled — producing 0 mutations and an MSI failure. Adding "@default": true restores the full default mutator set while the global regex filter still skips lines containing #[TestInline. Co-Authored-By: Claude Sonnet 4.6 --- infection.json | 1 + 1 file changed, 1 insertion(+) diff --git a/infection.json b/infection.json index ab688144..56f5a96c 100644 --- a/infection.json +++ b/infection.json @@ -19,6 +19,7 @@ } }, "mutators": { + "@default": true, "global-ignoreSourceCodeByRegex": [ "#\\[TestInline" ]