Repository navigation
ci(e2e): Run E2E tests with pnpm 12 - #25334
Conversation
Volta cannot run pnpm 12, so pnpm is now a root devDependency. Volta only pins node per app. pnpm 11+ reads settings only from pnpm-workspace.yaml and blocks unlisted build scripts, so each app now has a pnpm-workspace.yaml with allowBuilds and minimumReleaseAge: 0.
| "typescript": "~5.8.3", | ||
| "vite": "^7.3.2" | ||
| }, | ||
| "volta": { |
There was a problem hiding this comment.
not directly related to this test, but we should actually replace these with a reference to the workspace volta config.
There was a problem hiding this comment.
(I may open a PR to update this everywhere)
|
Semi related, opened #25369 to actually update volta config in e2e test apps to better align with the fact we are using node 24 anyhow now by default! |
# Conflicts: # dev-packages/e2e-tests/test-applications/browser-bfcache/package.json # dev-packages/e2e-tests/test-applications/browser-mfe-vite/package.json # dev-packages/e2e-tests/test-applications/browser-webworker-vite/package.json # dev-packages/e2e-tests/test-applications/remix-v3/package.json
# Conflicts: # dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite4/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite6/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite7/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite8/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/package.json
JPeer264
left a comment
There was a problem hiding this comment.
LGTM. Just added nits mostly
| - **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests` | ||
| - **Build failures**: Fix build errors before running tests | ||
| - **pnpm errors such as `packages field missing or empty`**: The app needs the pnpm version in its `volta.pnpm`. Run with Volta, which installs that version | ||
| - **`ERR_PNPM_IGNORED_BUILDS`**: A dependency has a build script that the app's `allowBuilds` does not list. Add it to the app's `pnpm-workspace.yaml`: `true` if the app needs the script, `false` if the script only prints a message |
There was a problem hiding this comment.
l: Theoretically pnpm approve-builds is adding it - maybe worth to add this here
| steps: | ||
| - name: Resolve pnpm version | ||
| id: pnpm-version | ||
| # The devDependency is the one pnpm version for CI and local runs. An app that needs another version sets |
There was a problem hiding this comment.
super-l: It is weird that it is written devDependency and not "dev dependency" - maybe we can rename it to the latter. First I read it any thought that something is off 😅
| # The devDependency is the one pnpm version for CI and local runs. An app that needs another version sets | |
| # The dev dependency is the one pnpm version for CI and local runs. An app that needs another version sets |
| @@ -0,0 +1 @@ | |||
| minimumReleaseAge: 0 | |||
There was a problem hiding this comment.
q/l: Couldn't we make one more global pnpm-workspace.yaml in the e2e test root and copy it over into each directory? Theoretically we don't treat each folder as own workspace, but we potentially forget to set minimumRelaseAge: 0 on new tests.
If we keep it though, we should add a bugbot rule that this is set as a minimum on new e2e tests or make sure in our runners that this is set. wdyt?
There was a problem hiding this comment.
I'll add a rule for that 👍
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "nitro": "latest || *", | ||
| "nitro": "^3.0.0", |
There was a problem hiding this comment.
q: Is that change necessary in this PR? Or was it required to be changed
There was a problem hiding this comment.
yes, listed in the PR description:
The tanstackstart apps use "nitro": "^3.0.0", because pnpm 12 resolved latest || * to the placeholder nitro@0.0.0. This installs the same nitro@3.0.0 as pnpm 9. A follow-up moves them to the nitro beta, which needs Vite 8.
There was a problem hiding this comment.
Thanks for confirming. Sorry I forgot the PR description after scrolling through all the changes 😅
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "nitro": "latest || *", | ||
| "nitro": "^3.0.0", |
There was a problem hiding this comment.
Moves the E2E tests from pnpm 9 to pnpm 12. Volta still manages node.
pnpm-workspace.yaml. pnpm 11+ reads its settings only from this file.allowBuilds: pnpm 11+ fails the install on build scripts that are not listed.falseis only for scripts that just print a message.minimumReleaseAge: 0: by default, pnpm 11+ installs only releases that are at least 24 hours old, and falls back to older versions. The apps test against the newest releases, so the E2E runner fails if an app does not set it.@electron/rebuild^4.2.1. Older versions depend on@electron/node-gypfrom git, and pnpm 11+ blocks git dependencies of dependencies.package.json#pnpm, and some apps usedpackage.json#resolutions. pnpm 11+ ignores both without an error. The E2E runner now fails if an app still uses them.next/package.json.pnpm add next@15now saves^15.x.y, and the old version checks did not work with the^."nitro": "^3.0.0", because pnpm 12 resolvedlatest || *to the placeholdernitro@0.0.0. This installs the samenitro@3.0.0as pnpm 9. A follow-up moves them to the nitro beta, which needs Vite 8.npx playwright installintest:build. CI already installs the app's Playwright version, and the second install ran at the same time and failed.Why pnpm is a root dev dependency
pnpm switches to the version in a
packageManagerfield, but a pnpm must already be installed to do that. Yarn installs that first pnpm as a dev dependency, because Volta can't run pnpm 12 and is unmaintained. Thepnpmpackage is a native binary, so it does not depend on the node version that an app pins.yarn.lockpins the version, so local runs and CI use the same pnpm. Contributors need no extra setup, and CI caches pnpm withnode_modules.Rejected alternatives:
pnpm/action-setupalone: it only installs pnpm in CI. Contributors would have to install pnpm themselves, and their version could differ from CI.packageManagerin the rootpackage.json. A test app can still pin another pnpm version (10.30 or newer, which readsallowBuilds) with its ownpackageManagerfield.