fix: popArgument drops duplicate arguments breaking --parallel --exclude-gropup=#1674
Open
flap152 wants to merge 3 commits into
Open
fix: popArgument drops duplicate arguments breaking --parallel --exclude-gropup=#1674flap152 wants to merge 3 commits into
flap152 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes argument handling in Pest plugins so duplicate argument values are not silently dropped (notably in --parallel scenarios with repeated --exclude-group), and adds coverage to prevent regressions.
Changes:
- Reworked
HandleArguments::popArgument()to remove an element viaarray_search+unsetinstead ofarray_flip(preserves duplicate values). - Refactored the Coverage plugin’s argument stripping to reuse the
HandleArgumentstrait. - Added unit + visual tests for the duplicate-argument scenario and updated snapshots/expected counts accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Plugins/Concerns/HandleArguments.php |
Changes popArgument() implementation to avoid dropping duplicate values. |
src/Plugins/Coverage.php |
Uses the shared HandleArguments trait to strip coverage-related CLI args safely. |
tests/Unit/Plugins/Concerns/HandleArguments.php |
Adds unit tests proving duplicates are preserved. |
tests/Visual/Parallel.php |
Adds a visual regression test for multiple --exclude-group under --parallel; updates expected output counts. |
tests/.snapshots/success.txt |
Snapshot updates to include new tests and updated totals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6fb1c9d to
7904e42
Compare
7904e42 to
520d86c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
popArgument()in HandleArguments usesarray_flip()twice, which silentlydrops duplicate values. This breaks
--parallelwhen multiple--exclude-groupflags are passed, since the parallel argument pipeline stores
--exclude-groupand the group name as separate array entries (creating duplicate keys on flip).
The Coverage plugin had the same inline
array_flippattern.Fix: Replace
array_flipwitharray_search+unsetinpopArgument(),and refactor Coverage to use the HandleArguments trait instead of inline logic.
Tests: Unit tests for
popArgument()proving duplicate values are preserved.Visual test for parallel with multiple
--exclude-groupflags.Related:
Fixes #1437
Supersedes #1620, #1468