Skip to content

Add mutation testing with Infection#553

Open
asgrim wants to merge 1 commit intophp:1.4.xfrom
asgrim:add-infection-mutation-testing
Open

Add mutation testing with Infection#553
asgrim wants to merge 1 commit intophp:1.4.xfrom
asgrim:add-infection-mutation-testing

Conversation

@asgrim
Copy link
Contributor

@asgrim asgrim commented Mar 18, 2026

PR submitter checklist

  • I have read CONTRIBUTING.md
  • I discussed this feature with the maintainers in my own head
  • I have added appropriate tests
  • I confirm that I have the right to submit this under the project's open source licence

@asgrim asgrim added this to the 1.4.0 milestone Mar 18, 2026
@asgrim asgrim self-assigned this Mar 18, 2026
@asgrim asgrim added the enhancement New feature or request label Mar 18, 2026
- uses: actions/checkout@v6
- uses: ramsey/composer-install@v3
- name: Run infection
run: sudo infection --min-msi=68 --min-covered-msi=68 --threads=4 --show-mutations=max --no-progress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • is sudo necessary here?!
  • any reason to use --threads=4 instead of --threads=max?

Copy link
Contributor Author

@asgrim asgrim Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • is sudo necessary here?!

yep, the tests require it (because I can't non-interactively sudo)

  • any reason to use --threads=4 instead of --threads=max?

nope :) will update

]
},
"mutators": {
"@default": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an app, maybe it's already disabled by default, there is the public -> protected/private mutator that can be disabled

@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/infection/infection/0.32.6/resources/schema.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what's the workflow to run it locally and not the CI when you're developing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the phar, as per the docs; I suppose that should be documented 😁

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.

2 participants