Skip to content

Commit 6313036

Browse files
clydinalan-agius4
authored andcommitted
test: move builder testing infrastructure to separate bazel target module
The builder testing infrastructure and harness has been moved out of the `@angular-devkit/build-angular` package and into a separate bazel only module. This allows the testing code to be shared with other packages within the repository. It also removes test only code from within the package that is not specific any of the included builders.
1 parent 63dab46 commit 6313036

Some content is hidden

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

49 files changed

+270
-183
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"bazel-out",
1616
"dist-schema",
1717
"goldens/public-api",
18+
"modules/testing/builder/projects",
1819
"packages/angular_devkit/build_angular/src/babel-bazel.d.ts",
1920
"packages/angular_devkit/build_angular/test",
2021
"packages/angular_devkit/build_webpack/test",

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ jobs:
103103
uses: angular/dev-infra/github-actions/bazel/configure-remote@f8b2efa171f4ebec4d0cb3d5c5d4f7cb680f2af9
104104
- name: Install node modules
105105
run: yarn install --frozen-lockfile
106-
- name: Run tests
106+
- name: Run module tests
107+
run: yarn bazel test //modules/...
108+
- name: Run package tests
107109
run: yarn bazel test //packages/...
108110

109111
e2e:

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/docs/design/analytics.md
33
/dist-schema/
44
/goldens/public-api
5+
/modules/testing/builder/projects/
56
/packages/angular_devkit/build_angular/test/
67
/packages/angular_devkit/core/src/workspace/json/test/
78
/packages/angular_devkit/schematics_cli/blank/project-files/

modules/testing/builder/BUILD.bazel

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
2+
load("//tools:defaults.bzl", "ts_library")
3+
4+
package(default_visibility = ["//visibility:public"])
5+
6+
ts_library(
7+
name = "builder",
8+
testonly = True,
9+
srcs = glob(
10+
include = [
11+
"src/**/*.ts",
12+
],
13+
exclude = [
14+
"src/**/*_spec.ts",
15+
],
16+
),
17+
data = glob(["projects/**/*"]),
18+
deps = [
19+
"//packages/angular_devkit/architect",
20+
"//packages/angular_devkit/architect/node",
21+
"//packages/angular_devkit/architect/testing",
22+
"//packages/angular_devkit/core",
23+
"//packages/angular_devkit/core/node",
24+
"@npm//rxjs",
25+
],
26+
)
27+
28+
ts_library(
29+
name = "unit_test_lib",
30+
testonly = True,
31+
srcs = glob(
32+
include = [
33+
"src/**/*_spec.ts",
34+
],
35+
),
36+
deps = [
37+
":builder",
38+
"//packages/angular_devkit/architect/testing",
39+
],
40+
)
41+
42+
jasmine_node_test(
43+
name = "unit_test",
44+
srcs = [":unit_test_lib"],
45+
)

0 commit comments

Comments
 (0)