Repository navigation
Conversation
Under --parallel, the workers only receive PHPUnit's arguments, so they silently ran Chrome without traces and in light mode, whatever the options of the run. The run now hands them to its workers through Parallel::setGlobal(), as the Snapshot plugin does for --update-snapshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:
Under
--parallel, the workers ignore--browser,--trace,--darkand--light: they run Chrome, record no trace and render in light mode, whatever the options of the run. Nothing fails, so a--browser safari --parallelrun passes while no test ran in WebKit.The run does parse these options, but its workers are started with PHPUnit's arguments only (
--cache-directory,--no-output…), soPlugin::handleArguments()never sees them in a worker.Reproduction, with a test that records
Playwright::defaultBrowserType()andPlaywright::shouldTrace()from inside a worker, then fails:pest --browser safari --tracepest --browser safari --trace --parallelThe fix follows what Pest's
Snapshotplugin does for--update-snapshots: when the run is parallel,handleArguments()hands the browser options to the workers throughParallel::setGlobal(), and a worker appends them to its own arguments before parsing them, so they go through the same code as in a serial run.pest()->browser()inPest.phpstill takes precedence, as it is loaded after the arguments are handled. The options rejected under--parallel(--headed,--debug,--diff,--slow-mo) are not forwarded.The new tests in
tests/Unit/Plugin/ParallelPluginTest.phphand the arguments of a parallel run to the plugin, then those of a worker, and check the browser, the trace and the color scheme the worker ends up with. Checked end to end on a Laravel app as well, under Chrome and WebKit.🤖 Generated with Claude Code