Skip to content

Commit 6bc9d97

Browse files
committed
build: add legaci-cli e2e bazel build
1 parent fcbf6f9 commit 6bc9d97

File tree

9 files changed

+127
-1
lines changed

9 files changed

+127
-1
lines changed

.circleci/config.yml

+12
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ jobs:
254254
- custom_attach_workspace
255255
- run: yarn build
256256

257+
build-bazel-e2e:
258+
executor: action-executor
259+
steps:
260+
- custom_attach_workspace
261+
- run: yarn bazel build //tests/legacy-cli/...
262+
257263
test:
258264
executor: test-executor
259265
resource_class: xlarge
@@ -379,6 +385,12 @@ workflows:
379385
requires:
380386
- build
381387

388+
# Compile the e2e tests with bazel to ensure the non-runtime typescript
389+
# compilation completes succesfully.
390+
- build-bazel-e2e:
391+
requires:
392+
- build
393+
382394
# Windows jobs
383395
- e2e-cli-win:
384396
requires:

lib/BUILD.bazel

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "lib",
5+
srcs = ["packages.ts"],
6+
visibility = ["//visibility:public"],
7+
deps = [
8+
"//packages/angular_devkit/core",
9+
"@npm//@types/node",
10+
"@npm//typescript",
11+
],
12+
)

tests/legacy-cli/BUILD.bazel

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "runner",
5+
testonly = True,
6+
srcs = glob(["**/*.ts"]),
7+
data = [
8+
"verdaccio.yaml",
9+
"verdaccio_auth.yaml",
10+
],
11+
deps = [
12+
"//packages/angular_devkit/core",
13+
"//packages/angular_devkit/core/node",
14+
"//tests/legacy-cli/e2e/assets",
15+
"//tests/legacy-cli/e2e/utils",
16+
"@npm//@types/glob",
17+
"@npm//@types/yargs-parser",
18+
"@npm//ansi-colors",
19+
"@npm//yargs-parser",
20+
21+
# Loaded dynamically at runtime, not compiletime deps
22+
"//tests/legacy-cli/e2e/setup",
23+
"//tests/legacy-cli/e2e/tests",
24+
],
25+
)
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
load("//tools:defaults.bzl", "js_library")
2+
3+
js_library(
4+
name = "assets",
5+
srcs = glob(["**"]),
6+
visibility = ["//visibility:public"],
7+
deps = [
8+
"@npm//jasmine-spec-reporter",
9+
"@npm//ts-node",
10+
],
11+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "ng-snapshot",
5+
srcs = [],
6+
data = ["package.json"],
7+
visibility = ["//visibility:public"],
8+
)
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "setup",
5+
testonly = True,
6+
srcs = glob(["**/*.ts"]),
7+
visibility = ["//visibility:public"],
8+
deps = [
9+
"//tests/legacy-cli/e2e/utils",
10+
],
11+
)
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "tests",
5+
testonly = True,
6+
srcs = glob(["**/*.ts"]),
7+
visibility = ["//visibility:public"],
8+
deps = [
9+
"//tests/legacy-cli/e2e/ng-snapshot",
10+
"//tests/legacy-cli/e2e/utils",
11+
"@npm//@types/express",
12+
"@npm//@types/glob",
13+
"@npm//@types/node-fetch",
14+
"@npm//@types/semver",
15+
"@npm//express",
16+
"@npm//glob",
17+
"@npm//node-fetch",
18+
"@npm//semver",
19+
],
20+
)
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("//tools:defaults.bzl", "ts_library")
2+
3+
ts_library(
4+
name = "utils",
5+
testonly = True,
6+
srcs = glob(["**/*.ts"]),
7+
visibility = ["//visibility:public"],
8+
deps = [
9+
"//lib",
10+
"//tests/legacy-cli/e2e/ng-snapshot",
11+
"@npm//@types/glob",
12+
"@npm//@types/node-fetch",
13+
"@npm//@types/semver",
14+
"@npm//@types/yargs-parser",
15+
"@npm//ansi-colors",
16+
"@npm//glob",
17+
"@npm//protractor",
18+
"@npm//puppeteer",
19+
"@npm//rxjs",
20+
"@npm//semver",
21+
"@npm//tree-kill",
22+
"@npm//verdaccio",
23+
"@npm//verdaccio-auth-memory",
24+
],
25+
)

tools/defaults.bzl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Re-export of some bazel rules with repository-wide defaults."""
22

33
load("@npm//@bazel/concatjs/internal:build_defs.bzl", _ts_library = "ts_library_macro")
4-
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _pkg_npm = "pkg_npm")
4+
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _js_library = "js_library", _pkg_npm = "pkg_npm")
55
load("@rules_pkg//:pkg.bzl", "pkg_tar")
66
load("@npm//@angular/dev-infra-private/bazel:extract_js_module_output.bzl", "extract_js_module_output")
77
load("@aspect_bazel_lib//lib:utils.bzl", "to_label")
@@ -50,6 +50,8 @@ def ts_library(
5050
**kwargs
5151
)
5252

53+
js_library = _js_library
54+
5355
def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
5456
"""Override of pkg_npm to produce package outputs and version substitutions conventional to the angular-cli project.
5557

0 commit comments

Comments
 (0)