File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,13 @@ phpUnitCoverage=1 bin/qa
9292
9393You might decide to do this if you are running these tests on travis, as you can see in [ ./travis.yml] ( ./../../.travis.yml )
9494
95+ #### Config Changes When Generating Coverage
96+
97+ Generating coverage can cause a dramatic speed degradation. For this reason
98+
99+ * PHPUnit will fail on the first error rather than run the full suite
100+ * We will not enforce any time limits for ` @small ` ` @medium ` ` @large `
101+
95102### Speed Impact of Enabling Coverage
96103
97104If coverage is enabled, then the tests have to be run with Xdebug enabled. This on it's own has a dramatic impact on the speed of PHP execution.
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ readonly projectRoot="$DIR/../../"
1313
1414cd $projectRoot
1515
16+ # check for stupid
1617./bin/qa -t lint
1718
19+ # fix some ugly
1820./bin/qa -t bf
1921
22+ # re add the staged files so that any CS fixes are applied
23+ git add $( git diff --name-only --cached)
24+
2025echo "
2126===========================================
2227PHPQA Pre Commit Hook COMPLETED
Original file line number Diff line number Diff line change @@ -23,22 +23,25 @@ phpunitLogFilePath="$varDir/phpunit_logs/phpunit.junit.xml"
2323while (( phpunitExitCode > 0 ))
2424do
2525 extraConfigs=(" " )
26- if [[ " 1" != " $phpUnitCoverage " ]]
27- then
28- extraConfigs+=( --no-coverage )
29- fi
3026 if [[ " 1" == " $phpUnitIterativeMode " ]]
3127 then
28+ # Uniterate mode - order by defects, stop on first error, no coverage and enforce time limits
3229 echo
3330 echo " Uniterate Mode - Iterative Testing with Fast Failure"
3431 echo " ----------------------------------------------------"
3532 echo
3633 extraConfigs+=( --order-by=depends,defects )
3734 extraConfigs+=( --stop-on-failure --stop-on-error --stop-on-defect --stop-on-warning )
3835 extraConfigs+=( --no-coverage )
39- else
40- # Only enforce time limit if we are not in iterative mode, otherwise it kills Xdebug sessions
4136 extraConfigs+=( --enforce-time-limit )
37+ elif [[ " 1" != " $phpUnitCoverage " ]]
38+ then
39+ # No Coverage mode - do not generate coverage, do enforce time limits
40+ extraConfigs+=( --no-coverage )
41+ extraConfigs+=( --enforce-time-limit )
42+ else
43+ # Coverage generation mode (slow) - stop on first error, do not enforce time limits
44+ extraConfigs+=( --stop-on-failure --stop-on-error --stop-on-defect --stop-on-warning )
4245 fi
4346 set +e
4447 set -x
You can’t perform that action at this time.
0 commit comments