chore(flakiness): revert compression for dashboard.json (#4794)
Compression wins turned out to be 20KB instead of 200KB as I initially thought.
This commit is contained in:
parent
5c7c45f0aa
commit
f733c334dc
@ -94,29 +94,17 @@ class Dashboard {
|
|||||||
throw new Error('cannot parse dashboard data: missing "version" field!');
|
throw new Error('cannot parse dashboard data: missing "version" field!');
|
||||||
if (data.version > DASHBOARD_VERSION)
|
if (data.version > DASHBOARD_VERSION)
|
||||||
throw new Error('cannot manage dashboards that are newer then this');
|
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 => ({
|
const builds = data.builds.map(build => new Build(build.timestamp, build.name, build.url, build.tests));
|
||||||
testId: test.i,
|
|
||||||
name: test.n,
|
|
||||||
description: test.d,
|
|
||||||
url: test.u,
|
|
||||||
result: test.r,
|
|
||||||
}))));
|
|
||||||
return new Dashboard(name, dashboardPath, builds, options);
|
return new Dashboard(name, dashboardPath, builds, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveJSON() {
|
async saveJSON() {
|
||||||
const data = { version: DASHBOARD_VERSION };
|
const data = { version: DASHBOARD_VERSION };
|
||||||
data.builds = this._builds.map(build => ({
|
data.builds = this._builds.map(build => ({
|
||||||
ts: build._timestamp,
|
timestamp: build._timestamp,
|
||||||
n: build._name,
|
name: build._name,
|
||||||
u: build._url,
|
url: build._url,
|
||||||
t: build._tests.map(test => ({
|
tests: build._tests,
|
||||||
i: test.testId,
|
|
||||||
n: test.name,
|
|
||||||
d: test.description,
|
|
||||||
u: test.url,
|
|
||||||
r: test.result,
|
|
||||||
})),
|
|
||||||
}));
|
}));
|
||||||
await writeFileAsync(path.join(this._dashboardPath, DASHBOARD_FILENAME), JSON.stringify(data));
|
await writeFileAsync(path.join(this._dashboardPath, DASHBOARD_FILENAME), JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user