mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Andrew Kushnir
parent
8630dc8149
commit
8305e50f8e
@@ -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",
|
||||
)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user