From eb86d82e93fa39f670161e99cb1c1a33f19afd98 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 21 Nov 2024 19:41:49 +0100 Subject: [PATCH] fix benchmark directory (#73057) ### What? The bench need to run in the correct directory --- bench/heavy-npm-deps/next.config.mjs | 2 +- scripts/devlow-bench.mjs | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/bench/heavy-npm-deps/next.config.mjs b/bench/heavy-npm-deps/next.config.mjs index 02ab1381cc78b..ca1dc40a4b212 100644 --- a/bench/heavy-npm-deps/next.config.mjs +++ b/bench/heavy-npm-deps/next.config.mjs @@ -8,7 +8,7 @@ const nextConfig = { }, experimental: { turbo: { - unstablePersistentCaching: process.env.TURBO_CACHE ? 1 : false, + unstablePersistentCaching: process.env.TURBO_CACHE ? true : false, }, }, } diff --git a/scripts/devlow-bench.mjs b/scripts/devlow-bench.mjs index 04b71fce0ebb8..dab474e59fc7c 100644 --- a/scripts/devlow-bench.mjs +++ b/scripts/devlow-bench.mjs @@ -26,7 +26,7 @@ const GIT_BRANCH = })()) const nextBuildWorkflow = - (benchmarkName, pages, enableTurbopackCache) => + (benchmarkName, benchDir, pages, enableTurbopackCache) => async ({ turbopack, page }) => { const pageConfig = typeof pages[page] === 'string' ? { url: pages[page] } : pages[page] @@ -47,7 +47,7 @@ const nextBuildWorkflow = __NEXT_TEST_MODE: '1', } - const benchmarkDir = resolve(REPO_ROOT, 'bench', benchmarkName) + const benchmarkDir = resolve(REPO_ROOT, 'bench', benchDir) // cleanup .next directory to remove persistent cache await retry(() => @@ -233,13 +233,13 @@ const nextBuildWorkflow = } const nextDevWorkflow = - (benchmarkName, pages) => + (benchmarkName, benchDir, pages) => async ({ turbopack, page }) => { const pageConfig = typeof pages[page] === 'string' ? { url: pages[page] } : pages[page] const cleanupTasks = [] try { - const benchmarkDir = resolve(REPO_ROOT, 'bench', benchmarkName) + const benchmarkDir = resolve(REPO_ROOT, 'bench', benchDir) // cleanup .next directory to remove persistent cache await retry(() => @@ -565,7 +565,7 @@ describe( mode: 'dev', page: Object.keys(pages), }, - nextDevWorkflow('heavy-npm-deps', pages) + nextDevWorkflow('heavy-npm-deps', 'heavy-npm-deps', pages) ) describe( @@ -575,7 +575,7 @@ describe( mode: 'build', page: Object.keys(pages), }, - nextBuildWorkflow('heavy-npm-deps', pages, false) + nextBuildWorkflow('heavy-npm-deps', 'heavy-npm-deps', pages, false) ) describe( @@ -585,7 +585,12 @@ describe( mode: 'build', page: Object.keys(pages), }, - nextBuildWorkflow('heavy-npm-deps-build-turbo-cache-enabled', pages, true) + nextBuildWorkflow( + 'heavy-npm-deps-build-turbo-cache-enabled', + 'heavy-npm-deps', + pages, + true + ) ) async function retry(fn) {