I want to skip some phpunit tests in scrutinizer.
How can I achive the same?
Where do I need to do configuration changes for the same?
I want to skip some phpunit tests in scrutinizer.
How can I achive the same?
Where do I need to do configuration changes for the same?
In my case, I have added
./vendor/bin/phpunit --exclude-group Group1, Group2
command as follows in .scrutinizer.yml file at application level to skip phpunits representing these groups as follows :
build:
nodes:
acsi:
tests:
override:
- './vendor/bin/phpunit --exclude-group Group1, Group2'
- phpcs-run --standard=phpcs.xml
- php-scrutinizer-run
Many CI systems incl. Scrutinizer CI set environment variables in their build environment.
For example the environment variable
SCRUTINIZER
is set toTRUE
. That is only one of many, learn more about Pre-defined Environment Variables on Scrutinizer CI.Inside the test method (or inside the
setUp()
method for the whole class) you can check the environment variable (e.g. via$_ENV
) and mark the test as skipped.See as well the more general question How to skip tests in PHPunit? and the Phpunit documentation Incomplete and Skipped Tests.