[TESTS] Use paratest and PHPUnit cache

This speeds up tests from 90s to 44s on my machine
This commit is contained in:
Hugo Sales 2022-10-28 00:22:42 +01:00
parent 857e5a9c6f
commit e44bef6de7
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 13 additions and 7 deletions

View File

@ -9,8 +9,8 @@ bin/console doctrine:schema:update --force || exit 1
yes yes | bin/console doctrine:fixtures:load || exit 1
if [ "$#" -eq 0 ] || [ -z "$*" ]; then
vendor/bin/simple-phpunit -vvv --coverage-html .test_coverage_report
XDEBUG_MODE=coverage vendor/bin/paratest --verbose --debug --processes=32 --functional --configuration=phpunit.xml.dist
else
echo "Running with filter"
vendor/bin/simple-phpunit -vvv --coverage-html .test_coverage_report $*
XDEBUG_MODE=coverage vendor/bin/paratest --verbose --debug --processes=32 --functional --configuration=phpunit.xml.dist
fi

View File

@ -5,12 +5,15 @@
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
cacheDirectory="var/phpunit/coverage_cache"
cacheResultFile="var/phpunit/result_cache"
stopOnFailure="true"
stopOnError="true"
cacheResult="true">
<coverage processUncoveredFiles="true">
cacheResult="true"
processIsolation="false">
<coverage
cacheDirectory="var/phpunit/coverage_cache"
includeUncoveredFiles="true"
processUncoveredFiles="true"
>
<!-- pathCoverage="true" -->
<include>
<directory suffix=".php">src</directory>
</include>
@ -35,6 +38,9 @@
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
</php>
<report>
<html outputDirectory=".test_coverage_report"/>
</report>
<testsuites>
<testsuite name="Controller">
<directory suffix="Test.php">./tests/Controller</directory>