[test] Resolve workspace packages from local tarballs in isolated installs#96081
[test] Resolve workspace packages from local tarballs in isolated installs#96081gaearon wants to merge 1 commit into
Conversation
…talls pnpm only honors overrides at the workspace root, so the overrides that createNextInstall writes into the install dir's package.json are ignored whenever a fixture creates its own pnpm-workspace.yaml above it. Those installs fetch workspace packages like @next/env from the npm registry at the repo's current version, which fails while a canary release is still propagating (this took out 16 CI shards in a single run) and otherwise silently tests published packages instead of the local build. Write the overrides into the pnpm-workspace.yaml that governs the install, drop the pnpm.overrides field from the generated package.json, and assert after each default install that @next/env resolved from the packed tarball so a regression fails immediately instead of during publish windows.
Failing test suitesCommit: f549afc | About building and testing Next.js
Expand output● CSS Module client-side navigation › should time out and hard navigate for stalled CSS request
Expand output● ReactRefreshLogBox › Module not found
Expand output● Error Overlay for server components compiler errors in pages › importing 'next/headers' in pages ● Error Overlay for server components compiler errors in pages › importing 'next/cache' APIs in pages › revalidatePath is not allowed ● Error Overlay for server components compiler errors in pages › importing 'next/cache' APIs in pages › revalidateTag is not allowed ● Error Overlay for server components compiler errors in pages › importing 'next/cache' APIs in pages › revalidatePath is not allowed
Expand output● tsconfig-path-reloading › tsconfig without baseUrl added after starting dev › should recover from module not found when paths is updated |
Stats from current PR🔴 3 regressions
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: f549afc |
Unflaking some tests, part 1.
Details
Summary
pnpm only honors overrides at the workspace root, so the tarball overrides
createNextInstallwrites into the install dir'spackage.jsonare ignored whenever a fixture creates its ownpnpm-workspace.yamlabove it (pnpm warnsThis will not take effect. You should configure "pnpm.overrides" at the root of the workspace instead). Those installs fetch workspace packages like@next/envfrom the npm registry at the repo's current version, which fails while a canary release is still propagating — this took out 16 CI shards in a single run — and otherwise silently tests published packages instead of the local build.createNextInstallwrites the overrides into thepnpm-workspace.yamlthat governs the install: the fixture's own workspace root when it creates one, otherwise the one the security settings ensure exists in the install dir. The caller-providedresolutionsland there too.pnpm.overridesfield in the generatedpackage.jsonis gone; npm readsoverridesand yarn readsresolutions, which remain.@next/env(a dependency ofnext, so always resolved transitively) came from the packed tarball. A regression now fails every affected test immediately with a clear error instead of only during canary publish windows.ci-missing-typescript-depsdeclared itstypes-react@betaaliases in three places, two of them dead; it now uses theresolutionsoption.Verification
pnpm test-start-turbo test/e2e/app-dir/pnpm-workspace-root/pnpm-workspace-root.test.ts— passes; the install's lockfile resolves@next/envfromfile:(@next+env@file+...in.pnpm) instead of the registry.pnpm test-start-turbo test/production/custom-server/custom-server.test.ts— passes (14/14); standalone install path, same tarball provenance.pnpm test-start-turbo test/production/typescript-paths-baseUrl/typescript-paths-baseUrl-inherited.test.ts— passes (workspace root without apackage.json).pnpm test-start-turbo test/production/ci-missing-typescript-deps/index.test.ts— passes (3/3).@next/env resolved from the npm registry instead of the local tarball.