Summer Sale! All accounts are 50% off this week.

cwhite's avatar
Level 19

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!

0 likes
9 replies
Sinnbeck's avatar

What if you actually run php artisan test -p instead of composer test-parallel

Sinnbeck's avatar

@cwhite Exactly the same error ? Or the -p option does not exist? Can you show the script ?

cwhite's avatar
Level 19

@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's avatar
Level 19

@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
cwhite's avatar
Level 19

Note that I get the same The "--parallel" option does not exist. error when using vendor/bin/pest -p.

cwhite's avatar
cwhite
OP
Best Answer
Level 19

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

Please or to participate in this conversation.