From b15d50af9b92dafe6eaee5318e4b5c823253f25d Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Fri, 5 Jan 2018 15:44:45 -0800 Subject: [PATCH] build(core): improve payload size failure message (#21346) PR Close #21346 --- scripts/ci/payload-size.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ci/payload-size.js b/scripts/ci/payload-size.js index bf0f04028e..bf1699ab55 100644 --- a/scripts/ci/payload-size.js +++ b/scripts/ci/payload-size.js @@ -23,8 +23,13 @@ for (const compressionType in limitSizes) { if (Math.abs(actualSize - expectedSize) > expectedSize / 100) { failed = true; + // We must also catch when the size is significantly lower than the payload limit, so + // we are forced to update the expected payload number when the payload size reduces. + // Otherwise, we won't be able to catch future regressions that happen to be below + // the artificially inflated limit. + const operator = actualSize > expectedSize ? 'exceeded' : 'fell below'; console.log( - `Commit ${commit} ${compressionType} ${filename} exceeded expected size by >1% ` + + `Commit ${commit} ${compressionType} ${filename} ${operator} expected size by >1% ` + `(expected: ${expectedSize}, actual: ${actualSize}).`); } }