From a3af138f0cfd26fac799f6af8c3b1ba401576f1b Mon Sep 17 00:00:00 2001 From: Meritoo Date: Sat, 12 Feb 2022 13:33:30 +0100 Subject: [PATCH] Update documentation for Infection (Mutation Testing) and use the "nproc" command that returns the number of processors available --- docs/Development.md | 8 +++++--- phing/properties.dist | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/Development.md b/docs/Development.md index 19c6632..e2fce80 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -105,20 +105,22 @@ docker-compose exec php phing -f phing/tests.xml test:phpunit docker-compose run --rm phpunit --verbose --no-coverage ``` -# Mutation Tests +# Infection - Mutation Testing Served by [Infection — Mutation Testing Framework](https://infection.github.io). ### Running tests ```bash -docker-compose exec php vendor/bin/infection --threads=5 +$ docker-compose exec php bash +root@18f2f0cfaa5d:/var/www/application# XDEBUG_MODE=coverage ./vendor/bin/infection --threads=$(nproc) ``` or ```bash -docker-compose exec php phing -f phing/tests.xml test:infection +$ docker-compose exec php bash +root@18f2f0cfaa5d:/var/www/application# XDEBUG_MODE=coverage phing -f phing/tests.xml test:infection ``` ### Result of testing diff --git a/phing/properties.dist b/phing/properties.dist index c287955..76237a2 100644 --- a/phing/properties.dist +++ b/phing/properties.dist @@ -86,4 +86,4 @@ tests.database = ${dir.data.temporary}/database.sqlite # - Infection (mutation tests) # tests.phpunit.command = ./vendor/bin/phpunit --verbose -tests.mutation.command = ./vendor/bin/infection --ansi --threads=5 --coverage=build/reports/infection +tests.mutation.command = ./vendor/bin/infection --ansi --threads=$(nproc) --coverage=build/reports/infection