Add mutation testing

This commit is contained in:
Aidan Woods 2019-02-02 21:09:56 +00:00
parent 54f2c4eb4c
commit efe324c08b
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
4 changed files with 61 additions and 24 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
composer.lock composer.lock
vendor/ vendor/
infection.log

View File

@ -5,31 +5,15 @@ sudo: false
stages: stages:
- Code Format and Static Analysis - Code Format and Static Analysis
- test - Units
- Mutation
- Test CommonMark (weak) - Test CommonMark (weak)
php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly
matrix: matrix:
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- php: nightly
- env: ALLOW_FAILURE - env: ALLOW_FAILURE
install:
# remove packages with PHP requirements higher than 7.0 to prevent composer trying to resolve these, see: https://github.com/composer/composer/issues/6011
- composer remove vimeo/psalm friendsofphp/php-cs-fixer --dev --no-update --no-interaction
- composer install --prefer-dist --no-interaction --no-progress
script: composer test-units
cache: cache:
directories: directories:
- $HOME/.composer/cache - $HOME/.composer/cache
@ -45,7 +29,47 @@ jobs:
- composer test-formatting - composer test-formatting
- composer test-dead-code - composer test-dead-code
- stage: Test CommonMark
- &UNIT_TEST
stage: Units
php: 5.5
install:
# remove packages with PHP requirements higher than 7.0 to prevent composer trying to resolve these, see: https://github.com/composer/composer/issues/6011
- composer remove vimeo/psalm friendsofphp/php-cs-fixer infection/infection --dev --no-update --no-interaction
- composer install --prefer-dist --no-interaction --no-progress
script: composer test-units
- <<: *UNIT_TEST
php: 5.6
- <<: *UNIT_TEST
php: 7.0
- <<: *UNIT_TEST
php: 7.1
- <<: *UNIT_TEST
php: 7.2
- <<: *UNIT_TEST
php: 7.3
- <<: *UNIT_TEST
php: nightly
env: ALLOW_FAILURE
- &MUTATION_TEST
stage: Mutation
php: 7.1
install:
- composer install --prefer-dist --no-interaction --no-progress
script: vendor/bin/infection --threads=2 --min-msi=80 --min-covered-msi=80
- <<: *MUTATION_TEST
php: 7.2
- <<: *MUTATION_TEST
php: 7.3
- <<: *MUTATION_TEST
php: nightly
env: ALLOW_FAILURE
- &COMMONMARK_TEST
stage: CommonMark
name: Weak name: Weak
php: 7.3 php: 7.3
env: ALLOW_FAILURE env: ALLOW_FAILURE
@ -53,10 +77,7 @@ jobs:
script: script:
- composer test-commonmark-weak - composer test-commonmark-weak
- stage: Test CommonMark - <<: *COMMONMARK_TEST
name: Strict name: Strict
php: 7.3
env: ALLOW_FAILURE
install: composer install --prefer-dist --no-interaction --no-progress
script: script:
- composer test-commonmark - composer test-commonmark

View File

@ -19,7 +19,8 @@
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7.4|^6.5.13|^5.7.27|^4.8.36", "phpunit/phpunit": "^7.4|^6.5.13|^5.7.27|^4.8.36",
"vimeo/psalm": "^3.0.11", "vimeo/psalm": "^3.0.11",
"friendsofphp/php-cs-fixer": "^2.13" "friendsofphp/php-cs-fixer": "^2.13",
"infection/infection": "^0.12.0"
}, },
"autoload": { "autoload": {
"psr-4": {"Erusev\\Parsedown\\": "src/"} "psr-4": {"Erusev\\Parsedown\\": "src/"}

14
infection.json.dist Normal file
View File

@ -0,0 +1,14 @@
{
"timeout": 10,
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "infection.log"
},
"mutators": {
"@default": true
}
}