Skip to content

build: shard component e2e tests with bazel #15078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions e2e/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,43 @@ load("@angular//:index.bzl", "protractor_web_test_suite")
load("//tools:defaults.bzl", "ts_library")

ts_library(
name = "e2e_specs_lib",
srcs = glob(["**/*.ts"]),
name = "e2e_utils_lib",
srcs = glob(["util/**/*.ts"]),
tsconfig = ":tsconfig.json",
deps = [
"@matdeps//@types/jasmine",
"@matdeps//protractor"
]
)

protractor_web_test_suite(
name = "e2e",
# For each spec file in the "components/" folder, we declare a Bazel target
# that builds the JavaScript outputs for the e2e spec file.
[ts_library(
name = "%s_specs_lib" % spec_file,
srcs = [spec_file],
tsconfig = ":tsconfig.json",
deps = [
"@matdeps//@types/jasmine",
"@matdeps//protractor",
":e2e_utils_lib",
]
) for spec_file in glob(["components/**/*.spec.ts"])]

# For each spec file in the "components/" folder, we declare a Protractor web test
# suite target that runs the given e2e spec against the e2e-app devserver.
[protractor_web_test_suite(
name = "%s_e2e" % spec_file,
configuration = ":protractor.conf.js",
on_prepare = ":start-devserver.js",
server = "//src/e2e-app:devserver",
deps = [
"@matdeps//protractor",
":e2e_specs_lib"
":%s_specs_lib" % spec_file,
":e2e_utils_lib",
],
data = [
"@angular//packages/bazel/src/protractor/utils",
"//tools/axe-protractor",
],
)
) for spec_file in glob(["components/**/*.spec.ts"])]