pest icon indicating copy to clipboard operation
pest copied to clipboard

[Bug]: Unknown option "--parallel". github workflow

Open emadbatwa opened this issue 1 year ago • 6 comments

What Happened

image

when run pest with --parallel flag on github action always get INFO Unknown option "--parallel".

the workflow file is :

name: Build and Test

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    container:
      image: kirschbaumdevelopment/laravel-test-runner:8.3

    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: db_testing
        ports:
        - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5


    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install composer Dependencies
        run: |
          composer install --prefer-dist --no-interaction --no-suggest

      - name: Prepare Laravel Application
        run: |
          cp .env.ci .env
          php artisan key:generate
          
      - name: Verify Pest Version
        run: ./vendor/bin/pest --version

      - name: Execute backend tests (using custom composer script)
        run: ./vendor/bin/pest -c phpunit.pgsql.xml --no-coverage --parallel --processes=10

but if i remove --parallel i can run without any issue

How to Reproduce

create github workflow file push to github see actions failed with error :

INFO Unknown option "--parallel".

Error: Process completed with exit code 2.

Sample Repository

No response

Pest Version

2.34.7

PHP Version

8.3

Operation System

Linux

Notes

No response

emadbatwa avatar May 21 '24 12:05 emadbatwa

Having the same issue on Bitbucket pipelines. Did you try with --parallel as the first option?

havekes avatar Jun 04 '24 18:06 havekes

Finally found the solution for me at least. Seems to have to do with composer not installing the scripts in version 2.7 onwards. Adding COMPOSER_ALLOW_SUPERUSER=1 solved the issue. Seems related to https://github.com/pestphp/pest/issues/94

havekes avatar Jun 04 '24 19:06 havekes

Can someone pull request this to the documentation?

nunomaduro avatar Jun 05 '24 09:06 nunomaduro

Can someone pull request this to the documentation?

https://github.com/pestphp/docs/pull/266

havekes avatar Jun 05 '24 12:06 havekes

Does using composer config allow-plugins.pestphp/pest-plugin to add the Pest Plugin as an allowed Composer plugin in the composer.json not work? 🤔 That way, it only enables the Pest plugin (rather than allowing any scripts to run with SU access).

owenvoke avatar Jun 05 '24 12:06 owenvoke

Does using composer config allow-plugins.pestphp/pest-plugin to add the Pest Plugin as an allowed Composer plugin in the composer.json not work? 🤔 That way, it only enables the Pest plugin (rather than allowing any scripts to run with SU access).

I'm afraid not, it returns this message (in Bitbucket at least):

Composer plugins have been disabled for safety in this non-interactive session.
Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.

TimeglitchD avatar Aug 19 '24 12:08 TimeglitchD