Conversation
|
@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 |
src/Plugins/Shard.php
Outdated
| $filtered = []; | ||
| $skipNext = false; | ||
|
|
||
| foreach ($arguments as $argument) { |
There was a problem hiding this comment.
@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;
}));
|
@sonalidudhia Thanks for your comments, hopefully you are happy with how I addressed them! |
|
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. |
|
I just encountered this problem when I tried to combine sharding with parallel testing. @adamjsturge Would this fix make it possible to run each shard in parallel mode? |
Parallel mode and sharding should still work but when you add |
What:
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