Skip to content

Count uncovered code in mutation testing - #1

Merged
rasuvaeff merged 1 commit into
masterfrom
test/mutation-with-uncovered
Nov 3, 2026
Merged

rasuvaeff merged 1 commit into
masterfrom
test/mutation-with-uncovered

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

What

composer mutation now runs infection --threads=max --with-uncovered (with Composer\Config::disableProcessTimeout). Testo credits a test only with the code its #[Covers] names, so code tests execute without naming it had no mutants and the gate hid them.

infection.json5 gets the template mutator settings: PublicVisibility and ProtectedVisibility off and global-ignoreSourceCodeByRegex for type $name = default, signature lines. minMsi stays 95.

Numbers (overall MSI, zend.assertions off as in CI, pcntl image)

Mutants Not Covered Escaped Timed Out MSI
--with-uncovered, template settings, before 50 4 1 0 90%
after 48 0 0 2 100%

Tests

  • A previous handler that is not callable from SignalScope (a private method registered by name) is treated as the default disposition.
  • A second signal with the default disposition is re-raised: an in-process run on SIGWINCH (so the line is executed in the test process, which is how Infection maps mutants to tests) plus a forked child that must die of the re-raised SIGUSR1.

src change (behaviour-neutral)

listen()/run() signatures are split one parameter per line, and the default [SIGTERM, SIGINT] moved to a private constant DEFAULT_SIGNALS; theDefaultSetIsTermAndInt pins the value. The default sat on a signature line with no opcode, so its mutants were Not Covered.

composer mutation exits 0 twice in a row; build and rector are green (run in an image with ext-pcntl).

@rasuvaeff rasuvaeff added the enhancement New feature or request label Nov 3, 2026
@rasuvaeff rasuvaeff self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4791303-2bef-44dd-9397-dd0e703e8034
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@rasuvaeff
rasuvaeff merged commit 94eba2d into master Nov 3, 2026
11 checks passed
@rasuvaeff
rasuvaeff deleted the test/mutation-with-uncovered branch November 3, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant