From aec4dfa02b821b31d8cc84492132601627842825 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 1 Aug 2019 16:40:29 -0700 Subject: [PATCH] chore(flakiness): revert compression for dashboard.json (#4794) Compression wins turned out to be 20KB instead of 200KB as I initially thought. --- .../flakiness-dashboard/FlakinessDashboard.js | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/utils/flakiness-dashboard/FlakinessDashboard.js b/utils/flakiness-dashboard/FlakinessDashboard.js index d0fc035c9b201..908cc4b5d8b5d 100644 --- a/utils/flakiness-dashboard/FlakinessDashboard.js +++ b/utils/flakiness-dashboard/FlakinessDashboard.js @@ -94,29 +94,17 @@ class Dashboard { throw new Error('cannot parse dashboard data: missing "version" field!'); if (data.version > DASHBOARD_VERSION) throw new Error('cannot manage dashboards that are newer then this'); - const builds = data.builds.map(build => new Build(build.ts, build.n, build.u, build.t.map(test => ({ - testId: test.i, - name: test.n, - description: test.d, - url: test.u, - result: test.r, - })))); + const builds = data.builds.map(build => new Build(build.timestamp, build.name, build.url, build.tests)); return new Dashboard(name, dashboardPath, builds, options); } async saveJSON() { const data = { version: DASHBOARD_VERSION }; data.builds = this._builds.map(build => ({ - ts: build._timestamp, - n: build._name, - u: build._url, - t: build._tests.map(test => ({ - i: test.testId, - n: test.name, - d: test.description, - u: test.url, - r: test.result, - })), + timestamp: build._timestamp, + name: build._name, + url: build._url, + tests: build._tests, })); await writeFileAsync(path.join(this._dashboardPath, DASHBOARD_FILENAME), JSON.stringify(data)); }