Skip to content

Commit caa4ab3

Browse files
wagnermacielatscott
authored andcommitted
revert: "revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798)" (#36800)
This reverts commit ad8c4cd. PR Close #36800
1 parent 06a8ad2 commit caa4ab3

File tree

96 files changed

+191
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+191
-125
lines changed

.pullapprove.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,23 +968,17 @@ groups:
968968
'docs/TOOLS.md',
969969
'docs/TRIAGE_AND_LABELS.md',
970970
'goldens/*',
971-
'modules/e2e_util/e2e_util.ts',
972-
'modules/e2e_util/perf_util.ts',
973971
'modules/*',
974972
'packages/*',
975973
'packages/examples/test-utils/**',
976974
'packages/private/**',
977975
'packages/examples/*',
978976
'scripts/**',
979977
'third_party/**',
980-
'tools/brotli-cli/**',
981-
'tools/browsers/**',
982978
'tools/build/**',
983979
'tools/circular_dependency_test/**',
984980
'tools/contributing-stats/**',
985-
'tools/components/**',
986981
'tools/gulp-tasks/**',
987-
'tools/ng_rollup_bundle/**',
988982
'tools/ngcontainer/**',
989983
'tools/npm/**',
990984
'tools/npm_integration_test/**',

BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package(default_visibility = ["//visibility:public"])
22

33
exports_files([
44
"LICENSE",
5-
"protractor-perf.conf.js",
65
"karma-js.conf.js",
76
"browser-providers.conf.js",
87
"scripts/ci/track-payload-size.sh",

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"
6464

6565
web_test_repositories()
6666

67-
load("//tools/browsers:browser_repositories.bzl", "browser_repositories")
67+
load("//dev-infra/benchmark/browsers:browser_repositories.bzl", "browser_repositories")
6868

6969
browser_repositories()
7070

dev-infra/benchmark/BUILD.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
# Make source files available for distribution via pkg_npm
4+
filegroup(
5+
name = "files",
6+
srcs = glob(["*"]) + [
7+
"//dev-infra/benchmark/brotli-cli:files",
8+
"//dev-infra/benchmark/browsers:files",
9+
"//dev-infra/benchmark/component_benchmark:files",
10+
"//dev-infra/benchmark/ng_rollup_bundle:files",
11+
],
12+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
4+
5+
nodejs_binary(
6+
name = "brotli-cli",
7+
data = [
8+
"cli.js",
9+
"@npm//brotli",
10+
],
11+
entry_point = ":cli.js",
12+
visibility = ["//visibility:public"],
13+
)
14+
15+
# Make source files available for distribution via pkg_npm
16+
filegroup(
17+
name = "files",
18+
srcs = glob(["*"]),
19+
)
File renamed without changes.

tools/browsers/BUILD.bazel renamed to dev-infra/benchmark/browsers/BUILD.bazel

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#
1515
################################################################################
1616
#
17+
package(default_visibility = ["//visibility:public"])
18+
1719
load("@io_bazel_rules_webtesting//web:web.bzl", "browser", "web_test_archive")
1820

1921
# Override of chromium web_test_archive so that the archive is selected based on platform
@@ -31,7 +33,7 @@ web_test_archive(
3133
"@io_bazel_rules_webtesting//common/conditions:mac": {"CHROMIUM": "chrome-mac/Chromium.app/Contents/MacOS/chromium"},
3234
"@io_bazel_rules_webtesting//common/conditions:windows": {"CHROMIUM": "chrome-win/chrome.exe"},
3335
}),
34-
visibility = ["//tools/browsers:__subpackages__"],
36+
visibility = ["//dev-infra/benchmark/browsers:__subpackages__"],
3537
)
3638

3739
# Override of chromedriver web_test_archive so that the archive is selected based on platform
@@ -55,7 +57,7 @@ web_test_archive(
5557
"CHROMEDRIVER": "chromedriver_win32/chromedriver.exe",
5658
},
5759
}),
58-
visibility = ["//tools/browsers:__subpackages__"],
60+
visibility = ["//dev-infra/benchmark/browsers:__subpackages__"],
5961
)
6062

