Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions benchmarkFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,12 @@ export default async function benchmark (pm, fixture, opts) {
if (err?.code !== 'ENOENT') throw err
}
}
// The cache dir may not exist right now: it was deleted two rows up, and
// a manager whose `node_modules` row is a registry-free no-op (pnpm
// restores the tree from the lockfile copy inside it) never recreated
// it. A symlink to a path that isn't there is dangling, and the warm-up
// install fails trying to mkdir its store through it.
await fs.mkdir(path.join(cwd, 'cache'), { recursive: true })
await fs.symlink(path.join(cwd, 'cache'), path.join(rewarmDir, 'cache'), 'dir')
measureInstall(pm, rewarmDir, env)
} finally {
Expand Down
13 changes: 12 additions & 1 deletion mergeResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ async function main () {
if (!samplesDir) {
throw new Error('Usage: node mergeResults.js <dir containing one subdirectory per run>')
}
const runDirs = fs.readdirSync(samplesDir, { withFileTypes: true })
// A samples directory that doesn't exist means no measuring job uploaded
// anything — every one of them failed. That is the same situation as an
// empty directory, and it deserves the same explanation rather than a raw
// ENOENT from `readdirSync`.
let entries
try {
entries = fs.readdirSync(samplesDir, { withFileTypes: true })
} catch (err) {
if (err.code !== 'ENOENT') throw err
entries = []
}
const runDirs = entries
.filter((entry) => entry.isDirectory())
// Sorted so that a merge of the same runs always produces the same file,
// whatever order the artifacts happened to be downloaded in.
Expand Down