chore(bench): add Cargo repeat-install scenario to integrated-benchmark (#17132)
* chore(bench): add Cargo repeat-install scenario to integrated-benchmark Add the cargo.repeat-install.hot-cache.hot-store scenario to pnpm-integrated-benchmark and the CI integrated-benchmark workflow to guard Cargo crate slot reuse (pnpm/pnpm#17105). * fix(bench): isolate cargo repeat-install benchmark from parent workspace * fix(bench): connect generated crates in Cargo dependency graph and verify prewarm slots
This commit is contained in:
1 parent
03e864cdc0
commit
ccd3e217e4
13 files changed
+308
-23
No files matched your search
@@ -17,6 +17,7 @@ export const scenarios = [
|
||||
'ISOLATED_FRESH_RESTORE_COLD_CACHE_COLD_STORE_COLD_PNPR',
|
||||
'GVS_FRESH_RESTORE_HOT_CACHE_HOT_STORE',
|
||||
'STORE_ONLY_UNLOCKED_DIRECT_DEPS_COLD_CACHE_HOT_STORE',
|
||||
'CARGO_REPEAT_INSTALL_HOT_CACHE_HOT_STORE',
|
||||
]
|
||||
|
||||
export function compare (report, engine) {
|
||||
@@ -78,7 +79,7 @@ export async function renderComparison (directory) {
|
||||
let failed = false
|
||||
for (const scenario of scenarios) {
|
||||
const report = JSON.parse(await readFile(join(directory, `BENCHMARK_REPORT_${scenario}.json`), 'utf8'))
|
||||
const engines = scenario.includes('PEER_HEAVY') || scenario.includes('LINKED_WORKSPACE') || scenario.includes('INJECTED_WORKSPACE') || scenario.includes('STORE_ONLY') ? ['pacquet'] : ['pacquet', 'pnpr']
|
||||
const engines = scenario.includes('PEER_HEAVY') || scenario.includes('LINKED_WORKSPACE') || scenario.includes('INJECTED_WORKSPACE') || scenario.includes('STORE_ONLY') || scenario.startsWith('CARGO_') ? ['pacquet'] : ['pacquet', 'pnpr']
|
||||
for (const engine of engines) {
|
||||
const result = compareConfirmed(report, engine)
|
||||
failed ||= result.status === 'Regression'
|
||||
|
||||
@@ -73,7 +73,7 @@ test('all scenarios and both engines are checked, and missing reports fail', asy
|
||||
try {
|
||||
for (const scenario of scenarios) {
|
||||
const input = report(stable, stable)
|
||||
if (!scenario.includes('PEER_HEAVY') && !scenario.includes('LINKED_WORKSPACE') && !scenario.includes('INJECTED_WORKSPACE') && !scenario.includes('STORE_ONLY')) {
|
||||
if (!scenario.includes('PEER_HEAVY') && !scenario.includes('LINKED_WORKSPACE') && !scenario.includes('INJECTED_WORKSPACE') && !scenario.includes('STORE_ONLY') && !scenario.startsWith('CARGO_')) {
|
||||
input.results.push(command('pnpr@HEAD', Array(10).fill(1.4)), command('pnpr@main', stable))
|
||||
}
|
||||
input.confirmation = { results: input.results }
|
||||
@@ -82,7 +82,7 @@ test('all scenarios and both engines are checked, and missing reports fail', asy
|
||||
const result = await renderComparison(directory)
|
||||
assert.equal(result.failed, true)
|
||||
assert.equal(result.markdown.match(/\| Regression \|/g).length, 10)
|
||||
assert.equal(result.markdown.match(/\| Within tolerance \|/g).length, 14)
|
||||
assert.equal(result.markdown.match(/\| Within tolerance \|/g).length, 15)
|
||||
const cli = new URL('./compare-integrated-benchmarks.mjs', import.meta.url)
|
||||
const run = spawnSync(process.execPath, [fileURLToPath(cli), directory], { encoding: 'utf8' })
|
||||
assert.equal(run.status, 1)
|
||||
|
||||
Reference in new issue
Block a user