Skip to content

Commit e5ad374

Browse files
committed
Improve Reassure workflows to reduce flakiness
1 parent fceaa45 commit e5ad374

4 files changed

Lines changed: 37 additions & 8 deletions

File tree

.github/actions/javascript/validateReassureOutput/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ inputs:
77
ALLOWED_RELATIVE_DURATION_DEVIATION:
88
description: Allowable percentage deviation for the mean duration in regression test results.
99
required: true
10+
IS_VALIDATING_STABILITY:
11+
description: Whether the workflow is validating a Reassure stability check or not.
12+
required: true
1013
runs:
1114
using: 'node20'
1215
main: './index.js'

.github/actions/javascript/validateReassureOutput/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24972,6 +24972,7 @@ function run() {
2497224972
const regressionOutput = JSON.parse(fs_1.default.readFileSync('.reassure/output.json', 'utf8'));
2497324973
const allowedDurationDeviation = Number(core.getInput('ALLOWED_DURATION_DEVIATION', { required: true }));
2497424974
const durationDeviationPercentage = Number(core.getInput('ALLOWED_RELATIVE_DURATION_DEVIATION', { required: true }));
24975+
const isValidatingStability = Boolean(core.getInput('IS_VALIDATING_STABILITY', { required: true }));
2497524976
if (regressionOutput.significant === undefined || regressionOutput.significant.length === 0) {
2497624977
console.log('No significant data available. Exiting...');
2497724978
return true;
@@ -25018,7 +25019,14 @@ function run() {
2501825019
});
2501925020
const shouldFailWorkflow = outputs.some((output) => output.isDeviationExceeded);
2502025021
if (shouldFailWorkflow) {
25021-
core.setFailed(`🔴 Duration deviation exceeded the allowed ranges in one or more measurements.`);
25022+
if (isValidatingStability) {
25023+
core.setFailed(`🔴 Duration deviation exceeded the allowed ranges in one or more measurements during the stability checks.
25024+
Please rerun the workflow again.
25025+
`);
25026+
}
25027+
else {
25028+
core.setFailed(`🔴 Duration deviation exceeded the allowed ranges in one or more measurements.`);
25029+
}
2502225030
}
2502325031
return true;
2502425032
}

.github/actions/javascript/validateReassureOutput/validateReassureOutput.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ async function run() {
1919
const regressionOutput: CompareResult = JSON.parse(fs.readFileSync('.reassure/output.json', 'utf8'));
2020
const allowedDurationDeviation = Number(core.getInput('ALLOWED_DURATION_DEVIATION', {required: true}));
2121
const durationDeviationPercentage = Number(core.getInput('ALLOWED_RELATIVE_DURATION_DEVIATION', {required: true}));
22+
const isValidatingStability = Boolean(core.getInput('IS_VALIDATING_STABILITY', {required: true}));
2223

2324
if (regressionOutput.significant === undefined || regressionOutput.significant.length === 0) {
2425
console.log('No significant data available. Exiting...');
@@ -77,7 +78,15 @@ async function run() {
7778

7879
const shouldFailWorkflow = outputs.some((output) => output.isDeviationExceeded);
7980
if (shouldFailWorkflow) {
80-
core.setFailed(`🔴 Duration deviation exceeded the allowed ranges in one or more measurements.`);
81+
if (isValidatingStability) {
82+
core.setFailed(
83+
`🔴 Duration deviation exceeded the allowed ranges in one or more measurements during the stability checks.
84+
Please rerun the workflow again.
85+
`,
86+
);
87+
} else {
88+
core.setFailed(`🔴 Duration deviation exceeded the allowed ranges in one or more measurements.`);
89+
}
8190
}
8291

8392
return true;

.github/workflows/reassurePerfTests.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,26 @@ jobs:
2525
node-version-file: '.nvmrc'
2626

2727
- name: Install dependencies
28-
run: npm install
28+
run: npm ci
2929

30-
- name: Run Reassure baseline tests
31-
run: npx reassure --baseline --verbose
30+
- name: Reassure stability check
31+
run: npx reassure check-stability --verbose
32+
33+
- name: Validate Reassure stability results
34+
id: validateReassureStabilityResults
35+
uses: ./.github/actions/javascript/validateReassureOutput
36+
with:
37+
ALLOWED_DURATION_DEVIATION: 10
38+
ALLOWED_RELATIVE_DURATION_DEVIATION: 20
39+
IS_VALIDATING_STABILITY: true
3240

3341
- name: Checkout PR head SHA
3442
run: |
3543
git fetch origin ${{ github.event.pull_request.head.sha }} --no-tags --depth=1
3644
git switch --force --detach ${{ github.event.pull_request.head.sha }}
3745
3846
- name: Reinstall dependencies
39-
run: npm install --force
47+
run: npm ci
4048

4149
- name: Run Reassure delta tests
4250
run: npx reassure --branch --verbose
@@ -49,9 +57,10 @@ jobs:
4957
if-no-files-found: ignore
5058
include-hidden-files: true
5159

52-
- name: Validate output.json
53-
id: validateReassureOutput
60+
- name: Validate Reassure results
61+
id: validateReassureResults
5462
uses: ./.github/actions/javascript/validateReassureOutput
5563
with:
5664
ALLOWED_DURATION_DEVIATION: 10
5765
ALLOWED_RELATIVE_DURATION_DEVIATION: 20
66+
IS_VALIDATING_STABILITY: false

0 commit comments

Comments
 (0)