[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 yes yes | bin/console doctrine:fixtures:load || exit 1
if [ "$#" -eq 0 ] || [ -z "$*" ]; then 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 else
echo "Running with filter" 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 fi

View File

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