feat: allow PLAYWRIGHT_CLI_PATH to point directly at cli.js#618
Merged
Conversation
The official NixOS playwright-driver package keeps cli.js at the package root rather than under package/, so getDriverCliJs could not resolve it even with PLAYWRIGHT_DRIVER_PATH set. Add a PLAYWRIGHT_CLI_PATH env var that points directly at cli.js, bypassing the assumed layout. This mirrors the existing PLAYWRIGHT_NODEJS_PATH escape hatch for the Node.js binary. Closes #575
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.
Problem
Closes #575.
On NixOS, the official
playwright-driverpackage keepscli.jsat the package root, whereas playwright-go'sgetDriverCliJshardcodes<DriverDirectory>/package/cli.js. As a result, even when users pointPLAYWRIGHT_DRIVER_PATHat the Nix store path, resolution fails — forcing symlink workarounds in their flakes (see the issue thread).Fix
Add a
PLAYWRIGHT_CLI_PATHenv var that points directly atcli.js, bypassing the assumedpackage/layout. This deliberately mirrors the existingPLAYWRIGHT_NODEJS_PATHescape hatch (which already lets users point directly at the Node.js binary), so both halves of the driver are now symmetric.With this, the reporter's flake reduces to:
Changes
getDriverCliJshonorsPLAYWRIGHT_CLI_PATHbefore falling back to the default layout.RunOptions.DriverDirectorydoc comment.TestGetDriverCliJs, mirroringTestGetNodeExecutable.go build ./...and the targeted tests pass.