feat: support per-entry workingDir on playwrightChecks#1351
Open
kiroushi wants to merge 3 commits into
Open
Conversation
A single bundled `checkly test`/`deploy` session can contain several playwrightChecks, but they share one bundle root and one working directory, so each self-contained Playwright project (its own package manager and pinned @playwright/test) needs hand-written installCommand/testCommand shell surgery, and the CLI resolves a single @playwright/test version for all of them. Add an optional per-entry `workingDir` to PlaywrightCheck and playwrightChecks config entries. When set, the bundler resolves that entry's Playwright version from the working directory and stamps a per-entry working directory (plus a working-dir-relative playwright config path) into the check payload, so one session can carry projects on different Playwright versions without command surgery. Backward compatible: when `workingDir` is omitted, every computed value is identical to today (defaults to the project directory).
f0b7fac to
da101f2
Compare
…'s lockfile RED-625 Phase 3: make the CLI the source of truth for each playwrightChecks entry's Playwright version. When an entry has a workingDir, resolve @playwright/test from that fixture's own lockfile (the nearest one walking up, bounded strictly below the monorepo/Session.workspace lockfile) instead of collapsing every fixture to the monorepo catalog version.
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
Adds an optional per-entry
workingDirtoplaywrightChecksentries (and thePlaywrightCheckconstruct).A single bundled
checkly test/deploysession can contain severalplaywrightChecks, but today they share one bundle root and one working directory. So each self-contained Playwright project (its own package manager and pinned@playwright/test) needs hand-writteninstallCommand/testCommandshell surgery, and the CLI resolves a single@playwright/testversion for all of them.With
workingDirset on an entry, the bundler:workingDir+ a working-dir-relativeplaywrightConfigPathinto the check payload.So one session can carry projects on different Playwright versions without command surgery.
Backward compatibility
When
workingDiris omitted, every computed value is identical to today (defaults to the project directory).Changes
PlaywrightCheckProps.workingDir(+ the slimmed config prop) — new optional prop, threaded via the existing config spread.PlaywrightProjectBundler.bundle/bundleProject— acceptworkingDir; compute the version anchor, payloadworkingDir, andrelativePlaywrightConfigPathfrom the effective working directory; cache key includes it.Verification
tsc --noEmitcleaneslintcleanplaywright-check.spec.ts(54) +playwright-project-bundler.spec.ts(20, incl. newworkingDirtests) pass