build: trigger error when size-tracking is enabled but not in limit file (#55708)

Trigger an error when attempting to enable size-tracking for a project not listed in the integration-payload.json file.

Before this update, size-checks would succeed even if the project wasn't included in the file size limit.

PR Close #55708
This commit is contained in:
Alan Agius
2024-05-07 10:18:35 +00:00
committed by Andrew Kushnir
parent 8630dc8149
commit 8305e50f8e
2 changed files with 3 additions and 5 deletions
-5
View File
@@ -3,9 +3,4 @@ load("//integration:index.bzl", "ng_integration_test")
ng_integration_test(
name = "test",
setup_chromium = True,
track_payload_paths = [
"/standalone/browser",
"/ngmodule/browser",
],
track_payload_size = "platform-server",
)
+3
View File
@@ -22,6 +22,9 @@ const THRESHOLD_PERCENT = 5;
const currentSizes = JSON.parse(fs.readFileSync('/tmp/current.log', 'utf8'));
const allLimitSizes = JSON.parse(fs.readFileSync(limitFile, 'utf8'));
const limitSizes = allLimitSizes[project];
if (!limitSizes) {
throw new Error(`ERROR: Project '${project}' is missing from limit file ${limitFile}.`);
}
// Check current sizes against limits.
let failed = false;