6163
browser(
@@ -68,3 +70,9 @@ browser(
6870
"@io_bazel_rules_webtesting//go/wsl",
6971
],
7072
)
73+
74+
# Make source files available for distribution via pkg_npm
75+
filegroup(
76+
name = "files",
77+
srcs = glob(["*"]),
78+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
exports_files([
4+
"protractor-perf.conf.js",
5+
"start-server.js",
6+
])
7+
8+
# Make source files available for distribution via pkg_npm
9+
filegroup(
10+
name = "files",
11+
srcs = glob(["*"]) + ["//dev-infra/benchmark/component_benchmark/defaults:files"],
12+
)

modules/benchmarks/benchmark_test.bzl renamed to dev-infra/benchmark/component_benchmark/benchmark_test.bzl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:defaults.bzl", "protractor_web_test_suite")
1+
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")
22

33
"""
44
Macro that can be used to define a benchmark test. This differentiates from
@@ -10,11 +10,9 @@ load("//tools:defaults.bzl", "protractor_web_test_suite")
1010
def benchmark_test(name, server, tags = [], **kwargs):
1111
protractor_web_test_suite(
1212
name = name,
13-
configuration = "//:protractor-perf.conf.js",
14-
data = [
15-
"//packages/benchpress",
16-
],
17-
on_prepare = "//modules/benchmarks:start-server.js",
13+
browsers = ["//dev-infra/benchmark/browsers:chromium"],
14+
configuration = "//dev-infra/benchmark/component_benchmark:protractor-perf.conf.js",
15+
on_prepare = "//dev-infra/benchmark/component_benchmark:start-server.js",
1816
server = server,
1917
# Benchmark targets should not run on CI by default.
2018
tags = tags + [

tools/components/component_benchmark.bzl renamed to dev-infra/benchmark/component_benchmark/component_benchmark.bzl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_devserver", "ts_library")
2-
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
1+
load("//dev-infra/benchmark/ng_rollup_bundle:ng_rollup_bundle.bzl", "ng_rollup_bundle")
2+
load("//tools:defaults.bzl", "ng_module")
3+
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
4+
load(":benchmark_test.bzl", "benchmark_test")
35

46
def copy_default_file(origin, destination):
57
"""
6-
Copies a file from tools/components/defaults to the destination.
8+
Copies a file from /defaults to the destination.
79
810
Args:
911
origin: The name of a file in benchpress/defaults to be copied.
1012
destination: Where the original file will be clopied to.
1113
"""
1214
native.genrule(
1315
name = "copy_default_" + origin + "_file_genrule",
14-
srcs = ["//tools/components/defaults:" + origin],
16+
srcs = ["//dev-infra/benchmark/component_benchmark/defaults:" + origin],
1517
outs = [destination],
1618
cmd = "cat $(SRCS) >> $@",
1719
)
@@ -105,6 +107,7 @@ def component_benchmark(
105107
# Creates ngFactory and ngSummary to be imported by the app's entry point.
106108
generate_ve_shims = True,
107109
deps = ng_deps,
110+
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
108111
)
109112

110113
# Bundle the application (needed by ts_devserver).
@@ -117,7 +120,7 @@ def component_benchmark(
117120
# The ts_library for the driver that runs tests against the benchmark app.
118121
ts_library(
119122
name = benchmark_driver,
120-
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
123+
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
121124
testonly = True,
122125
srcs = [driver],
123126
deps = driver_deps,
@@ -130,7 +133,8 @@ def component_benchmark(
130133
port = 4200,
131134
static_files = assets + styles,
132135
deps = [":" + app_main + ".min_debug.es2015.js"],
133-
additional_root_paths = ["tools/components/defaults"],
136+
additional_root_paths = ["//dev-infra/benchmark/component_benchmark/defaults"],
137+
serving_path = "/app_bundle.js",
134138
)
135139

136140
# Runs a protractor test that's set up to use @angular/benchpress.

tools/components/defaults/BUILD.bazel renamed to dev-infra/benchmark/component_benchmark/defaults/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
# Make source files available for distribution via pkg_npm
4+
filegroup(
5+
name = "files",
6+
srcs = glob(["*"]),
7+
)
8+
39
exports_files([
410
"index.html",
511
"index.ts",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["es2015", "dom"],
4+
"types": ["node", "jasmine"]
5+
}
6+
}

modules/e2e_util/BUILD.bazel renamed to dev-infra/benchmark/driver-utilities/BUILD.bazel

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
load("//tools:defaults.bzl", "ts_library")
2-
31
package(default_visibility = ["//visibility:public"])
42

3+
load("@npm_bazel_typescript//:index.bzl", "ts_library")
4+
55
ts_library(
6-
name = "e2e_util",
7-
testonly = 1,
6+
name = "driver-utilities",
87
srcs = glob(["*.ts"]),
8+
module_name = "@angular/dev-infra/benchmark/driver-utilities",
9+
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
910
deps = [
10-
"//packages:types",
1111
"//packages/benchpress",
1212
"@npm//@types/fs-extra",
13+
"@npm//@types/node",
1314
"@npm//@types/selenium-webdriver",
1415
"@npm//fs-extra",
1516
"@npm//node-uuid",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
export {openBrowser, verifyNoBrowserErrors} from './e2e_util';
9+
export {runBenchmark} from './perf_util';

tools/ng_rollup_bundle/BUILD.bazel renamed to dev-infra/benchmark/ng_rollup_bundle/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ nodejs_binary(
1818
],
1919
entry_point = "@npm//:node_modules/rollup/dist/bin/rollup",
2020
)
21+
22+
# Make source files available for distribution via pkg_npm
23+
filegroup(
24+
name = "files",
25+
srcs = glob(["*"]),
26+
)

tools/ng_rollup_bundle/ng_rollup_bundle.bzl renamed to dev-infra/benchmark/ng_rollup_bundle/ng_rollup_bundle.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ _NG_ROLLUP_BUNDLE_ATTRS = {
175175
"_rollup": attr.label(
176176
executable = True,
177177
cfg = "host",
178-
default = Label("//tools/ng_rollup_bundle:rollup_with_build_optimizer"),
178+
default = Label("//dev-infra/benchmark/ng_rollup_bundle:rollup_with_build_optimizer"),
179179
),
180180
"_rollup_config_tmpl": attr.label(
181-
default = Label("//tools/ng_rollup_bundle:rollup.config.js"),
181+
default = Label("//dev-infra/benchmark/ng_rollup_bundle:rollup.config.js"),
182182
allow_single_file = True,
183183
),
184184
}
@@ -392,7 +392,7 @@ def ng_rollup_bundle(name, **kwargs):
392392
# maintain the comments off behavior. We pass the --comments flag with
393393
# a regex that always evaluates to false to do this.
394394
"args": ["--comments", "/bogus_string_to_suppress_all_comments^/"],
395-
"config_file": "//tools/ng_rollup_bundle:terser_config.json",
395+
"config_file": "//dev-infra/benchmark/ng_rollup_bundle:terser_config.json",
396396
"sourcemap": False,
397397
}
398398

@@ -413,7 +413,7 @@ def ng_rollup_bundle(name, **kwargs):
413413
native.filegroup(name = name + ".min_debug.js", srcs = [name + ".min_debug"], visibility = visibility)
414414
npm_package_bin(
415415
name = "_%s_brotli" % name,
416-
tool = "//tools/brotli-cli",
416+
tool = "//dev-infra/benchmark/brotli-cli",
417417
data = [name + ".min.js"],
418418
outs = [name + ".min.js.br"],
419419
args = [
@@ -436,7 +436,7 @@ def ng_rollup_bundle(name, **kwargs):
436436
native.filegroup(name = name + ".min_debug.es2015.js", srcs = [name + ".min_debug.es2015"], visibility = visibility)
437437
npm_package_bin(
438438
name = "_%s_es2015_brotli" % name,
439-
tool = "//tools/brotli-cli",
439+
tool = "//dev-infra/benchmark/brotli-cli",
440440
data = [name + ".min.es2015.js"],
441441
outs = [name + ".min.es2015.js.br"],
442442
args = [

dev-infra/tools/BUILD.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
# Make source files available for distribution via pkg_npm
4+
filegroup(
5+
name = "files",
6+
srcs = glob(["*"]) + [
7+
"//dev-infra/benchmark/brotli-cli:files",
8+
"//dev-infra/benchmark/browsers:files",
9+
"//dev-infra/benchmark/component_benchmark:files",
10+
"//dev-infra/benchmark/ng_rollup_bundle:files",
11+
],
12+
)

modules/benchmarks/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ package(default_visibility = ["//visibility:public"])
33
exports_files([
44
"tsconfig-build.json",
55
"tsconfig-e2e.json",
6-
"start-server.js",
76
])

modules/benchmarks/e2e_test.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ load("//tools:defaults.bzl", "protractor_web_test_suite")
99
def e2e_test(name, server, **kwargs):
1010
protractor_web_test_suite(
1111
name = name,
12-
on_prepare = "//modules/benchmarks:start-server.js",
12+
on_prepare = "//dev-infra/benchmark/component_benchmark:start-server.js",
1313
server = server,
1414
**kwargs
1515
)

modules/benchmarks/src/change_detection/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ts_library(
1515
srcs = ["change_detection.perf-spec.ts"],
1616
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
1717
deps = [
18-
"//modules/e2e_util",
18+
"//dev-infra/benchmark/driver-utilities",
1919
"@npm//protractor",
2020
],
2121
)
@@ -26,7 +26,7 @@ ts_library(
2626
srcs = ["change_detection.e2e-spec.ts"],
2727
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
2828
deps = [
29-
"//modules/e2e_util",
29+
"//dev-infra/benchmark/driver-utilities",
3030
"@npm//protractor",
3131
],
3232
)

modules/benchmarks/src/change_detection/change_detection.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {$} from 'protractor';
1010

11-
import {openBrowser, verifyNoBrowserErrors} from '../../../e2e_util/e2e_util';
11+
import {openBrowser, verifyNoBrowserErrors} from '../../../../dev-infra/benchmark/driver-utilities';
1212

1313
describe('change detection benchmark', () => {
1414
afterEach(verifyNoBrowserErrors);

modules/benchmarks/src/change_detection/change_detection.perf-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {$} from 'protractor';
10-
import {runBenchmark, verifyNoBrowserErrors} from '../../../e2e_util/perf_util';
10+
import {runBenchmark, verifyNoBrowserErrors} from '../../../../dev-infra/benchmark/driver-utilities';
1111

1212
interface Worker {
1313
id: string;

modules/benchmarks/src/change_detection/transplanted_views/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_devserver")
2-
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
2+
load("//dev-infra/benchmark/component_benchmark:benchmark_test.bzl", "benchmark_test")
33
load("//modules/benchmarks:e2e_test.bzl", "e2e_test")
44

55
package(default_visibility = ["//modules/benchmarks:__subpackages__"])

modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {$, browser} from 'protractor';
10-
import {runBenchmark} from '../../../e2e_util/perf_util';
10+
import {runBenchmark} from '../../../../dev-infra/benchmark/driver-utilities';
1111

1212
describe('class bindings perf', () => {
1313
it('should work for update', async () => {

modules/benchmarks/src/expanding_rows/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package(default_visibility = ["//modules/benchmarks:__subpackages__"])
22

33
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_devserver", "ts_library")
4-
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
4+
load("//dev-infra/benchmark/component_benchmark:benchmark_test.bzl", "benchmark_test")
55

66
ng_module(
77
name = "application_lib",
@@ -26,7 +26,7 @@ ts_library(
2626
srcs = ["expanding_rows.perf-spec.ts"],
2727
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
2828
deps = [
29-
"//modules/e2e_util",
29+
"//dev-infra/benchmark/driver-utilities",
3030
"@npm//protractor",
3131
],
3232
)

0 commit comments

Comments
 (0)