Skip to content

Commit

Permalink
revert: "revert: "feat(dev-infra): exposed new rule 'component_benchm…
Browse files Browse the repository at this point in the history
…ark' via dev_infra (angular#36434)" (angular#36798)" (angular#36800)

This reverts commit ad8c4cd.

PR Close angular#36800
  • Loading branch information
wagnermaciel authored and atscott committed Jun 3, 2020
1 parent 06a8ad2 commit caa4ab3
Show file tree
Hide file tree
Showing 96 changed files with 191 additions and 125 deletions.
6 changes: 0 additions & 6 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -968,23 +968,17 @@ groups:
'docs/TOOLS.md',
'docs/TRIAGE_AND_LABELS.md',
'goldens/*',
'modules/e2e_util/e2e_util.ts',
'modules/e2e_util/perf_util.ts',
'modules/*',
'packages/*',
'packages/examples/test-utils/**',
'packages/private/**',
'packages/examples/*',
'scripts/**',
'third_party/**',
'tools/brotli-cli/**',
'tools/browsers/**',
'tools/build/**',
'tools/circular_dependency_test/**',
'tools/contributing-stats/**',
'tools/components/**',
'tools/gulp-tasks/**',
'tools/ng_rollup_bundle/**',
'tools/ngcontainer/**',
'tools/npm/**',
'tools/npm_integration_test/**',
Expand Down
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package(default_visibility = ["//visibility:public"])

exports_files([
"LICENSE",
"protractor-perf.conf.js",
"karma-js.conf.js",
"browser-providers.conf.js",
"scripts/ci/track-payload-size.sh",
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"

web_test_repositories()

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

browser_repositories()

Expand Down
12 changes: 12 additions & 0 deletions dev-infra/benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package(default_visibility = ["//visibility:public"])

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]) + [
"//dev-infra/benchmark/brotli-cli:files",
"//dev-infra/benchmark/browsers:files",
"//dev-infra/benchmark/component_benchmark:files",
"//dev-infra/benchmark/ng_rollup_bundle:files",
],
)
19 changes: 19 additions & 0 deletions dev-infra/benchmark/brotli-cli/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")

nodejs_binary(
name = "brotli-cli",
data = [
"cli.js",
"@npm//brotli",
],
entry_point = ":cli.js",
visibility = ["//visibility:public"],
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]),
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
################################################################################
#
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_webtesting//web:web.bzl", "browser", "web_test_archive")

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

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

browser(
Expand All @@ -68,3 +70,9 @@ browser(
"@io_bazel_rules_webtesting//go/wsl",
],
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]),
)
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions dev-infra/benchmark/component_benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package(default_visibility = ["//visibility:public"])

exports_files([
"protractor-perf.conf.js",
"start-server.js",
])

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]) + ["//dev-infra/benchmark/component_benchmark/defaults:files"],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "protractor_web_test_suite")
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")

