Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ permissions:
contents: read
jobs:
mutation:
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
uses: yiisoft/actions/.github/workflows/infection.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.5']
infection-args: --ignore-msi-with-no-mutations
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ phpunit: ## [test] Run PHPUnit tests: `make phpunit ARGS="--filter=TestName"`

mutation: infection
infection: ## [infection] Run mutation testing with Infection.
$(RUN) ./vendor/bin/roave-infection-static-analysis-plugin --threads=max --ignore-msi-with-no-mutations --only-covered
$(RUN) ./vendor/bin/infection --threads=max --ignore-msi-with-no-mutations --only-covered

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Static checks no longer gate mutants

When a generated mutant violates a static-analysis check but still runs through the mutation tests, the standard Infection command runs without a static-analysis tool configured, so mutants that violate Psalm checks are no longer rejected during mutation testing and the results lose the previous static-analysis validation.

Configure Infection’s static-analysis integration with the project’s chosen analyzer in infection.json.dist or pass the corresponding option in both local and CI commands.

Also at .github/workflows/mutation.yml:33, composer.json:48.

Prompt for AI agents
In `Makefile` at line 34:

**Static checks no longer gate mutants**

When a generated mutant violates a static-analysis check but still runs through the mutation tests, the standard Infection command runs without a static-analysis tool configured, so mutants that violate Psalm checks are no longer rejected during mutation testing and the results lose the previous static-analysis validation.

Configure Infection’s static-analysis integration with the project’s chosen analyzer in `infection.json.dist` or pass the corresponding option in both local and CI commands.

Also at `.github/workflows/mutation.yml:33`, `composer.json:48`.


psalm: ## Run Psalm static analysis: `make psalm ARGS="--show-info=true"`
$(RUN) ./vendor/bin/psalm $(if $(ARGS),$(ARGS),--php-version=$(PHP_VERSION))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.95.11",
"infection/infection": "^0.29.8 || ^0.35.8",
"phpbench/phpbench": "^1.4.3",
"phpunit/phpunit": "^10.5.63",
"rector/rector": "^2.5.2",
"roave/infection-static-analysis-plugin": "^1.35",
"shipmonk/composer-dependency-analyser": "^1.8",
"vimeo/psalm": "^5.26.1 || ^6.16.1",
"yiisoft/code-style": "^1.0",
Expand Down
5 changes: 2 additions & 3 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

## Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it:

```shell
./vendor/bin/roave-infection-static-analysis-plugin
./vendor/bin/infection
```

## Static analysis
Expand Down
Loading