Skip to content

Commit ce9f5ee

Browse files
committed
fix(bench): flag a failed base suite in the report headline
A base-commit suite failure was only mentioned in the section body, so an otherwise clean comparison still opened with the all-clear line.
1 parent 20b02c4 commit ce9f5ee

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎benchmarks/pr-report.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export function renderReport({ suites = SUITES, base, head, baseSha, headSha, ru
150150
continue;
151151
}
152152
if (baseFailure) {
153+
flagged.push(`⚠️ ${suite} failed on the base commit`);
153154
sections.push(
154155
'⚠️ The suite failed on the base commit, so there is nothing to compare.',
155156
'',

‎benchmarks/pr-report.test.mjs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ test('the report flags regressions and failed pull request suites', () => {
5757
assert.match(body, /void-root lost/);
5858
});
5959

60+
test('a base-commit suite failure is part of the headline', () => {
61+
const ok = suite('bundle-size', [{ name: 'octane-tsrx', ops: { js_gzip: bytes(1000) } }]);
62+
const body = renderReport({
63+
suites: ['js-framework', 'bundle-size'],
64+
base: {
65+
'js-framework': { ...suite('js-framework', []), failed: 'base runner died' },
66+
'bundle-size': ok,
67+
},
68+
head: {
69+
'js-framework': suite('js-framework', [
70+
{ name: 'octane-tsrx', ops: { run: timed(10, 9, 2) } },
71+
]),
72+
'bundle-size': ok,
73+
},
74+
});
75+
assert.match(body, /⚠️ js-framework failed on the base commit/);
76+
assert.match(body, /base runner died/);
77+
assert.doesNotMatch(body, /🟢 No size increases and no timing regressions outside noise\./);
78+
});
79+
6080
test('an unchanged pull request reports no regressions', () => {
6181
const results = {
6282
'bundle-size': suite('bundle-size', [{ name: 'octane-tsrx', ops: { js_gzip: bytes(1000) } }]),

0 commit comments

Comments
 (0)