0
0
mirror of https://github.com/puppeteer/puppeteer synced 2024-06-14 14:02:48 +00:00

chore(flaky): save build result ()

This commit is contained in:
Andrey Lushnikov 2019-08-08 20:53:12 -07:00 committed by GitHub
parent 608b15f20d
commit 763e3901d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions
test
utils/flakiness-dashboard

View File

@ -215,7 +215,10 @@ const utils = module.exports = {
result: test.result, result: test.result,
}); });
}); });
testRunner.on('finished', () => dashboard.uploadAndCleanup()); testRunner.on('finished', async({result}) => {
dashboard.setBuildResult(result);
await dashboard.uploadAndCleanup();
});
function generateTestIDs(testRunner) { function generateTestIDs(testRunner) {
const testIds = new Map(); const testIds = new Map();

View File

@ -48,6 +48,10 @@ class FlakinessDashboard {
this._build._tests.push(test); this._build._tests.push(test);
} }
setBuildResult(result) {
this._build._result = result;
}
async uploadAndCleanup() { async uploadAndCleanup() {
console.log(`\n${YELLOW_COLOR}=== UPLOADING Flakiness Dashboard${RESET_COLOR}`); console.log(`\n${YELLOW_COLOR}=== UPLOADING Flakiness Dashboard${RESET_COLOR}`);
const startTimestamp = Date.now(); const startTimestamp = Date.now();
@ -99,6 +103,7 @@ async function saveBuildToDashboard(dashboardPath, build) {
throw new Error('Unrecognized dashboard format!'); throw new Error('Unrecognized dashboard format!');
data.builds.push({ data.builds.push({
version: DASHBOARD_VERSION, version: DASHBOARD_VERSION,
result: build._result,
timestamp: build._timestamp, timestamp: build._timestamp,
url: build._url, url: build._url,
commit: build._commit, commit: build._commit,
@ -115,6 +120,7 @@ class Build {
this._url = url; this._url = url;
this._commit = commit; this._commit = commit;
this._tests = tests; this._tests = tests;
this._result = undefined;
} }
} }