build: migrate references and scripts that set to build with ivy via compile=aot to use config=ivy (#33983)

Since config=ivy now sets the define=compile flag and the define=angular_ivy_enabled
flag to cause usage of Ivy, we can update all of the documentation and scripts that
reference compile=aot to use config=ivy.

PR Close #33983
This commit is contained in:
Joey Perrott 2019-11-22 12:07:29 -08:00 committed by Matias Niemelä
parent f9def8cd30
commit 5e3f6d203d
10 changed files with 29 additions and 30 deletions

View File

@ -37,7 +37,7 @@
"program": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test/acceptance",
"--config=debug"
],
@ -54,7 +54,7 @@
"program": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test/render3",
"--config=debug"
],
@ -71,7 +71,7 @@
"program": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test",
"--config=debug"
],

View File

@ -9,7 +9,7 @@
"command": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test",
"packages/core/test/acceptance",
"packages/core/test/render3",
@ -42,7 +42,7 @@
"command": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test/acceptance",
],
"group": "test",
@ -71,7 +71,7 @@
"command": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test",
],
"group": "test",
@ -100,7 +100,7 @@
"command": "${workspaceFolder}/node_modules/.bin/bazel",
"args": [
"test",
"--define=compile=aot",
"--config=ivy",
"packages/core/test/render3",
],
"group": "test",

View File

@ -59,17 +59,16 @@ keeps the outputs up-to-date as you save sources.
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.
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=compile=legacy` is defined as default.
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=angular_ivy_enabled=False` is defined as default.
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
- `--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).
- `legacy`: (default behavior) compile against View Engine, e.g. `--define=compile=legacy`
- `aot`: Compile in ivy AOT mode, e.g. `--define=compile=aot`
- `--config=ivy` Enables ivy mode if present, otherwise ViewEngine is used. This switches which compiler is used (ngc or ngtsc)
- `--config=view-engine` Enables ViewEngine mode if present, currentl this the default mode. This switches which compiler is used (ngc or ngtsc)
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config of your rules in any given `BUILD.bazel`.
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--define=compile=aot`).
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--define=compile=legacy`.
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--define=compile=aot`).
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--config=ivy`).
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--config=view-engine`.
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--config=ivy`).
### Debugging a Node Test

View File

@ -20,7 +20,7 @@ node ./scripts/ci/update-deps-to-dist-packages.js {COMPONENTS_REPO}/package.json
following command:
```bash
yarn test --deleted_packages=//src/dev-app --define=compile=aot
yarn test --deleted_packages=//src/dev-app --config=ivy
```
### Running tests for individual entry-points
@ -31,10 +31,10 @@ and entry-points. Running tests for an individual entry-point is possible by exp
selecting a given test target.
Here is an example of commands that run individual test targets. Note that it is
**important** to specify the `--define=compile=aot` flag in order to run tests with Ivy.
**important** to specify the `--config=ivy` flag in order to run tests with Ivy.
```bash
yarn bazel test --define=compile=aot src/material/slider:unit_tests
yarn bazel test --define=compile=aot src/cdk/a11y:unit_tests
yarn bazel test --define=compile=aot src/material/toolbar:unit_tests
yarn bazel test --config=ivy src/material/slider:unit_tests
yarn bazel test --config=ivy src/cdk/a11y:unit_tests
yarn bazel test --config=ivy src/material/toolbar:unit_tests
```

View File

@ -24,14 +24,14 @@
"update-webdriver": "webdriver-manager update --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
"check-env": "gulp check-env",
"commitmsg": "node ./scripts/git/commit-msg.js",
"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",
"test-ivy-aot": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
"test-non-ivy": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only",
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot",
"test-fixme-ivy-aot": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot",
"list-fixme-ivy-targets": "bazel query --output=label 'attr(\"tags\", \"\\[.*fixme-ivy.*\\]\", //...) except kind(\"sh_binary\", //...) except kind(\"devmode_js_sources\", //...)' | sort",
"bazel": "bazel",
"//circleci-win-comment": "See the test-win circleci job for why these are needed. If they are not needed anymore, remove them.",
"circleci-win-ve": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //packages/compiler-cli/...",
"circleci-win-ivy": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/..."
"circleci-win-ivy": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/..."
},
"// 1": "dependencies are used locally and by bazel",
"dependencies": {

View File

@ -1,5 +1,5 @@
Tests in this directory should be run with:
```
yarn bazel test --define=compile=aot packages/compiler-cli/test/compliance:compliance
yarn bazel test --config=ivy packages/compiler-cli/test/compliance:compliance
```

View File

@ -17,7 +17,7 @@ import {getComponent, getContext, getDebugNode, getDirectives, getHostElement, g
*
* To see this in action run the following command:
*
* bazel run --define=compile=aot
* bazel run --config=ivy
* //packages/core/test/bundling/todo:devserver
*
* Then load `localhost:5432` and start using the console tools.

View File

@ -1,7 +1,7 @@
### Build
```
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --define=compile=aot
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --config=ivy
```
### Run
@ -72,9 +72,9 @@ The resulting output should look something like this:
### Notes
To run the benchmark use `bazel run <benchmark_target>`, example:
- `yarn bazel run --define=compile=aot //packages/core/test/render3/perf:noop_change_detection`
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection`
To profile, append `_profile` to the target name and attach a debugger via chrome://inspect, example:
- `yarn bazel run --define=compile=aot //packages/core/test/render3/perf:noop_change_detection_profile`
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection_profile`
To interactively edit/rerun benchmarks use `ibazel` instead of `bazel`.

View File

@ -29,7 +29,7 @@ const profileTests =
// build tests
shell.exec(
`yarn bazel build --define=compile=aot ` +
`yarn bazel build --config=ivy ` +
profileTests.map((name) => `//packages/core/test/render3/perf:${name}_lib.min_debug.es2015.js`)
.join(' '));

View File

@ -6,9 +6,9 @@
</script>
<body>
<ol>
<li>Build the benchmark using <tt>yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --define=compile=aot</tt></li>
<li>Build the benchmark using <tt>yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --config=ivy</tt></li>
<li>Open this file using the <tt>file://</tt> protocol and add <tt>?benchmark=BENCHMARK</tt> to the URL.</li>
<li>Open debug console for details</li>
</ol>
</body>
</html>
</html>