Unverified Commit a2556196 authored by Balázs Orbán's avatar Balázs Orbán Committed by GitHub

refactor(test): switch tests to use `pnpm` in more places (#63196)

parent d95bc960
...@@ -164,7 +164,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => { ...@@ -164,7 +164,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
}) })
// TODO: investigate why this fails when running outside of the Next.js // TODO: investigate why this fails when running outside of the Next.js
// monorepo e.g. fails when using yarn create next-app // monorepo e.g. fails when using pnpm create next-app
// https://github.com/vercel/next.js/pull/23203 // https://github.com/vercel/next.js/pull/23203
test.skip('internal package errors', async () => { test.skip('internal package errors', async () => {
const { session, cleanup } = await sandbox(next) const { session, cleanup } = await sandbox(next)
......
...@@ -151,7 +151,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { ...@@ -151,7 +151,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
}) })
// TODO: investigate why this fails when running outside of the Next.js // TODO: investigate why this fails when running outside of the Next.js
// monorepo e.g. fails when using yarn create next-app // monorepo e.g. fails when using pnpm create next-app
// https://github.com/vercel/next.js/pull/23203 // https://github.com/vercel/next.js/pull/23203
test.skip('internal package errors', async () => { test.skip('internal package errors', async () => {
const { session, cleanup } = await sandbox(next) const { session, cleanup } = await sandbox(next)
......
...@@ -6,7 +6,7 @@ createNextDescribe( ...@@ -6,7 +6,7 @@ createNextDescribe(
'experimental-https-server (generated certificate)', 'experimental-https-server (generated certificate)',
{ {
files: __dirname, files: __dirname,
startCommand: `yarn next ${ startCommand: `pnpm next ${
shouldRunTurboDevTest() ? 'dev --turbo' : 'dev' shouldRunTurboDevTest() ? 'dev --turbo' : 'dev'
} --experimental-https`, } --experimental-https`,
skipStart: !process.env.CI, skipStart: !process.env.CI,
......
...@@ -6,7 +6,7 @@ createNextDescribe( ...@@ -6,7 +6,7 @@ createNextDescribe(
'experimental-https-server (provided certificate)', 'experimental-https-server (provided certificate)',
{ {
files: __dirname, files: __dirname,
startCommand: `yarn next ${ startCommand: `pnpm next ${
shouldRunTurboDevTest() ? 'dev --turbo' : 'dev' shouldRunTurboDevTest() ? 'dev --turbo' : 'dev'
} --experimental-https --experimental-https-key ./certificates/localhost-key.pem --experimental-https-cert ./certificates/localhost.pem`, } --experimental-https --experimental-https-key ./certificates/localhost-key.pem --experimental-https-cert ./certificates/localhost.pem`,
}, },
......
...@@ -5,7 +5,7 @@ createNextDescribe( ...@@ -5,7 +5,7 @@ createNextDescribe(
{ {
files: __dirname, files: __dirname,
skipDeployment: true, skipDeployment: true,
startCommand: `yarn next dev --experimental-https`, startCommand: `pnpm next dev --experimental-https`,
}, },
({ next }) => { ({ next }) => {
if (!process.env.CI) { if (!process.env.CI) {
......
...@@ -12,7 +12,7 @@ createNextDescribe( ...@@ -12,7 +12,7 @@ createNextDescribe(
packageJson: { packageJson: {
scripts: { scripts: {
dev: 'node server.js', dev: 'node server.js',
build: 'yarn next build apps/host && yarn next build apps/guest', build: 'next build apps/host && next build apps/guest',
start: 'NODE_ENV=production node server.js', start: 'NODE_ENV=production node server.js',
'post-build': 'echo done', 'post-build': 'echo done',
}, },
......
...@@ -8,8 +8,8 @@ createNextDescribe( ...@@ -8,8 +8,8 @@ createNextDescribe(
skipDeployment: true, skipDeployment: true,
dependencies: require('./package.json').dependencies, dependencies: require('./package.json').dependencies,
startCommand: (global as any).isNextDev startCommand: (global as any).isNextDev
? 'yarn next dev --experimental-test-proxy' ? 'pnpm next dev --experimental-test-proxy'
: 'yarn next start --experimental-test-proxy', : 'pnpm next start --experimental-test-proxy',
}, },
({ next, isNextDev }) => { ({ next, isNextDev }) => {
let proxyServer: Awaited<ReturnType<typeof createProxyServer>> let proxyServer: Awaited<ReturnType<typeof createProxyServer>>
......
{ {
"scripts": { "scripts": {
"dev": "yarn next dev", "dev": "next dev",
"build": "yarn next build", "build": "next build",
"start": "yarn next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"react": "*", "react": "*",
......
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "yarn next dev", "dev": "next dev",
"build": "yarn next build", "build": "next build",
"start": "yarn next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"moment": "*" "moment": "*"
......
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "yarn next dev", "dev": "next dev",
"build": "yarn next build", "build": "next build",
"start": "yarn next start" "start": "next start"
} }
} }
...@@ -26,7 +26,7 @@ const runTests = (project) => { ...@@ -26,7 +26,7 @@ const runTests = (project) => {
const runRelayCompiler = () => { const runRelayCompiler = () => {
// Relay expects the current directory to contain a relay.json // Relay expects the current directory to contain a relay.json
// This ensures the CWD is the one with relay.json since running // This ensures the CWD is the one with relay.json since running
// the relay-compiler through yarn would make the root of the repo the CWD. // the relay-compiler through pnpm would make the root of the repo the CWD.
execSync('../../../node_modules/relay-compiler/cli.js', { execSync('../../../node_modules/relay-compiler/cli.js', {
cwd: './test/integration/relay-graphql-swc-multi-project', cwd: './test/integration/relay-graphql-swc-multi-project',
}) })
......
...@@ -24,7 +24,7 @@ const runTests = () => { ...@@ -24,7 +24,7 @@ const runTests = () => {
const runRelayCompiler = () => { const runRelayCompiler = () => {
// Relay expects the current directory to contain a relay.json // Relay expects the current directory to contain a relay.json
// This ensures the CWD is the one with relay.json since running // This ensures the CWD is the one with relay.json since running
// the relay-compiler through yarn would make the root of the repo the CWD. // the relay-compiler through pnpm would make the root of the repo the CWD.
execSync('../../../node_modules/relay-compiler/cli.js', { execSync('../../../node_modules/relay-compiler/cli.js', {
cwd: './test/integration/relay-graphql-swc-single-project', cwd: './test/integration/relay-graphql-swc-single-project',
}) })
......
...@@ -10,7 +10,7 @@ import { shouldRunTurboDevTest } from './next-test-utils' ...@@ -10,7 +10,7 @@ import { shouldRunTurboDevTest } from './next-test-utils'
export type { NextInstance } export type { NextInstance }
// increase timeout to account for yarn install time // increase timeout to account for pnpm install time
// if either test runs for the --turbo or have a custom timeout, set reduced timeout instead. // if either test runs for the --turbo or have a custom timeout, set reduced timeout instead.
// this is due to current --turbo test have a lot of tests fails with timeouts, ends up the whole // this is due to current --turbo test have a lot of tests fails with timeouts, ends up the whole
// test job exceeds the 6 hours limit. // test job exceeds the 6 hours limit.
......
...@@ -29,7 +29,7 @@ export class NextDevInstance extends NextInstance { ...@@ -29,7 +29,7 @@ export class NextDevInstance extends NextInstance {
((this as any).turbo || (this as any).experimentalTurbo) ((this as any).turbo || (this as any).experimentalTurbo)
let startArgs = [ let startArgs = [
'yarn', 'pnpm',
'next', 'next',
useTurbo ? getTurbopackFlag() : undefined, useTurbo ? getTurbopackFlag() : undefined,
useDirArg && this.testDir, useDirArg && this.testDir,
......
...@@ -55,8 +55,8 @@ export class NextStartInstance extends NextInstance { ...@@ -55,8 +55,8 @@ export class NextStartInstance extends NextInstance {
}, },
} }
let buildArgs = ['yarn', 'next', 'build'] let buildArgs = ['pnpm', 'next', 'build']
let startArgs = ['yarn', 'next', 'start'] let startArgs = ['pnpm', 'next', 'start']
if (this.buildCommand) { if (this.buildCommand) {
buildArgs = this.buildCommand.split(' ') buildArgs = this.buildCommand.split(' ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment