Running parallel tests in CI pipeline
Hi folks,
For some reason I can't seem to run my tests in parallel in my Gitlab pipeline.
The following command works locally:
php artisan test -p
However, when I use this in the pipeline I get the below error:
$ composer test-parallel
Do not run Composer as root/super user! See https://getcomposer.org/root for details
> @php artisan test -p
Warning: TTY mode requires /dev/tty to be read/writable.
The "--parallel" option does not exist.
paratest [--bootstrap BOOTSTRAP] [--colors [COLORS]] [-c|--configuration CONFIGURATION] [--coverage-clover COVERAGE-CLOVER] [--coverage-cobertura COVERAGE-COBERTURA] [--coverage-crap4j COVERAGE-CRAP4J] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [--coverage-test-limit COVERAGE-TEST-LIMIT] [--coverage-text [COVERAGE-TEXT]] [--coverage-xml COVERAGE-XML] [--debug] [--exclude-group EXCLUDE-GROUP] [--filter FILTER] [-f|--functional] [-g|--group GROUP] [-h|--help] [--log-junit LOG-JUNIT] [--log-teamcity LOG-TEAMCITY] [-m|--max-batch-size MAX-BATCH-SIZE] [--no-coverage] [--no-test-tokens] [--order-by ORDER-BY] [--parallel-suite] [--passthru PASSTHRU] [--passthru-php PASSTHRU-PHP] [--path PATH] [-p|--processes PROCESSES] [--random-order-seed RANDOM-ORDER-SEED] [--repeat REPEAT] [--runner RUNNER] [--stop-on-failure] [--teamcity] [--testdox] [--testsuite TESTSUITE] [--tmp-dir TMP-DIR] [-v|--verbose] [--whitelist WHITELIST] [--] [<path>]
Script @php artisan test -p handling the test-parallel event returned with error code 1
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1
Any thoughts? Thanks!
What if you actually run php artisan test -p instead of composer test-parallel
@cwhite Exactly the same error ? Or the -p option does not exist? Can you show the script ?
@Sinnbeck,
$ php artisan test -p
Warning: TTY mode requires /dev/tty to be read/writable.
The "--parallel" option does not exist.
paratest [--bootstrap BOOTSTRAP] [--colors [COLORS]] [-c|--configuration CONFIGURATION] [--coverage-clover COVERAGE-CLOVER] [--coverage-cobertura COVERAGE-COBERTURA] [--coverage-crap4j COVERAGE-CRAP4J] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [--coverage-test-limit COVERAGE-TEST-LIMIT] [--coverage-text [COVERAGE-TEXT]] [--coverage-xml COVERAGE-XML] [--debug] [--exclude-group EXCLUDE-GROUP] [--filter FILTER] [-f|--functional] [-g|--group GROUP] [-h|--help] [--log-junit LOG-JUNIT] [--log-teamcity LOG-TEAMCITY] [-m|--max-batch-size MAX-BATCH-SIZE] [--no-coverage] [--no-test-tokens] [--order-by ORDER-BY] [--parallel-suite] [--passthru PASSTHRU] [--passthru-php PASSTHRU-PHP] [--path PATH] [-p|--processes PROCESSES] [--random-order-seed RANDOM-ORDER-SEED] [--repeat REPEAT] [--runner RUNNER] [--stop-on-failure] [--teamcity] [--testdox] [--testsuite TESTSUITE] [--tmp-dir TMP-DIR] [-v|--verbose] [--whitelist WHITELIST] [--] [<path>]
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1
@cwhite can you try
php artisan test -- -p
@Sinnbeck,
That resulted in this error:
$ php artisan test -- -p
Warning: TTY mode requires /dev/tty to be read/writable.
The "--printer" option does not exist.
paratest [--bootstrap BOOTSTRAP] [--colors [COLORS]] [-c|--configuration CONFIGURATION] [--coverage-clover COVERAGE-CLOVER] [--coverage-cobertura COVERAGE-COBERTURA] [--coverage-crap4j COVERAGE-CRAP4J] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [--coverage-test-limit COVERAGE-TEST-LIMIT] [--coverage-text [COVERAGE-TEXT]] [--coverage-xml COVERAGE-XML] [--debug] [--exclude-group EXCLUDE-GROUP] [--filter FILTER] [-f|--functional] [-g|--group GROUP] [-h|--help] [--log-junit LOG-JUNIT] [--log-teamcity LOG-TEAMCITY] [-m|--max-batch-size MAX-BATCH-SIZE] [--no-coverage] [--no-test-tokens] [--order-by ORDER-BY] [--parallel-suite] [--passthru PASSTHRU] [--passthru-php PASSTHRU-PHP] [--path PATH] [-p|--processes PROCESSES] [--random-order-seed RANDOM-ORDER-SEED] [--repeat REPEAT] [--runner RUNNER] [--stop-on-failure] [--teamcity] [--testdox] [--testsuite TESTSUITE] [--tmp-dir TMP-DIR] [-v|--verbose] [--whitelist WHITELIST] [--] [<path>]
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
Note that I get the same The "--parallel" option does not exist. error when using vendor/bin/pest -p.
Update
I was originally installing the composer packages with:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts --no-plugins
I updated to the following and the tests started running in parallel:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
@cwhite good to hear but you never posted the script :)
Please or to participate in this conversation.