diff --git a/test/utils.js b/test/utils.js index f811bb18bab..a3e9da98785 100644 --- a/test/utils.js +++ b/test/utils.js @@ -215,7 +215,10 @@ const utils = module.exports = { result: test.result, }); }); - testRunner.on('finished', () => dashboard.uploadAndCleanup()); + testRunner.on('finished', async({result}) => { + dashboard.setBuildResult(result); + await dashboard.uploadAndCleanup(); + }); function generateTestIDs(testRunner) { const testIds = new Map(); diff --git a/utils/flakiness-dashboard/FlakinessDashboard.js b/utils/flakiness-dashboard/FlakinessDashboard.js index 407d8fa9b0a..a9767b3bee6 100644 --- a/utils/flakiness-dashboard/FlakinessDashboard.js +++ b/utils/flakiness-dashboard/FlakinessDashboard.js @@ -48,6 +48,10 @@ class FlakinessDashboard { this._build._tests.push(test); } + setBuildResult(result) { + this._build._result = result; + } + async uploadAndCleanup() { console.log(`\n${YELLOW_COLOR}=== UPLOADING Flakiness Dashboard${RESET_COLOR}`); const startTimestamp = Date.now(); @@ -99,6 +103,7 @@ async function saveBuildToDashboard(dashboardPath, build) { throw new Error('Unrecognized dashboard format!'); data.builds.push({ version: DASHBOARD_VERSION, + result: build._result, timestamp: build._timestamp, url: build._url, commit: build._commit, @@ -115,6 +120,7 @@ class Build { this._url = url; this._commit = commit; this._tests = tests; + this._result = undefined; } }