Skip to content

Commit 30f319a

Browse files
IgorMinarmatsko
authored andcommitted
build: remove ivy build/test tag hackery now that we can (angular#26735)
With bazel-contrib/rules_nodejs#388 fixed we can stop messing around with tags and just rely on the explicitly defined tags. PR Close angular#26735
1 parent 5d7ba57 commit 30f319a

File tree

4 files changed

+17
-33
lines changed

4 files changed

+17
-33
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131

132132
- run: bazel run @yarn//:yarn
133133
- *setup_bazel_remote_execution
134-
- run: bazel test //... --define=compile=jit --build_tag_filters=ivy-jit --test_tag_filters=ivy-jit
134+
- run: bazel test //... --define=compile=jit --build_tag_filters=-no-ivy-jit,-fixme-ivy-jit --test_tag_filters=-no-ivy-jit,-fixme-ivy-jit
135135

136136
test_ivy_aot:
137137
<<: *job_defaults
@@ -144,7 +144,7 @@ jobs:
144144

145145
- run: bazel run @yarn//:yarn
146146
- *setup_bazel_remote_execution
147-
- run: bazel test //... --define=compile=aot --build_tag_filters=ivy-aot --test_tag_filters=ivy-aot
147+
- run: bazel test //... --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot
148148

149149
test_aio:
150150
<<: *job_defaults

docs/BAZEL.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,20 @@ keeps the outputs up-to-date as you save sources.
7272

7373
If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.
7474

75-
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=ivy=false` is defined as default.
75+
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=compile=legacy` is defined as default.
7676

7777
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
7878
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
7979
- `--define=compile=<option>` Controls if ivy or legacy mode is enabled. This switches which compiler is used (ngc, ngtsc, or a tsc pass-through mode).
8080
- `legacy`: (default behavior) compile against View Engine, e.g. `--define=compile=legacy`
8181
- `jit`: Compile in ivy JIT mode, e.g. `--define=compile=jit`
8282
- `aot`: Compile in ivy AOT move, e.g. `--define=compile=aot`
83-
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config
84-
of your rules in any given `BUILD.bazel`.
85-
- `ivy-jit`: This flag should be set for tests that should be excuted with ivy JIT, e.g. `--test_tag_filters=ivy-jit`. For this, you may have to include `--define=compile=jit`.
86-
- `ivy-aot`: Only run tests that have to do with ivy AOT. For this, you may have to include `--define=compile=aot`, e.g. `--test_tag_filters=ivy-aot`..
87-
- `ivy-only`: Only run ivy related tests, e.g. `--test_tag_filters=ivy-only`.
83+
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config of your rules in any given `BUILD.bazel`.
84+
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--define=compile=aot`).
85+
- `no-ivy-jit`: Useful for excluding build and test targets that are not meant to be executed in Ivy JIT mode (`--define=compile=jit`).
86+
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--define=compile=legacy`.
87+
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--define=compile=aot`).
88+
- `fixme-ivy-jit`: Useful for including/excluding build and test targets that are currently broken in Ivy JIT mode (`--define=compile=jit`).
8889

8990

9091
### Debugging a Node Test

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
2727
"check-env": "gulp check-env",
2828
"commitmsg": "node ./scripts/git/commit-msg.js",
29-
"test-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=ivy-jit --test_tag_filters=ivy-jit",
30-
"test-fixme-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=-no-ivy --test_tag_filters=-no-ivy",
31-
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=ivy-aot --test_tag_filters=ivy-aot",
32-
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy --test_tag_filters=-no-ivy"
29+
"test-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=-no-ivy-jit,-fixme-ivy-jit --test_tag_filters=-no-ivy-jit,-fixme-ivy-jit",
30+
"test-fixme-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=-no-ivy-jit --test_tag_filters=-no-ivy-jit",
31+
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
32+
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot"
3333
},
3434
"dependencies": {
3535
"@angular-devkit/schematics": "^0.5.5",

tools/defaults.bzl

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PKG_GROUP_REPLACEMENTS = {
4444
]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_SCOPED_PACKAGES]),
4545
}
4646

47-
def ts_library(tsconfig = None, testonly = False, deps = [], tags = [], **kwargs):
47+
def ts_library(tsconfig = None, testonly = False, deps = [], **kwargs):
4848
"""Default values for ts_library"""
4949
deps = deps + ["@ngdeps//tslib"]
5050
if testonly:
@@ -62,11 +62,10 @@ def ts_library(tsconfig = None, testonly = False, deps = [], tags = [], **kwargs
6262
testonly = testonly,
6363
deps = deps,
6464
node_modules = _DEFAULT_TS_TYPINGS,
65-
tags = ivy_tags(tags),
6665
**kwargs
6766
)
6867

69-
def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], tags = [], **kwargs):
68+
def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], **kwargs):
7069
"""Default values for ng_module"""
7170
deps = deps + ["@ngdeps//tslib"]
7271
if testonly:
@@ -90,7 +89,6 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
9089
compiler = _INTERNAL_NG_MODULE_COMPILER,
9190
ng_xi18n = _INTERNAL_NG_MODULE_XI18N,
9291
node_modules = _DEFAULT_TS_TYPINGS,
93-
tags = ivy_tags(tags),
9492
**kwargs
9593
)
9694

@@ -152,7 +150,7 @@ def npm_package(name, replacements = {}, **kwargs):
152150
**kwargs
153151
)
154152

155-
def ts_web_test_suite(bootstrap = [], deps = [], tags = [], **kwargs):
153+
def ts_web_test_suite(bootstrap = [], deps = [], **kwargs):
156154
"""Default values for ts_web_test_suite"""
157155
if not bootstrap:
158156
bootstrap = ["//:web_test_bootstrap_scripts"]
@@ -175,7 +173,6 @@ def ts_web_test_suite(bootstrap = [], deps = [], tags = [], **kwargs):
175173
# "@io_bazel_rules_webtesting//browsers:firefox-local",
176174
# TODO(alexeagle): add remote browsers on SauceLabs
177175
],
178-
tags = ivy_tags(tags),
179176
**kwargs
180177
)
181178

@@ -188,7 +185,7 @@ def nodejs_binary(data = [], **kwargs):
188185
**kwargs
189186
)
190187

191-
def jasmine_node_test(deps = [], tags = [], **kwargs):
188+
def jasmine_node_test(deps = [], **kwargs):
192189
"""Default values for jasmine_node_test"""
193190
deps = deps + [
194191
# Very common dependencies for tests
@@ -204,7 +201,6 @@ def jasmine_node_test(deps = [], tags = [], **kwargs):
204201
]
205202
_jasmine_node_test(
206203
deps = deps,
207-
tags = ivy_tags(tags),
208204
# Pass-thru --define=compile=foo as an environment variable
209205
configuration_env_vars = ["compile"],
210206
**kwargs
@@ -219,16 +215,3 @@ def ng_rollup_bundle(deps = [], **kwargs):
219215
deps = deps,
220216
**kwargs
221217
)
222-
223-
def ivy_tags(tags):
224-
"""Sets inclusive ivy-jit and ivy-local tags"""
225-
226-
# Set the tags by default unless no-ivy-jit, no-ivy-aot, fixme-ivy-jit, or fixme-ivy-aot were specified.
227-
# We should remove this and use only explicitly defined tags once https://github.com/bazelbuild/rules_nodejs/pull/388 is fixed.
228-
if not tags:
229-
tags = ["ivy-jit", "ivy-aot"]
230-
elif "no-ivy-jit" not in tags and "fixme-ivy-jit" not in tags:
231-
tags = tags + ["ivy-jit"]
232-
elif "no-ivy-aot" not in tags and "fixme-ivy-aot" not in tags:
233-
tags = tags + ["ivy-aot"]
234-
return tags

0 commit comments

Comments
 (0)