Skip to content

Commit

Permalink
chore(flakiness): limit max builds to 100 (puppeteer#4818)
Browse files Browse the repository at this point in the history
This was missing in puppeteer#4808
  • Loading branch information
aslushnikov authored Aug 8, 2019
1 parent f753ec6 commit 608b15f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/flakiness-dashboard/FlakinessDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const RESET_COLOR = '\x1b[0m';

const DASHBOARD_VERSION = 1;
const DASHBOARD_FILENAME = 'dashboard.json';
const DASHBOARD_MAX_BUILDS = 100;

class FlakinessDashboard {
static async getCommitDetails(repoPath, ref = 'HEAD') {
Expand Down Expand Up @@ -103,6 +104,8 @@ async function saveBuildToDashboard(dashboardPath, build) {
commit: build._commit,
tests: build._tests,
});
if (data.builds.length > DASHBOARD_MAX_BUILDS)
data.builds = data.builds.slice(data.builds.length - DASHBOARD_MAX_BUILDS);
await writeFileAsync(filePath, JSON.stringify(data));
}

Expand Down

0 comments on commit 608b15f

Please sign in to comment.