Skip to content

Commit ce0040d

Browse files
authored
build: fix and re-enable bazel unit tests for the cdk (#11278)
1 parent ab17996 commit ce0040d

File tree

14 files changed

+37
-32
lines changed

14 files changed

+37
-32
lines changed

.circleci/config.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,28 @@
77
# To validate changes, use an online parser, eg.
88
# http://yaml-online-parser.appspot.com/
99

10+
## IMPORTANT
11+
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
12+
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
13+
var_1: &docker_image angular/ngcontainer:0.3.0
14+
var_2: &cache_key v2-ng-mat-{{ .Branch }}-{{ checksum "package-lock.json" }}-0.3.0
15+
16+
# Define common ENV vars
17+
var_3: &define_env_vars
18+
run: echo "export PROJECT_ROOT=$(pwd)" >> $BASH_ENV
19+
20+
# See remote cache documentation in /docs/BAZEL.md
21+
var_4: &setup-bazel-remote-cache
22+
run:
23+
name: Start up bazel remote cache proxy
24+
command: ~/bazel-remote-proxy -backend circleci://
25+
background: true
26+
1027
# Settings common to each job
1128
anchor_1: &job_defaults
1229
working_directory: ~/ng
1330
docker:
14-
- image: angular/ngcontainer:0.1.0
31+
- image: *docker_image
1532

1633
# After checkout, rebase on top of master.
1734
# Similar to travis behavior, but not quite the same.
@@ -29,15 +46,16 @@ jobs:
2946
- checkout:
3047
<<: *post_checkout
3148
- restore_cache:
32-
key: material2-{{ .Branch }}-{{ checksum "package-lock.json" }}
49+
key: *cache_key
3350

3451
- run: bazel run @nodejs//:npm install
3552
# For some reason, circleci needs the postinstall to be run explicitly.
3653
# This may be unnecessary once rules_nodejs uses nodejs 8
3754
- run: bazel run @nodejs//:npm run postinstall
3855
- run: bazel build src/...
56+
- run: bazel test src/...
3957
- save_cache:
40-
key: material2-{{ .Branch }}-{{ checksum "package-lock.json" }}
58+
key: *cache_key
4159
paths:
4260
- "node_modules"
4361

BUILD.bazel

+2-5
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ filegroup(
7676
srcs = [
7777
"//:node_modules/reflect-metadata/Reflect.js",
7878
"//:node_modules/zone.js/dist/zone.js",
79-
"//:node_modules/zone.js/dist/async-test.js",
80-
"//:node_modules/zone.js/dist/sync-test.js",
81-
"//:node_modules/zone.js/dist/fake-async-test.js",
82-
"//:node_modules/zone.js/dist/proxy.js",
83-
"//:node_modules/zone.js/dist/jasmine-patch.js",
79+
"//:node_modules/zone.js/dist/zone-testing.js",
80+
"//:node_modules/zone.js/dist/task-tracking.js",
8481
],
8582
)

WORKSPACE

+13-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ workspace(name = "angular_material")
33
# Add nodejs rules
44
http_archive(
55
name = "build_bazel_rules_nodejs",
6-
url = "https://github.com/bazelbuild/rules_nodejs/archive/1931156c232a08356dfda02e9c8b0275c2e63c00.zip",
7-
strip_prefix = "rules_nodejs-1931156c232a08356dfda02e9c8b0275c2e63c00",
8-
sha256 = "9cfe33276a6ac0076ee9ee159c4a2576f9851c0f437435b5ac19b2e592493078",
6+
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.8.0.zip",
7+
strip_prefix = "rules_nodejs-0.8.0",
8+
sha256 = "4e40dd49ae7668d245c3107645f2a138660fcfd975b9310b91eda13f0c973953",
99
)
1010

1111
# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
1212
# your npm dependencies. You must still run the package manager.
1313
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
1414

15-
check_bazel_version("0.9.0")
15+
check_bazel_version("0.13.0")
1616
node_repositories(package_json = ["//:package.json"])
1717

1818
# Add sass rules
@@ -28,9 +28,9 @@ sass_repositories()
2828
# Add TypeScript rules
2929
http_archive(
3030
name = "build_bazel_rules_typescript",
31-
url = "https://github.com/bazelbuild/rules_typescript/archive/0.12.1.zip",
32-
strip_prefix = "rules_typescript-0.12.1",
33-
sha256 = "24e2c36f60508c6d270ae4265b89b381e3f66d550e70c367ed3755ad8d7ce3b0",
31+
url = "https://github.com/bazelbuild/rules_typescript/archive/0.12.3.zip",
32+
strip_prefix = "rules_typescript-0.12.3",
33+
sha256 = "967068c3540f59407716fbeb49949c1600dbf387faeeab3089085784dd21f60c",
3434
)
3535

3636
# Setup TypeScript Bazel workspace
@@ -48,3 +48,9 @@ local_repository(
4848
name = "rxjs",
4949
path = "node_modules/rxjs/src",
5050
)
51+
52+
53+
# This commit matches the version of buildifier in angular/ngcontainer
54+
# If you change this, also check if it matches the version in the angular/ngcontainer
55+
# version in /.circleci/config.yml
56+
BAZEL_BUILDTOOLS_VERSION = "fd9878fd5de921e0bbab3dcdcb932c2627812ee1"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"systemjs": "0.19.43",
4040
"tsickle": "^0.27.2",
4141
"tslib": "^1.9.0",
42-
"zone.js": "^0.8.4"
42+
"zone.js": "^0.8.26"
4343
},
4444
"devDependencies": {
4545
"@angular-devkit/core": "^0.5.12",

src/cdk/a11y/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ ts_web_test(
4848
bootstrap = [
4949
"//:web_test_bootstrap_scripts",
5050
],
51-
tags = ["manual"],
5251
# Do not sort
5352
deps = [
5453
"//:tslib_bundle",

src/cdk/accordion/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ ts_library(
2929
ts_web_test(
3030
name = "unit_tests",
3131
bootstrap = ["//:web_test_bootstrap_scripts"],
32-
tags = ["manual"],
33-
3432
# Do not sort
3533
deps = [
3634
"//:tslib_bundle",

src/cdk/bidi/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ ts_web_test(
2727
bootstrap = [
2828
"//:web_test_bootstrap_scripts",
2929
],
30-
tags = ["manual"],
31-
3230
# Do not sort
3331
deps = [
3432
"//:tslib_bundle",

src/cdk/coercion/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ ts_library(
2222
ts_web_test(
2323
name = "unit_tests",
2424
bootstrap = ["//:web_test_bootstrap_scripts"],
25-
tags = ["manual"],
2625
deps = [":coercion_test_sources"],
2726
)

src/cdk/collections/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ ts_library(
2525
ts_web_test(
2626
name = "unit_tests",
2727
bootstrap = ["//:web_test_bootstrap_scripts"],
28-
tags = ["manual"],
29-
3028
# Do not sort
3129
deps = [
3230
"//:tslib_bundle",

src/cdk/layout/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ ts_library(
3030
ts_web_test(
3131
name = "unit_tests",
3232
bootstrap = ["//:web_test_bootstrap_scripts"],
33-
tags = ["manual"],
34-
3533
# Do not sort
3634
deps = [
3735
"//:tslib_bundle",

src/cdk/observers/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ ts_library(
2828
ts_web_test(
2929
name = "unit_tests",
3030
bootstrap = ["//:web_test_bootstrap_scripts"],
31-
tags = ["manual"],
32-
3331
# Do not sort
3432
deps = [
3533
"//:tslib_bundle",

src/cdk/portal/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ts_library(
2525
ts_web_test(
2626
name = "unit_tests",
2727
bootstrap = ["//:web_test_bootstrap_scripts"],
28-
tags = ["manual"],
2928
# Do not sort
3029
deps = [
3130
"//:tslib_bundle",

src/cdk/scrolling/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ ts_web_test(
3131
bootstrap = [
3232
"//:web_test_bootstrap_scripts",
3333
],
34-
tags = ["manual"],
35-
3634
# Do not sort
3735
deps = [
3836
"//:tslib_bundle",

src/cdk/table/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ ts_library(
3131
ts_web_test(
3232
name = "unit_tests",
3333
bootstrap = ["//:web_test_bootstrap_scripts"],
34-
tags = ["manual"],
3534
# Do not sort
3635
deps = [
3736
"//:tslib_bundle",

0 commit comments

Comments
 (0)