Skip to content

Commit ba0e547

Browse files
committed
add one more test case
1 parent 9bb96a6 commit ba0e547

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/write.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,30 @@ describe.each(['https://github.com', 'https://github.enterprise.corp'])('writeBe
12891289
`This comment was automatically generated by [workflow](${serverUrl}/user/repo/actions?query=workflow%3AWorkflow%20name) using [github-action-benchmark](https://github.com/marketplace/actions/continuous-benchmark).`,
12901290
],
12911291
},
1292+
{
1293+
it: 'fails when exceeding the threshold - different units',
1294+
config: defaultCfg,
1295+
added: {
1296+
commit: commit('current commit id'),
1297+
date: lastUpdate,
1298+
tool: 'cargo',
1299+
benches: [bench('bench_fib_10', 0.21, '± 0.02', 'us/iter')], // Exceeds 2.0 threshold
1300+
},
1301+
gitServerUrl: serverUrl,
1302+
gitHistory: gitHistory(),
1303+
error: [
1304+
'# :warning: **Performance Alert** :warning:',
1305+
'',
1306+
"Possible performance regression was detected for benchmark **'Test benchmark'**.",
1307+
'Benchmark result of this commit is worse than the previous benchmark result exceeding threshold `2`.',
1308+
'',
1309+
'| Benchmark suite | Current: current commit id | Previous: prev commit id | Ratio |',
1310+
'|-|-|-|-|',
1311+
'| `bench_fib_10` | `210` ns/iter (`± 20`) | `100` ns/iter (`± 20`) | `2.10` |',
1312+
'',
1313+
`This comment was automatically generated by [workflow](${serverUrl}/user/repo/actions?query=workflow%3AWorkflow%20name) using [github-action-benchmark](https://github.com/marketplace/actions/continuous-benchmark).`,
1314+
],
1315+
},
12921316
{
12931317
it: 'sends commit message but does not raise an error when exceeding alert threshold but not exceeding failure threshold',
12941318
config: {

0 commit comments

Comments
 (0)