From 4dd26753d9b1e26203471dca9b9b85d933ec474b Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:21:34 -0700 Subject: [PATCH] fix deploy tests that patch node_modules (#66849) `node_modules` gets ignored when deployed unless explicitly allowed, and the regular install command will clobber what was in there. This allowlists the `node_modules` directory and copies it into a new folder, runs the install command, and then merges the patched `node_modules` in so the patched modules are available in the test. --- test/deploy-tests-manifest.json | 5 ----- test/e2e/app-dir/app-routes-client-component/.vercelignore | 1 + test/e2e/app-dir/app-routes-client-component/vercel.json | 4 ++++ test/e2e/app-dir/scss/nm-module-nested/.vercelignore | 1 + test/e2e/app-dir/scss/nm-module-nested/vercel.json | 4 ++++ test/e2e/app-dir/scss/nm-module/.vercelignore | 1 + test/e2e/app-dir/scss/nm-module/vercel.json | 4 ++++ test/e2e/app-dir/scss/npm-import-nested/.vercelignore | 1 + test/e2e/app-dir/scss/npm-import-nested/vercel.json | 4 ++++ test/e2e/esm-externals/.vercelignore | 1 + test/e2e/esm-externals/vercel.json | 4 ++++ 11 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 test/e2e/app-dir/app-routes-client-component/.vercelignore create mode 100644 test/e2e/app-dir/app-routes-client-component/vercel.json create mode 100644 test/e2e/app-dir/scss/nm-module-nested/.vercelignore create mode 100644 test/e2e/app-dir/scss/nm-module-nested/vercel.json create mode 100644 test/e2e/app-dir/scss/nm-module/.vercelignore create mode 100644 test/e2e/app-dir/scss/nm-module/vercel.json create mode 100644 test/e2e/app-dir/scss/npm-import-nested/.vercelignore create mode 100644 test/e2e/app-dir/scss/npm-import-nested/vercel.json create mode 100644 test/e2e/esm-externals/.vercelignore create mode 100644 test/e2e/esm-externals/vercel.json diff --git a/test/deploy-tests-manifest.json b/test/deploy-tests-manifest.json index 1a9621c2cf..2dee0ec2e2 100644 --- a/test/deploy-tests-manifest.json +++ b/test/deploy-tests-manifest.json @@ -24,7 +24,6 @@ "test/production/**/*.test.{t,j}s{,x}" ], "exclude": [ - "test/e2e/app-dir/scss/nm-module-nested/nm-module-nested.test.ts", "test/e2e/cancel-request/stream-cancel.test.ts", "test/e2e/new-link-behavior/material-ui.test.ts", "test/e2e/react-dnd-compile/react-dnd-compile.test.ts", @@ -33,17 +32,14 @@ "test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts", "test/e2e/swc-warnings/index.test.ts", "test/e2e/third-parties/index.test.ts", - "test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts", "test/e2e/app-dir/app-routes/app-custom-route-base-path.test.ts", "test/e2e/app-dir/mdx/mdx.test.ts", "test/e2e/app-dir/modularizeimports/modularizeimports.test.ts", "test/e2e/app-dir/third-parties/basic.test.ts", - "test/e2e/esm-externals/esm-externals.test.ts", "test/e2e/app-dir/actions-navigation/index.test.ts", "test/e2e/app-dir/app-static/app-static-custom-handler.test.ts", "test/e2e/app-dir/options-request/options-request.test.ts", "test/e2e/app-dir/revalidate-dynamic/revalidate-dynamic.test.ts", - "test/e2e/app-dir/scss/npm-import-nested/npm-import-nested.test.ts", "test/e2e/app-dir/syntax-highlighter-crash/syntax-highlighter-crash.test.ts", "test/e2e/new-link-behavior/stitches.test.ts", "test/e2e/next-image-forward-ref/index.test.ts", @@ -51,7 +47,6 @@ "test/e2e/app-dir/i18n-hybrid/i18n-hybrid.test.js", "test/e2e/app-dir/metadata/metadata.test.ts", "test/e2e/app-dir/rsc-basic/rsc-basic.test.ts", - "test/e2e/app-dir/scss/nm-module/nm-module.test.ts", "test/e2e/basepath.test.ts", "test/e2e/postcss-config-cjs/index.test.ts", "test/e2e/socket-io/index.test.js", diff --git a/test/e2e/app-dir/app-routes-client-component/.vercelignore b/test/e2e/app-dir/app-routes-client-component/.vercelignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/test/e2e/app-dir/app-routes-client-component/.vercelignore @@ -0,0 +1 @@ +!node_modules diff --git a/test/e2e/app-dir/app-routes-client-component/vercel.json b/test/e2e/app-dir/app-routes-client-component/vercel.json new file mode 100644 index 0000000000..732514f973 --- /dev/null +++ b/test/e2e/app-dir/app-routes-client-component/vercel.json @@ -0,0 +1,4 @@ +{ + "installCommand": "mv node_modules node_modules.bak && npm i", + "buildCommand": "cp -r node_modules.bak/* node_modules && npm run build" +} diff --git a/test/e2e/app-dir/scss/nm-module-nested/.vercelignore b/test/e2e/app-dir/scss/nm-module-nested/.vercelignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/test/e2e/app-dir/scss/nm-module-nested/.vercelignore @@ -0,0 +1 @@ +!node_modules diff --git a/test/e2e/app-dir/scss/nm-module-nested/vercel.json b/test/e2e/app-dir/scss/nm-module-nested/vercel.json new file mode 100644 index 0000000000..732514f973 --- /dev/null +++ b/test/e2e/app-dir/scss/nm-module-nested/vercel.json @@ -0,0 +1,4 @@ +{ + "installCommand": "mv node_modules node_modules.bak && npm i", + "buildCommand": "cp -r node_modules.bak/* node_modules && npm run build" +} diff --git a/test/e2e/app-dir/scss/nm-module/.vercelignore b/test/e2e/app-dir/scss/nm-module/.vercelignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/test/e2e/app-dir/scss/nm-module/.vercelignore @@ -0,0 +1 @@ +!node_modules diff --git a/test/e2e/app-dir/scss/nm-module/vercel.json b/test/e2e/app-dir/scss/nm-module/vercel.json new file mode 100644 index 0000000000..732514f973 --- /dev/null +++ b/test/e2e/app-dir/scss/nm-module/vercel.json @@ -0,0 +1,4 @@ +{ + "installCommand": "mv node_modules node_modules.bak && npm i", + "buildCommand": "cp -r node_modules.bak/* node_modules && npm run build" +} diff --git a/test/e2e/app-dir/scss/npm-import-nested/.vercelignore b/test/e2e/app-dir/scss/npm-import-nested/.vercelignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/test/e2e/app-dir/scss/npm-import-nested/.vercelignore @@ -0,0 +1 @@ +!node_modules diff --git a/test/e2e/app-dir/scss/npm-import-nested/vercel.json b/test/e2e/app-dir/scss/npm-import-nested/vercel.json new file mode 100644 index 0000000000..732514f973 --- /dev/null +++ b/test/e2e/app-dir/scss/npm-import-nested/vercel.json @@ -0,0 +1,4 @@ +{ + "installCommand": "mv node_modules node_modules.bak && npm i", + "buildCommand": "cp -r node_modules.bak/* node_modules && npm run build" +} diff --git a/test/e2e/esm-externals/.vercelignore b/test/e2e/esm-externals/.vercelignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/test/e2e/esm-externals/.vercelignore @@ -0,0 +1 @@ +!node_modules diff --git a/test/e2e/esm-externals/vercel.json b/test/e2e/esm-externals/vercel.json new file mode 100644 index 0000000000..732514f973 --- /dev/null +++ b/test/e2e/esm-externals/vercel.json @@ -0,0 +1,4 @@ +{ + "installCommand": "mv node_modules node_modules.bak && npm i", + "buildCommand": "cp -r node_modules.bak/* node_modules && npm run build" +}