Skip to content

Commit

Permalink
fix benchmark directory (#73057)
Browse files Browse the repository at this point in the history
### What?

The bench need to run in the correct directory
  • Loading branch information
sokra authored Nov 21, 2024
1 parent d434b4c commit eb86d82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bench/heavy-npm-deps/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const nextConfig = {
},
experimental: {
turbo: {
unstablePersistentCaching: process.env.TURBO_CACHE ? 1 : false,
unstablePersistentCaching: process.env.TURBO_CACHE ? true : false,
},
},
}
Expand Down
19 changes: 12 additions & 7 deletions scripts/devlow-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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(() =>
Expand Down Expand Up @@ -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(() =>
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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) {
Expand Down

0 comments on commit eb86d82

Please sign in to comment.