Skip to content

Conversation

@adamjsturge
Copy link

What:

  • Bug Fix
  • New Feature

Description:

Fixes #1454

When you try to use sharding since it has to see what tests, process is an illegal argument for that. I tried adding it to the array that filters out parallel, but it doesn't work because of the = i think. So I made a simple filter to get it

@adamjsturge
Copy link
Author

@nunomaduro are you able to review this? This has been a blocker for my organization for a little bit and really hoping we can get this fix out

$filtered = [];
$skipNext = false;

foreach ($arguments as $argument) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamjsturge
I’ve put together a slightly optimized version of the logic to make it more concise by using array_filter and avoiding manual array building.
This helps keep the code a bit cleaner and easier to maintain.

    return array_values(array_filter($arguments, function (string $argument) {

        if (str_starts_with($argument, '--processes') && str_contains($argument, '=')) {
            return false;
        }

        static $skipNext = false;
        if ($skipNext) {
            $skipNext = false;
            return false;
        }

        if ($argument === '--processes') {
            $skipNext = true;
            return false;
        }

        return true;
    }));

@adamjsturge
Copy link
Author

@sonalidudhia Thanks for your comments, hopefully you are happy with how I addressed them!

@optii
Copy link

optii commented Oct 14, 2025

Any news on when this will land ? We are waiting on this for our test pipelines. If there is anything I can do to help get this through, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Pest 4: Unknown option "--processes" when Using Sharding

4 participants