chore: enable turbopack by default in monorepo (#12684)
No issues with turbopack reported so far, let's enable it by default in our monorepo. The `--turbo` flag for our package.json `dev` and `test:e2e` scripts has been replaced with an opt-out `--no-turbo` flag
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -364,7 +364,7 @@ jobs:
|
||||
run: pnpm exec playwright install-deps chromium
|
||||
|
||||
- name: E2E Tests
|
||||
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci ${{ matrix.suite }}
|
||||
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci:noturbo ${{ matrix.suite }}
|
||||
env:
|
||||
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
|
||||
NEXT_TELEMETRY_DISABLED: 1
|
||||
@@ -500,7 +500,7 @@ jobs:
|
||||
run: pnpm exec playwright install-deps chromium
|
||||
|
||||
- name: E2E Tests
|
||||
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci:turbo ${{ matrix.suite }}
|
||||
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci ${{ matrix.suite }}
|
||||
env:
|
||||
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
|
||||
NEXT_TELEMETRY_DISABLED: 1
|
||||
|
||||
@@ -98,10 +98,10 @@
|
||||
"test:e2e": "pnpm runts ./test/runE2E.ts",
|
||||
"test:e2e:debug": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 PWDEBUG=1 DISABLE_LOGGING=true playwright test",
|
||||
"test:e2e:headed": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true playwright test --headed",
|
||||
"test:e2e:noturbo": "pnpm runts ./test/runE2E.ts --no-turbo",
|
||||
"test:e2e:prod": "pnpm prepare-run-test-against-prod && pnpm runts ./test/runE2E.ts --prod",
|
||||
"test:e2e:prod:ci": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod",
|
||||
"test:e2e:prod:ci:turbo": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod --turbo",
|
||||
"test:e2e:turbo": "pnpm runts ./test/runE2E.ts --turbo",
|
||||
"test:e2e:prod:ci:noturbo": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod --no-turbo",
|
||||
"test:int": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
|
||||
"test:int:postgres": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
|
||||
"test:int:sqlite": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=sqlite DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
|
||||
|
||||
@@ -55,9 +55,12 @@ if (!testSuiteArg || !fs.existsSync(path.resolve(dirname, testSuiteArg))) {
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
console.log(`Selected test suite: ${testSuiteArg}`)
|
||||
// Enable turbopack by default, unless --no-turbo is passed
|
||||
const enableTurbo = args.turbo !== false
|
||||
|
||||
if (args.turbo === true) {
|
||||
console.log(`Selected test suite: ${testSuiteArg}${enableTurbo ? ' [Turbopack]' : ' [Webpack]'}`)
|
||||
|
||||
if (enableTurbo) {
|
||||
process.env.TURBOPACK = '1'
|
||||
}
|
||||
|
||||
@@ -111,6 +114,8 @@ const app = nextImport({
|
||||
hostname: 'localhost',
|
||||
port: availablePort,
|
||||
dir: rootDir,
|
||||
turbo: enableTurbo,
|
||||
turbopack: enableTurbo,
|
||||
})
|
||||
|
||||
const handle = app.getRequestHandler()
|
||||
|
||||
@@ -20,9 +20,9 @@ if (prod) {
|
||||
shelljs.env.PAYLOAD_TEST_PROD = 'true'
|
||||
}
|
||||
|
||||
const turbo = process.argv.includes('--turbo')
|
||||
const turbo = process.argv.includes('--no-turbo') ? false : true
|
||||
|
||||
process.argv = process.argv.filter((arg) => arg !== '--prod' && arg !== '--turbo')
|
||||
process.argv = process.argv.filter((arg) => arg !== '--prod' && arg !== '--no-turbo')
|
||||
|
||||
const playwrightBin = path.resolve(dirname, '../node_modules/.bin/playwright')
|
||||
|
||||
@@ -125,8 +125,8 @@ function executePlaywright(
|
||||
spawnDevArgs.push('--prod')
|
||||
}
|
||||
|
||||
if (turbo) {
|
||||
spawnDevArgs.push('--turbo')
|
||||
if (!turbo) {
|
||||
spawnDevArgs.push('--no-turbo')
|
||||
}
|
||||
|
||||
process.env.START_MEMORY_DB = 'true'
|
||||
|
||||
Reference in New Issue
Block a user