build: migrate integration tests to use @devinfra dependencies (#62302)

Use @devinfra// dependencies for integration tests

PR Close #62302
This commit is contained in:
Joey Perrott
2025-06-26 18:23:09 +00:00
committed by Jessica Janiuk
parent 69c8a24662
commit 69ddabb11c
2 changed files with 8 additions and 15 deletions
+7 -14
View File
@@ -7,12 +7,11 @@
load("@devinfra//bazel/integration:index.bzl", "integration_test")
load("//:packages.bzl", "INTEGRATION_PACKAGES")
load("//integration:npm_package_archives.bzl", "NPM_PACKAGE_ARCHIVES", "npm_package_archive_label")
load("//integration:npm_package_archives.bzl", "NPM_PACKAGE_ARCHIVES")
def _ng_integration_test(name, setup_chromium = False, **kwargs):
"Set defaults for the npm_integration_test common to the angular repo"
pinned_npm_packages = kwargs.pop("pinned_npm_packages", [])
use_view_engine_packages = kwargs.pop("use_view_engine_packages", [])
toolchains = kwargs.pop("toolchains", [])
environment = kwargs.pop("environment", {})
track_payload_size = kwargs.pop("track_payload_size", None)
@@ -20,11 +19,11 @@ def _ng_integration_test(name, setup_chromium = False, **kwargs):
data = kwargs.pop("data", [])
if setup_chromium:
data.append("@npm//@angular/build-tooling/bazel/browsers/chromium")
toolchains.append("@npm//@angular/build-tooling/bazel/browsers/chromium:toolchain_alias")
data.append("@rules_browsers//src/browsers/chromium")
toolchains.append("@rules_browsers//src/browsers/chromium:toolchain_alias")
environment.update({
"CHROMEDRIVER_BIN": "$(CHROMEDRIVER)",
"CHROME_BIN": "$(CHROMIUM)",
"CHROME_BIN": "$(CHROME-HEADLESS-SHELL)",
})
# By default run `yarn install` followed by `yarn test` using the tools linked
@@ -57,16 +56,10 @@ def _ng_integration_test(name, setup_chromium = False, **kwargs):
npm_packages = {}
for pkg in NPM_PACKAGE_ARCHIVES:
if pkg not in pinned_npm_packages:
npm_packages["@npm//:" + npm_package_archive_label(pkg)] = pkg
npm_packages["//:node_modules/%s/dir" % pkg] = pkg
for pkg in INTEGRATION_PACKAGES:
# If the generated Angular framework package is listed in the `use_view_engine_packages`
# list, we will not use the local-built NPM package, but instead map to the
# corresponding View Engine v12.x package from the `@npm//` workspace.
if pkg in use_view_engine_packages:
npm_packages["@npm//:" + npm_package_archive_label("%s-12" % pkg)] = pkg
else:
last_segment_name = pkg.split("/")[-1]
npm_packages["//packages/%s:npm_package_archive" % last_segment_name] = pkg
last_segment_name = pkg.split("/")[-1]
npm_packages["//packages/%s:npm_package_archive" % last_segment_name] = pkg
integration_test(
name = name,
+1 -1
View File
@@ -4,6 +4,6 @@ ng_integration_test(
name = "test",
# Special case for `typings_test_ts58` test as we want to pin
# `typescript` at version 5.8.x for that test and not link to the
# root @npm//typescript package.
# root typescript package.
pinned_npm_packages = ["typescript"],
)