From af142a7655e129fba4cb82a2aaba65f8c78f90d2 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 17 Jul 2017 20:11:45 +0200 Subject: [PATCH] build: add timestamp to coverage reports (#5795) * Adds a timestamp property to the coverage results that will be uploaded to Firebase --- tools/gulp/tasks/coverage.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/gulp/tasks/coverage.ts b/tools/gulp/tasks/coverage.ts index 06a3b8c87f5..a8c5138231f 100644 --- a/tools/gulp/tasks/coverage.ts +++ b/tools/gulp/tasks/coverage.ts @@ -18,7 +18,11 @@ task('coverage:upload', () => { throw new Error('Coverage results will be only uploaded inside of Travis Push builds.'); } - let results = require(coverageResultFile)['total']; + const results = require(coverageResultFile)['total']; + + // Add a timestamp to the coverage result that will be uploaded to Firebase. + // This is necessary for visual representation which should be displayed chronologically. + results.timestamp = Date.now(); // To reduce database payload, the covered lines won't be pushed to the Firebase database. delete results['linesCovered']; @@ -36,6 +40,3 @@ function uploadResults(results: any): Promise { .catch((err: any) => console.error(err)) .then(() => dashboardApp.delete()); } - -// TODO(devversion): In the future we might have a big database where we can store full summaries. -// TODO(devversion): We could also move the coverage to a bot and reply with the results on PRs.