diff --git a/.bazelignore b/.bazelignore index cf8684fede0..99de13a1b74 100644 --- a/.bazelignore +++ b/.bazelignore @@ -9,14 +9,9 @@ aio/content aio/node_modules aio/tools/examples/shared/node_modules packages/bazel/node_modules -integration/bazel/bazel-bazel -integration/bazel/bazel-bin -integration/bazel/bazel-out -integration/bazel/bazel-testlogs -integration/bazel-schematics/demo + # All integration test node_modules folders -integration/bazel/node_modules -integration/bazel-schematics/node_modules +integration/bazel_workspace_tests/bazel_ngtsc_plugin/node_modules integration/cli-elements-universal/node_modules integration/cli-hello-world/node_modules integration/cli-hello-world-ivy-compat/node_modules @@ -29,6 +24,9 @@ integration/hello_world__systemjs_umd/node_modules integration/i18n/node_modules integration/injectable-def/node_modules integration/ivy-i18n/node_modules +integration/ng-add-localize/node_modules +integration/trusted-types/node_modules +integration/forms/node_modules integration/ng_elements/node_modules integration/ng_elements_schematics/node_modules integration/ng_update/node_modules @@ -40,9 +38,9 @@ integration/side-effects/node_modules integration/terser/node_modules integration/typings_test_ts36/node_modules integration/typings_test_ts37/node_modules + # All integration test .yarn_local_cache folders -integration/bazel/.yarn_local_cache -integration/bazel-schematics/.yarn_local_cache +integration/bazel_workspace_tests/bazel_ngtsc_plugin/.yarn_local_cache integration/cli-elements-universal/.yarn_local_cache integration/cli-hello-world/.yarn_local_cache integration/cli-hello-world-ivy-compat/.yarn_local_cache @@ -55,6 +53,9 @@ integration/hello_world__systemjs_umd/.yarn_local_cache integration/i18n/.yarn_local_cache integration/injectable-def/.yarn_local_cache integration/ivy-i18n/.yarn_local_cache +integration/ng-add-localize/.yarn_local_cache +integration/trusted-types/.yarn_local_cache +integration/forms/.yarn_local_cache integration/ng_elements/.yarn_local_cache integration/ng_elements_schematics/.yarn_local_cache integration/ng_update/.yarn_local_cache @@ -66,29 +67,3 @@ 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 -# All integration test NPM_PACKAGE_MANIFEST.json folders -integration/bazel/NPM_PACKAGE_MANIFEST.json -integration/bazel-schematics/NPM_PACKAGE_MANIFEST.json -integration/cli-elements-universal/NPM_PACKAGE_MANIFEST.json -integration/cli-hello-world/NPM_PACKAGE_MANIFEST.json -integration/cli-hello-world-ivy-compat/NPM_PACKAGE_MANIFEST.json -integration/cli-hello-world-ivy-i18n/NPM_PACKAGE_MANIFEST.json -integration/cli-hello-world-ivy-minimal/NPM_PACKAGE_MANIFEST.json -integration/cli-hello-world-lazy/NPM_PACKAGE_MANIFEST.json -integration/dynamic-compiler/NPM_PACKAGE_MANIFEST.json -integration/hello_world__closure/NPM_PACKAGE_MANIFEST.json -integration/hello_world__systemjs_umd/NPM_PACKAGE_MANIFEST.json -integration/i18n/NPM_PACKAGE_MANIFEST.json -integration/injectable-def/NPM_PACKAGE_MANIFEST.json -integration/ivy-i18n/NPM_PACKAGE_MANIFEST.json -integration/ng_elements/NPM_PACKAGE_MANIFEST.json -integration/ng_elements_schematics/NPM_PACKAGE_MANIFEST.json -integration/ng_update/NPM_PACKAGE_MANIFEST.json -integration/ng_update_migrations/NPM_PACKAGE_MANIFEST.json -integration/ngcc/NPM_PACKAGE_MANIFEST.json -integration/platform-server/NPM_PACKAGE_MANIFEST.json -integration/service-worker-schema/NPM_PACKAGE_MANIFEST.json -integration/side-effects/NPM_PACKAGE_MANIFEST.json -integration/terser/NPM_PACKAGE_MANIFEST.json -integration/typings_test_ts36/NPM_PACKAGE_MANIFEST.json -integration/typings_test_ts37/NPM_PACKAGE_MANIFEST.json diff --git a/.bazelrc b/.bazelrc index 63e1d56d86c..b623df5d45b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -71,16 +71,6 @@ test --test_output=errors # Bazel flags for CircleCI are in /.circleci/bazel.linux.rc and /.circleci/bazel.windows.rc -################################## -# Settings for integration tests # -################################## - -# Trick bazel into treating BUILD files under integration/bazel as being regular files -# This lets us glob() up all the files inside this integration test to make them inputs to tests -# (Note, we cannot use common --deleted_packages because the bazel version command doesn't support it) -build --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/tools,integration/bazel/test/e2e -query --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/tools,integration/bazel/test/e2e - ################################## # Remote Build Execution support # # Turn on these settings with # @@ -140,8 +130,8 @@ build --flag_alias=ng_perf=//packages/compiler-cli:ng_perf # The nested Bazel integration test workspace should not be analysed as part of # Skyframe, but should also not be ignored in order to be able to glob for its files. # TODO: Simplify this once https://github.com/bazelbuild/bazel/issues/12034 is fixed -build --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e,integration/bazel/tools,integration/bazel/tools/angular -query --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e,integration/bazel/tools,integration/bazel/tools/angular +build --deleted_packages=integration/bazel_workspace_tests/bazel_ngtsc_plugin,integration/bazel_workspace_tests/bazel_ngtsc_plugin/src,integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world,integration/bazel_workspace_tests/bazel_ngtsc_plugin/test,integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e,integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools,integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular +query --deleted_packages=integration/bazel_workspace_tests/bazel_ngtsc_plugin,integration/bazel_workspace_tests/bazel_ngtsc_plugin/src,integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world,integration/bazel_workspace_tests/bazel_ngtsc_plugin/test,integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e,integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools,integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular #################################################### # User bazel configuration diff --git a/integration/README.md b/integration/README.md index 792a06ac1ca..9479ab7e18a 100644 --- a/integration/README.md +++ b/integration/README.md @@ -104,7 +104,7 @@ When adding a new integration test, follow the steps below to add a bazel test t 1. `integration/new_test/node_modules` 2. `integration/new_test/.yarn_local_cache` 4. Add any other untracked folders to `.bazelignore` that may contain `BUILD` files -5. If there are BUILD files in the integration test folder (except for the top-level one defining the test), add those folders to the `--deleted_packages` in the `.bazelrc`. An example is the `bazel` integration test. +5. If there are BUILD files in the integration test folder (except for the top-level one defining the test), add those folders to the `--deleted_packages` in the `.bazelrc`. An example is the `bazel_ngtsc_plugin` test within `//integration/bazel_workspace_tests`. ## Manually configured ports diff --git a/integration/bazel_workspace_tests/BUILD.bazel b/integration/bazel_workspace_tests/BUILD.bazel new file mode 100644 index 00000000000..697058170d7 --- /dev/null +++ b/integration/bazel_workspace_tests/BUILD.bazel @@ -0,0 +1,23 @@ +load("//integration:index.bzl", "ng_integration_test") + +package(default_visibility = ["//visibility:public"]) + +ng_integration_test( + name = "bazel_ngtsc_plugin_test", + srcs = glob(["bazel_ngtsc_plugin/**"]), + environment = { + # Setup a HOME directory so that Bazelisk can work, both Linux/macOS and Windows variants + # are configured to provide a fake home directory so that Bazelisk can download Bazel. + "HOME": "", + "LOCALAPPDATA": "", + }, + tags = [ + # Bazel-in-bazel tests are resource intensive and should not be over-parallelized + # as they will compete for the resources of other parallel tests slowing + # everything down. Ask Bazel to allocate multiple CPUs for these tests with "cpu:n" tag. + "cpu:3", + ], + # Nested bazel workspace tests need to be declared at a higher-level because the test + # cannot be wired up within the `BUILD.bazel` file as part of the actual test workspace. + working_dir = "bazel_ngtsc_plugin/", +) diff --git a/integration/bazel/.bazelignore b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelignore similarity index 100% rename from integration/bazel/.bazelignore rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelignore diff --git a/integration/bazel/.bazelrc b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelrc similarity index 100% rename from integration/bazel/.bazelrc rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelrc diff --git a/integration/bazel/.bazelversion b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelversion similarity index 100% rename from integration/bazel/.bazelversion rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/.bazelversion diff --git a/integration/bazel/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/BUILD.bazel similarity index 100% rename from integration/bazel/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/BUILD.bazel diff --git a/integration/bazel/WORKSPACE b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/WORKSPACE similarity index 98% rename from integration/bazel/WORKSPACE rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/WORKSPACE index f62354a4040..b119567468d 100644 --- a/integration/bazel/WORKSPACE +++ b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/WORKSPACE @@ -1,4 +1,4 @@ -workspace(name = "bazel_integration_test") +workspace(name = "bazel_ngtsc_plugin") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") diff --git a/integration/bazel/package.json b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/package.json similarity index 90% rename from integration/bazel/package.json rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/package.json index f2a04a6fc92..acd2a1cbabc 100644 --- a/integration/bazel/package.json +++ b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/package.json @@ -49,10 +49,6 @@ "terser": "file:../../node_modules/terser", "typescript": "file:../../node_modules/typescript" }, - "//resolutions-comment": "Ensure a single version of webdriver-manager which comes from root node_modules that has already run webdriver-manager update", - "resolutions": { - "**/webdriver-manager": "file:../../node_modules/webdriver-manager" - }, "scripts": { "test": "bazelisk build ... --noshow_progress && bazelisk test ..." } diff --git a/integration/bazel/packages.bzl b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/packages.bzl similarity index 100% rename from integration/bazel/packages.bzl rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/packages.bzl diff --git a/integration/bazel/protractor.conf.js b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/protractor.conf.js similarity index 100% rename from integration/bazel/protractor.conf.js rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/protractor.conf.js diff --git a/integration/bazel/src/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/BUILD.bazel similarity index 100% rename from integration/bazel/src/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/BUILD.bazel diff --git a/integration/bazel/src/app-routing.module.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app-routing.module.ts similarity index 100% rename from integration/bazel/src/app-routing.module.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app-routing.module.ts diff --git a/integration/bazel/src/app.component.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app.component.ts similarity index 100% rename from integration/bazel/src/app.component.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app.component.ts diff --git a/integration/bazel/src/app.module.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app.module.ts similarity index 100% rename from integration/bazel/src/app.module.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/app.module.ts diff --git a/integration/bazel/src/bundle-esbuild.config.mjs b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/bundle-esbuild.config.mjs similarity index 100% rename from integration/bazel/src/bundle-esbuild.config.mjs rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/bundle-esbuild.config.mjs diff --git a/integration/bazel/src/hello-world/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/BUILD.bazel similarity index 100% rename from integration/bazel/src/hello-world/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/BUILD.bazel diff --git a/integration/bazel/src/hello-world/hello-world.component.scss b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.scss similarity index 100% rename from integration/bazel/src/hello-world/hello-world.component.scss rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.scss diff --git a/integration/bazel/src/hello-world/hello-world.component.spec.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.spec.ts similarity index 100% rename from integration/bazel/src/hello-world/hello-world.component.spec.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.spec.ts diff --git a/integration/bazel/src/hello-world/hello-world.component.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.ts similarity index 100% rename from integration/bazel/src/hello-world/hello-world.component.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.component.ts diff --git a/integration/bazel/src/hello-world/hello-world.module.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.module.ts similarity index 100% rename from integration/bazel/src/hello-world/hello-world.module.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/hello-world.module.ts diff --git a/integration/bazel/src/hello-world/index.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/index.ts similarity index 100% rename from integration/bazel/src/hello-world/index.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/hello-world/index.ts diff --git a/integration/bazel/src/index.html b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/index.html similarity index 100% rename from integration/bazel/src/index.html rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/index.html diff --git a/integration/bazel/src/main.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/main.ts similarity index 100% rename from integration/bazel/src/main.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/main.ts diff --git a/integration/bazel/src/tsconfig.json b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/tsconfig.json similarity index 100% rename from integration/bazel/src/tsconfig.json rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/src/tsconfig.json diff --git a/integration/bazel/test/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/BUILD.bazel similarity index 100% rename from integration/bazel/test/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/BUILD.bazel diff --git a/integration/bazel/test/angular_test_init.spec.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/angular_test_init.spec.ts similarity index 100% rename from integration/bazel/test/angular_test_init.spec.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/angular_test_init.spec.ts diff --git a/integration/bazel/test/e2e/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/BUILD.bazel similarity index 100% rename from integration/bazel/test/e2e/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/BUILD.bazel diff --git a/integration/bazel/test/e2e/app.spec.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/app.spec.ts similarity index 100% rename from integration/bazel/test/e2e/app.spec.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/app.spec.ts diff --git a/integration/bazel/test/e2e/on-prepare.ts b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/on-prepare.ts similarity index 100% rename from integration/bazel/test/e2e/on-prepare.ts rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/on-prepare.ts diff --git a/integration/bazel/test/e2e/tsconfig.json b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/tsconfig.json similarity index 100% rename from integration/bazel/test/e2e/tsconfig.json rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/test/e2e/tsconfig.json diff --git a/integration/bazel/tools/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/BUILD.bazel similarity index 100% rename from integration/bazel/tools/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/BUILD.bazel diff --git a/integration/bazel/tools/angular/BUILD.bazel b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular/BUILD.bazel similarity index 100% rename from integration/bazel/tools/angular/BUILD.bazel rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular/BUILD.bazel diff --git a/integration/bazel/tools/angular/index.bzl b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular/index.bzl similarity index 100% rename from integration/bazel/tools/angular/index.bzl rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/angular/index.bzl diff --git a/integration/bazel/tools/ng_ts_library.bzl b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/ng_ts_library.bzl similarity index 100% rename from integration/bazel/tools/ng_ts_library.bzl rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/ng_ts_library.bzl diff --git a/integration/bazel/tools/rxjs_shims.js b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/rxjs_shims.js similarity index 100% rename from integration/bazel/tools/rxjs_shims.js rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/tools/rxjs_shims.js diff --git a/integration/bazel/yarn.lock b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/yarn.lock similarity index 99% rename from integration/bazel/yarn.lock rename to integration/bazel_workspace_tests/bazel_ngtsc_plugin/yarn.lock index 5c44ed3ac7e..8d26adfddf4 100644 --- a/integration/bazel/yarn.lock +++ b/integration/bazel_workspace_tests/bazel_ngtsc_plugin/yarn.lock @@ -2418,7 +2418,7 @@ rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0: source-map-resolve "^0.6.0" "rollup@file:../../node_modules/rollup": - version "2.58.3" + version "2.59.0" optionalDependencies: fsevents "~2.3.2" @@ -2811,7 +2811,7 @@ type-is@~1.6.17: mime-types "~2.1.24" "typescript@file:../../node_modules/typescript": - version "4.4.3" + version "4.4.4" typescript@~4.4.2: version "4.4.4" @@ -2902,8 +2902,10 @@ webdriver-js-extender@2.1.0: "@types/selenium-webdriver" "^3.0.0" selenium-webdriver "^3.0.1" -webdriver-manager@^12.1.7, "webdriver-manager@file:../../node_modules/webdriver-manager": +webdriver-manager@^12.1.7: version "12.1.8" + resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.8.tgz#5e70e73eaaf53a0767d5745270addafbc5905fd4" + integrity sha512-qJR36SXG2VwKugPcdwhaqcLQOD7r8P2Xiv9sfNbfZrKBnX243iAkOueX1yAmeNgIKhJ3YAT/F2gq6IiEZzahsg== dependencies: adm-zip "^0.4.9" chalk "^1.1.1"