Skip to content

Commit

Permalink
CLI-556: Mutation testing (#915)
Browse files Browse the repository at this point in the history
* CLI-556: Add mutation testing.

* remove broken tests

* fix phpstan

* xdebug_mode

* Revert "fix phpstan"

This reverts commit 2fa9e2e.

* Revert "remove broken tests"

This reverts commit ae08062.

* composer

* fix workflow

* cleanup

* cleanup

* fix filter
  • Loading branch information
danepowell authored Apr 15, 2022
1 parent c89b0e4 commit 1665aec
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Mutation Testing

on: [pull_request]

jobs:
tests:
runs-on: ubuntu-latest

name: Mutation Testing Code Review Annotations
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
extensions: pcov
coverage: pcov

- name: Install dependencies
run: |
composer install --no-progress --no-suggest --no-interaction
- name: Download Infection
run: composer infection-install

- name: Run Infection for added files only
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
php build/infection.phar -j2 --git-diff-filter=AM --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --only-covered
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@
"box-compile": [
"php build/box.phar compile"
],
"infection-install": [
"curl -f -L https://github.com/infection/infection/releases/download/0.26.0/infection.phar -o build/infection.phar"
],
"infection": [
"XDEBUG_MODE=coverage php build/infection.phar --threads=8"
],
"cs": "phpcs",
"cbf": "phpcbf",
"unit": "phpunit tests/phpunit -vvv",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions infection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/infection/infection/0.26.0/resources/schema.json",
"source": {
"directories": [
"src"
]
},
"mutators": {
"@default": true
}
}

0 comments on commit 1665aec

Please sign in to comment.