Skip to content

Commit 1296393

Browse files
alan-agius4AndrewKushnir
authored andcommitted
build: trigger error when size-tracking is enabled but not in limit file (angular#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 angular#55708
1 parent a916047 commit 1296393

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

integration/platform-server/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,4 @@ load("//integration:index.bzl", "ng_integration_test")
33
ng_integration_test(
44
name = "test",
55
setup_chromium = True,
6-
track_payload_paths = [
7-
"/standalone/browser",
8-
"/ngmodule/browser",
9-
],
10-
track_payload_size = "platform-server",
116
)

scripts/ci/payload-size.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const THRESHOLD_PERCENT = 5;
2222
const currentSizes = JSON.parse(fs.readFileSync('/tmp/current.log', 'utf8'));
2323
const allLimitSizes = JSON.parse(fs.readFileSync(limitFile, 'utf8'));
2424
const limitSizes = allLimitSizes[project];
25+
if (!limitSizes) {
26+
throw new Error(`ERROR: Project '${project}' is missing from limit file ${limitFile}.`);
27+
}
2528

2629
// Check current sizes against limits.
2730
let failed = false;

0 commit comments

Comments
 (0)