Skip to content

Commit

Permalink
ci: set CHROME_PATH environment variable to Bazel's Chrome install
Browse files Browse the repository at this point in the history
This variable is used by Chrome launcher under Web Test Runner to find and execute Chrome.
  • Loading branch information
dgp1130 committed Jan 4, 2024
1 parent 5495819 commit 7bf4dd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/legacy-cli/e2e.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def _e2e_tests(name, runner, **kwargs):
# Chromium browser toolchain
env.update({
"CHROME_BIN": "$(CHROMIUM)",
"CHROME_PATH": "$(CHROMIUM)",
"CHROMEDRIVER_BIN": "$(CHROMEDRIVER)",
})
toolchains = toolchains + ["@npm//@angular/build-tooling/bazel/browsers/chromium:toolchain_alias"]
Expand Down
1 change: 1 addition & 0 deletions tests/legacy-cli/e2e/utils/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function extractCIEnv(): NodeJS.ProcessEnv {
v === 'CI' ||
v === 'CIRCLECI' ||
v === 'CHROME_BIN' ||
v === 'CHROME_PATH' ||
v === 'CHROMEDRIVER_BIN',
)
.reduce<NodeJS.ProcessEnv>((vars, n) => {
Expand Down
1 change: 1 addition & 0 deletions tests/legacy-cli/e2e_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ setGlobalVariable('package-manager', argv.yarn ? 'yarn' : 'npm');
// Resolve from relative paths to absolute paths within the bazel runfiles tree
// so subprocesses spawned in a different working directory can still find them.
process.env.CHROME_BIN = path.resolve(process.env.CHROME_BIN!);
process.env.CHROME_PATH = path.resolve(process.env.CHROME_PATH!);
process.env.CHROMEDRIVER_BIN = path.resolve(process.env.CHROMEDRIVER_BIN!);

Promise.all([findFreePort(), findFreePort(), findPackageTars()])
Expand Down

0 comments on commit 7bf4dd6

Please sign in to comment.