"""
Macro that can be used to define a benchmark test. This differentiates from
Expand All @@ -10,11 +10,9 @@ load("//tools:defaults.bzl", "protractor_web_test_suite")
def benchmark_test(name, server, tags = [], **kwargs):
protractor_web_test_suite(
name = name,
configuration = "//:protractor-perf.conf.js",
data = [
"//packages/benchpress",
],
on_prepare = "//modules/benchmarks:start-server.js",
browsers = ["//dev-infra/benchmark/browsers:chromium"],
configuration = "//dev-infra/benchmark/component_benchmark:protractor-perf.conf.js",
on_prepare = "//dev-infra/benchmark/component_benchmark:start-server.js",
server = server,
# Benchmark targets should not run on CI by default.
tags = tags + [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_devserver", "ts_library")
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
load("//dev-infra/benchmark/ng_rollup_bundle:ng_rollup_bundle.bzl", "ng_rollup_bundle")
load("//tools:defaults.bzl", "ng_module")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
load(":benchmark_test.bzl", "benchmark_test")

def copy_default_file(origin, destination):
"""
Copies a file from tools/components/defaults to the destination.
Copies a file from /defaults to the destination.
Args:
origin: The name of a file in benchpress/defaults to be copied.
destination: Where the original file will be clopied to.
"""
native.genrule(
name = "copy_default_" + origin + "_file_genrule",
srcs = ["//tools/components/defaults:" + origin],
srcs = ["//dev-infra/benchmark/component_benchmark/defaults:" + origin],
outs = [destination],
cmd = "cat $(SRCS) >> $@",
)
Expand Down Expand Up @@ -105,6 +107,7 @@ def component_benchmark(
# Creates ngFactory and ngSummary to be imported by the app's entry point.
generate_ve_shims = True,
deps = ng_deps,
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
)

# Bundle the application (needed by ts_devserver).
Expand All @@ -117,7 +120,7 @@ def component_benchmark(
# The ts_library for the driver that runs tests against the benchmark app.
ts_library(
name = benchmark_driver,
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
testonly = True,
srcs = [driver],
deps = driver_deps,
Expand All @@ -130,7 +133,8 @@ def component_benchmark(
port = 4200,
static_files = assets + styles,
deps = [":" + app_main + ".min_debug.es2015.js"],
additional_root_paths = ["tools/components/defaults"],
additional_root_paths = ["//dev-infra/benchmark/component_benchmark/defaults"],
serving_path = "/app_bundle.js",
)

# Runs a protractor test that's set up to use @angular/benchpress.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package(default_visibility = ["//visibility:public"])

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]),
)

exports_files([
"index.html",
"index.ts",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions dev-infra/benchmark/component_benchmark/tsconfig-e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"lib": ["es2015", "dom"],
"types": ["node", "jasmine"]
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
load("//tools:defaults.bzl", "ts_library")

package(default_visibility = ["//visibility:public"])

load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "e2e_util",
testonly = 1,
name = "driver-utilities",
srcs = glob(["*.ts"]),
module_name = "@angular/dev-infra/benchmark/driver-utilities",
tsconfig = "//dev-infra/benchmark/component_benchmark:tsconfig-e2e.json",
deps = [
"//packages:types",
"//packages/benchpress",
"@npm//@types/fs-extra",
"@npm//@types/node",
"@npm//@types/selenium-webdriver",
"@npm//fs-extra",
"@npm//node-uuid",
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions dev-infra/benchmark/driver-utilities/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export {openBrowser, verifyNoBrowserErrors} from './e2e_util';
export {runBenchmark} from './perf_util';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ nodejs_binary(
],
entry_point = "@npm//:node_modules/rollup/dist/bin/rollup",
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]),
)
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ _NG_ROLLUP_BUNDLE_ATTRS = {
"_rollup": attr.label(
executable = True,
cfg = "host",
default = Label("//tools/ng_rollup_bundle:rollup_with_build_optimizer"),
default = Label("//dev-infra/benchmark/ng_rollup_bundle:rollup_with_build_optimizer"),
),
"_rollup_config_tmpl": attr.label(
default = Label("//tools/ng_rollup_bundle:rollup.config.js"),
default = Label("//dev-infra/benchmark/ng_rollup_bundle:rollup.config.js"),
allow_single_file = True,
),
}
Expand Down Expand Up @@ -392,7 +392,7 @@ def ng_rollup_bundle(name, **kwargs):
# maintain the comments off behavior. We pass the --comments flag with
# a regex that always evaluates to false to do this.
"args": ["--comments", "/bogus_string_to_suppress_all_comments^/"],
"config_file": "//tools/ng_rollup_bundle:terser_config.json",
"config_file": "//dev-infra/benchmark/ng_rollup_bundle:terser_config.json",
"sourcemap": False,
}

Expand All @@ -413,7 +413,7 @@ def ng_rollup_bundle(name, **kwargs):
native.filegroup(name = name + ".min_debug.js", srcs = [name + ".min_debug"], visibility = visibility)
npm_package_bin(
name = "_%s_brotli" % name,
tool = "//tools/brotli-cli",
tool = "//dev-infra/benchmark/brotli-cli",
data = [name + ".min.js"],
outs = [name + ".min.js.br"],
args = [
Expand All @@ -436,7 +436,7 @@ def ng_rollup_bundle(name, **kwargs):
native.filegroup(name = name + ".min_debug.es2015.js", srcs = [name + ".min_debug.es2015"], visibility = visibility)
npm_package_bin(
name = "_%s_es2015_brotli" % name,
tool = "//tools/brotli-cli",
tool = "//dev-infra/benchmark/brotli-cli",
data = [name + ".min.es2015.js"],
outs = [name + ".min.es2015.js.br"],
args = [
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions dev-infra/tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package(default_visibility = ["//visibility:public"])

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
srcs = glob(["*"]) + [
"//dev-infra/benchmark/brotli-cli:files",
"//dev-infra/benchmark/browsers:files",
"//dev-infra/benchmark/component_benchmark:files",
"//dev-infra/benchmark/ng_rollup_bundle:files",
],
)
1 change: 0 additions & 1 deletion modules/benchmarks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package(default_visibility = ["//visibility:public"])
exports_files([
"tsconfig-build.json",
"tsconfig-e2e.json",
"start-server.js",
])
2 changes: 1 addition & 1 deletion modules/benchmarks/e2e_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ load("//tools:defaults.bzl", "protractor_web_test_suite")
def e2e_test(name, server, **kwargs):
protractor_web_test_suite(
name = name,
on_prepare = "//modules/benchmarks:start-server.js",
on_prepare = "//dev-infra/benchmark/component_benchmark:start-server.js",
server = server,
**kwargs
)
4 changes: 2 additions & 2 deletions modules/benchmarks/src/change_detection/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ts_library(
srcs = ["change_detection.perf-spec.ts"],
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
deps = [
"//modules/e2e_util",
"//dev-infra/benchmark/driver-utilities",
"@npm//protractor",
],
)
Expand All @@ -26,7 +26,7 @@ ts_library(
srcs = ["change_detection.e2e-spec.ts"],
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
deps = [
"//modules/e2e_util",
"//dev-infra/benchmark/driver-utilities",
"@npm//protractor",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {$} from 'protractor';

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

describe('change detection benchmark', () => {
afterEach(verifyNoBrowserErrors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

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

interface Worker {
id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_devserver")
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
load("//dev-infra/benchmark/component_benchmark:benchmark_test.bzl", "benchmark_test")
load("//modules/benchmarks:e2e_test.bzl", "e2e_test")

package(default_visibility = ["//modules/benchmarks:__subpackages__"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

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

describe('class bindings perf', () => {
it('should work for update', async () => {
Expand Down
4 changes: 2 additions & 2 deletions modules/benchmarks/src/expanding_rows/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package(default_visibility = ["//modules/benchmarks:__subpackages__"])

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

ng_module(
name = "application_lib",
Expand All @@ -26,7 +26,7 @@ ts_library(
srcs = ["expanding_rows.perf-spec.ts"],
tsconfig = "//modules/benchmarks:tsconfig-e2e.json",
deps = [
"//modules/e2e_util",
"//dev-infra/benchmark/driver-utilities",
"@npm//protractor",
],
)
Expand Down
Loading

0 comments on commit caa4ab3

Please sign in to comment.