diff --git a/.bazelignore b/.bazelignore index bf1b2c45b2..cd61d32f8e 100644 --- a/.bazelignore +++ b/.bazelignore @@ -27,6 +27,7 @@ integration/injectable-def/node_modules integration/ivy-i18n/node_modules integration/language_service_plugin/node_modules integration/ng_elements/node_modules +integration/ng_elements_schematics/node_modules integration/ng_update/node_modules integration/ng_update_migrations/node_modules integration/ngcc/node_modules @@ -35,6 +36,7 @@ integration/service-worker-schema/node_modules integration/side-effects/node_modules integration/terser/node_modules integration/typings_test_ts36/node_modules +integration/typings_test_ts37/node_modules integration/cli-hello-world/.yarn_local_cache integration/cli-hello-world-ivy-compat/.yarn_local_cache integration/cli-hello-world-ivy-i18n/.yarn_local_cache @@ -49,6 +51,7 @@ integration/injectable-def/.yarn_local_cache integration/ivy-i18n/.yarn_local_cache integration/language_service_plugin/.yarn_local_cache integration/ng_elements/.yarn_local_cache +integration/ng_elements_schematics/.yarn_local_cache integration/ng_update/.yarn_local_cache integration/ng_update_migrations/.yarn_local_cache integration/ngcc/.yarn_local_cache @@ -57,4 +60,5 @@ integration/service-worker-schema/.yarn_local_cache integration/side-effects/.yarn_local_cache integration/terser/.yarn_local_cache integration/typings_test_ts36/.yarn_local_cache +integration/typings_test_ts37/.yarn_local_cache packages/bazel/node_modules diff --git a/.circleci/config.yml b/.circleci/config.yml index 3df0ffc506..a0b37f686e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -298,7 +298,7 @@ jobs: # as they require network access for yarn install), this test is running out of memory # consistently with the xlarge machine. # TODO: switch back to xlarge once integration tests are running on remote-exec - resource_class: 2xlarge + resource_class: 2xlarge+ steps: - custom_attach_workspace - init_environment @@ -308,21 +308,6 @@ jobs: command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only no_output_timeout: 20m - test_integration_bazel: - executor: - # Needed because the //integration:bazel-schematics_test test expect Chrome to be installed - name: browsers-executor - resource_class: xlarge - steps: - - custom_attach_workspace - - init_environment - - run: - # Run "exclusive" and "manual" bazel-in-bazel integration tests in their own CI job - # as they take 8m+ to execute and with bazel running inside bazel they are too - # memory intensive to be run in parallel with other tests so are tagged as "exclusive" - command: yarn bazel test //integration:bazel_test //integration:bazel-schematics_test - no_output_timeout: 20m - # Temporary job to test what will happen when we flip the Ivy flag to true test_ivy_aot: executor: @@ -842,9 +827,6 @@ workflows: - test: requires: - setup - - test_integration_bazel: - requires: - - setup - test_ivy_aot: requires: - setup diff --git a/integration/BUILD.bazel b/integration/BUILD.bazel index 8f119b4fda..b885ca4dbe 100644 --- a/integration/BUILD.bazel +++ b/integration/BUILD.bazel @@ -20,183 +20,45 @@ load(":angular_integration_test.bzl", "angular_integration_test") # ng_elements 4205 /e2e/browser.config.json: "port": 4205 # platform-server 4206 /src/server.ts: app.listen(4206,... +# Map of integration tests to tags. +# A subset of these tests fail or are not meant to be run with ivy bundles. These are tagged +# "no-ivy-aot". +INTEGRATION_TESTS = { + "bazel": ["no-ivy-aot"], + "bazel-schematics": ["no-ivy-aot"], + "cli-hello-world": [], + "cli-hello-world-ivy-compat": [], + "cli-hello-world-ivy-i18n": ["no-ivy-aot"], + "cli-hello-world-ivy-minimal": [], + "cli-hello-world-lazy": [], + "cli-hello-world-lazy-rollup": [], + "dynamic-compiler": ["no-ivy-aot"], + "hello_world__closure": ["no-ivy-aot"], + "i18n": ["no-ivy-aot"], + "injectable-def": ["no-ivy-aot"], + "ivy-i18n": ["no-ivy-aot"], + "language_service_plugin": [], + "ng_elements": ["no-ivy-aot"], + # TODO: fix ng_elements_schematics with Bazel which was added recently and uses a new pattern + # "ng_elements_schematics": ["no-ivy-aot"], + "ng_update": [], + "ng_update_migrations": ["no-ivy-aot"], + "ngcc": ["no-ivy-aot"], + "platform-server": ["no-ivy-aot"], + "service-worker-schema": [], + "side-effects": ["no-ivy-aot"], + "terser": [], +} + [ angular_integration_test( name = test_folder + "_test", + tags = INTEGRATION_TESTS[test_folder], test_folder = test_folder, ) - for test_folder in [ - "cli-hello-world", - "cli-hello-world-ivy-compat", - "cli-hello-world-ivy-minimal", - "cli-hello-world-lazy", - "cli-hello-world-lazy-rollup", - "language_service_plugin", - "ng_update", - "service-worker-schema", - "terser", - ] + for test_folder in INTEGRATION_TESTS ] -# The following tests should not be run with npm packages generated with `--config=ivy` -[ - angular_integration_test( - name = test_folder + "_test", - tags = ["no-ivy-aot"], - test_folder = test_folder, - ) - for test_folder in [ - # `injectable-def` has .ngfactory imports: - # ``` - # FAIL: Expected 'ngcc' to add build marker for 'esm2015' in '@angular/common'. - # ``` - # as it is not expecting the @angular bundles to be generated with `--define=compile=aot` - "injectable-def", - # `ngcc` fails with: - # ``` - # + ngc -p tsconfig-app.json - # src/main.ts(5,34): error TS2307: Cannot find module './app.ngfactory'. - # Error during template compile of 'AppModule' - # Function calls are not supported in decorators but 'BrowserModule' was called. - # ``` - "ngcc", - # `ng_update_migrations` has golden tests failures such as: - # ``` - # ✘ File "src/app/migration-tests/undecorated-derived-classes.ts" does not match the expected output. - # -------------------------------------------- - # --- src/app/migration-tests/undecorated-derived-classes.ts Expected content - # +++ src/app/migration-tests/undecorated-derived-classes.ts Actual content - # @@ -1,50 +1,19 @@ - # -import { Directive, NgModule, NgZone, Component } from '@angular/core'; - # -import { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR, NG_ASYNC_VALIDATORS } from '@angular/forms'; - # -import { BaseComponentFromOtherFile, hostBindings } from './base-component'; - # +import {Directive, NgModule, NgZone} from '@angular/core'; - # +import {CheckboxControlValueAccessor} from '@angular/forms'; - # +import {BaseComponentFromOtherFile} from './base-component'; - # ``` - "ng_update_migrations", - # `i18n` has .ngfactory imports: - # ``` - # $ ngc && yarn run closure && concurrently "yarn run serve" "yarn run protractor" --kill-others --success first && npm run test-locale-folder - # src/main.ts(2,34): error TS2307: Cannot find module './app.ngfactory'. - # Unexpected value 'BrowserModule in /private/var/folders/0l/nj_q9kzj49gdz1w6f5v9tw3h0000gn/T/tmp-58883IJeiUMLGHRRQ/node_modules/@angular/platform-browser/src/browser.d.ts' imported by the module 'AppModule in /private/var/folders/0l/nj_q9kzj49gdz1w6f5v9tw3h0000gn/T/tmp-58883IJeiUMLGHRRQ/src/app.ts'. Please add a @NgModule annotation. - # ``` - "i18n", - # `ivy-i18n` fails with: - # ``` - # ERROR in Unexpected value 'BrowserModule in /private/var/folders/0l/nj_q9kzj49gdz1w6f5v9tw3h0000gn/T/tmp-59999cYHm5rQoUk0v/node_modules/@angular/platform-browser/src/browser.d.ts' imported by the module 'AppModule in /private/var/folders/0l/nj_q9kzj49gdz1w6f5v9tw3h0000gn/T/tmp-59999cYHm5rQoUk0v/src/app/app.module.ts'. Please add a @NgModule annotation. - # @angular/core/src/i18n/tokens.ts(31,22): Error during template compile of 'LOCALE_ID' - # Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler. - # Can't resolve all parameters for AppComponent in /private/var/folders/0l/nj_q9kzj49gdz1w6f5v9tw3h0000gn/T/tmp-59999cYHm5rQoUk0v/src/app/app.component.ts: (?). - # The pipe 'percent' could not be found (" - # - #

{{ locale }}

- #

{{ [ERROR ->]1 | percent }} awesome

- #

{{ jan | date : 'LLLL' }}

- #

Here are some links to help") - # The pipe 'date' could not be found (" - #

{{ locale }}

- #

{{ 1 | percent }} awesome

- #

{{ [ERROR ->]jan | date : 'LLLL' }}

- #

Here are some links to help you start:

- #