Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
emadbatwa opened this issue May 21, 2024 · 6 comments
Open

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

emadbatwa opened this issue May 21, 2024 · 6 comments
Labels

Comments

@emadbatwa
Copy link

emadbatwa commented May 21, 2024

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 emadbatwa added the bug label May 21, 2024
@havekes
Copy link

havekes commented Jun 4, 2024

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

@havekes
Copy link

havekes commented Jun 4, 2024

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 #94

@nunomaduro
Copy link
Member

Can someone pull request this to the documentation?

@havekes
Copy link

havekes commented Jun 5, 2024

Can someone pull request this to the documentation?

pestphp/docs#266

@owenvoke
Copy link
Member

owenvoke commented Jun 5, 2024

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).

@TimeglitchD
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants