Skip to content

Commit 8166f3a

Browse files
committed
fixup! test(@angular/build): add library builder scaling benchmark suite
Adressed Geminie Code Review improvements.
1 parent 77f88c6 commit 8166f3a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎scripts/benchmark.mts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ async function runLibraryBuilderSubsystem(
8585
}
8686

8787
const count = parseIntList(options.count);
88-
if (count !== undefined && count.some((n) => !Number.isInteger(n) || n < 1)) {
88+
if (count !== undefined && count.some((n) => !Number.isInteger(n) || n < 1 || n > 5000)) {
8989
// eslint-disable-next-line no-console
9090
console.error(
91-
'Error: --count must be a comma-separated list of positive integers, got "' +
91+
'Error: --count must be a comma-separated list of positive integers up to 5000, got "' +
9292
options.count +
9393
'".',
9494
);
@@ -97,10 +97,10 @@ async function runLibraryBuilderSubsystem(
9797
}
9898

9999
const depth = parseIntList(options.depth);
100-
if (depth !== undefined && depth.some((n) => !Number.isInteger(n) || n < 1)) {
100+
if (depth !== undefined && depth.some((n) => !Number.isInteger(n) || n < 1 || n > 13)) {
101101
// eslint-disable-next-line no-console
102102
console.error(
103-
'Error: --depth must be a comma-separated list of positive integers, got "' +
103+
'Error: --depth must be a comma-separated list of positive integers up to 13, got "' +
104104
options.depth +
105105
'".',
106106
);

‎scripts/benchmarks/library-builder/fixtures.mts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ export function generateFixture(outDir: string, options: FixtureOptions): number
271271
'utf8',
272272
),
273273
).version as string;
274-
peerRange = `^${angularCoreVersion.replace(/\.\d+$/, '')}`;
274+
const match = angularCoreVersion.match(/^(\d+\.\d+)/);
275+
peerRange = match ? '^' + match[1] + '.0' : '^' + angularCoreVersion;
275276
} catch {
276277
// Ignore error, use fallback
277278
}

‎scripts/benchmarks/library-builder/harness.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function buildOnce(
134134
const result = spawnSync(process.execPath, [architectCli, 'lib:build'], {
135135
cwd: projectDir,
136136
stdio: 'pipe',
137-
maxBuffer: Infinity,
137+
maxBuffer: 128 * 1024 * 1024,
138138
env: { ...process.env, NODE_PATH: mergedNodePath },
139139
});
140140
const durationMs = performance.now() - start;

0 commit comments

Comments
 (0)