mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(core): add size tracking test for hydration apps (#49955)
This adds test to track size regressions when hydration is enabled. PR Close #49955
This commit is contained in:
committed by
Dylan Hunn
parent
de240e37f3
commit
2ccfebd774
@@ -45,6 +45,20 @@
|
||||
"polyfills": 33782
|
||||
}
|
||||
},
|
||||
"platform-server/standalone/browser": {
|
||||
"uncompressed": {
|
||||
"runtime": 2694,
|
||||
"main": 232544,
|
||||
"polyfills": 33782
|
||||
}
|
||||
},
|
||||
"platform-server/ngmodule/browser": {
|
||||
"uncompressed": {
|
||||
"runtime": 2688,
|
||||
"main": 244602,
|
||||
"polyfills": 33778
|
||||
}
|
||||
},
|
||||
"standalone-bootstrap": {
|
||||
"uncompressed": {
|
||||
"runtime": 918,
|
||||
@@ -61,4 +75,4 @@
|
||||
"bundle": 1214857
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ def _ng_integration_test(name, setup_chromium = False, **kwargs):
|
||||
toolchains = kwargs.pop("toolchains", [])
|
||||
environment = kwargs.pop("environment", {})
|
||||
track_payload_size = kwargs.pop("track_payload_size", None)
|
||||
track_payload_paths = kwargs.pop("track_payload_paths", [""])
|
||||
data = kwargs.pop("data", [])
|
||||
|
||||
if setup_chromium:
|
||||
@@ -36,9 +37,13 @@ def _ng_integration_test(name, setup_chromium = False, **kwargs):
|
||||
if track_payload_size:
|
||||
commands += [
|
||||
"yarn build",
|
||||
# TODO: Replace the track payload-size script with a RBE and Windows-compatible script.
|
||||
"$(rootpath //:scripts/ci/bazel-payload-size.sh) %s 'dist/*.js' true $${RUNFILES}/angular/$(rootpath //goldens:size-tracking/integration-payloads.json)" % track_payload_size,
|
||||
]
|
||||
for path in track_payload_paths:
|
||||
commands += [
|
||||
# TODO: Replace the track payload-size script with a RBE and Windows-compatible script.
|
||||
"$(rootpath //:scripts/ci/bazel-payload-size.sh) {bundle}{path} 'dist{path}/*.js' true ${runfiles}/angular/$(rootpath //goldens:size-tracking/integration-payloads.json)".format(bundle = track_payload_size, path = path, runfiles = "${RUNFILES}"),
|
||||
]
|
||||
|
||||
data += [
|
||||
"//goldens:size-tracking/integration-payloads.json",
|
||||
"//:scripts/ci/bazel-payload-size.sh",
|
||||
|
||||
@@ -3,4 +3,9 @@ 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,6 +3,9 @@
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"#comment-1": "The below is used is for payload size checks",
|
||||
"build": "ng build standalone && ng build ngmodule",
|
||||
"#comment-2": "The below is used is for integration tests",
|
||||
"build:ngmodule": "ng run ngmodule:build:development && ng run ngmodule:server:development",
|
||||
"serve:ngmodule": "node ./dist/ngmodule/server/main.js",
|
||||
"test:ngmodule": "yarn build:ngmodule && concurrently \"yarn serve:ngmodule\" \"yarn ng e2e ngmodule\" --kill-others --success first",
|
||||
|
||||
Reference in New Issue
Block a user