Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add mutation testing
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 16, 2019
1 parent 59dbff4 commit 116baf9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -1,4 +1,5 @@
.* export-ignore
infection.json export-ignore
Makefile export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
Expand Down
1 change: 1 addition & 0 deletions .github/settings.yml
Expand Up @@ -21,6 +21,7 @@ branches:
- "Tests (7.4, lowest)"
- "Tests (7.4, highest)"
- "Code Coverage (7.4)"
- "Mutation Tests (7.4)"
strict: true

required_pull_request_reviews: null
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -182,3 +182,38 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)

mutation-tests:
name: "Mutation Tests"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.4

steps:
- name: "Checkout"
uses: actions/checkout@v1

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v1
with:
coverage: pcov
extensions: "mbstring"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress --no-suggest

- name: "Run mutation tests with pcov and infection/infection"
run: vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=75 --min-msi=65
11 changes: 11 additions & 0 deletions infection.json
@@ -0,0 +1,11 @@
{
"timeout": 10,
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "build/infection/infection-log.txt"
}
}
1 change: 1 addition & 0 deletions vendor-bin/test/composer.json
@@ -1,5 +1,6 @@
{
"require": {
"infection/infection": "^0.15",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpunit/phpunit": "^8.2",
"symfony/phpunit-bridge": "^4.1"
Expand Down

0 comments on commit 116baf9

Please sign in to comment.