Skip to content

Commit

Permalink
test: switch angular-cli integration test to use Bazel-managed chromium
Browse files Browse the repository at this point in the history
Switches the Angular CLI integration test to use the Bazel-managed
chromium, allowing us to remove Puppeteer, which is specifically
installed to run Chromium within Bazel!.
  • Loading branch information
devversion committed Nov 5, 2021
1 parent 818ad64 commit c1dbbba
Show file tree
Hide file tree
Showing 4 changed files with 766 additions and 553 deletions.
6 changes: 6 additions & 0 deletions bazel/integration/tests/angular-cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ integration_test(
# The Yarn files also need to be part of the integration test as runfiles
# because the `yarn_bin` target is not a self-contained standalone binary.
"@nodejs//:yarn_files",
# Makes the chromium binaries available for the `ng test` command.
"//bazel/browsers/chromium",
],
environment = {
"CHROME_BIN": "$(CHROMIUM)",
},
tags = [
# This test relies on `yarn` so there needs to be internet access.
"requires-network",
Expand All @@ -21,4 +26,5 @@ integration_test(
"@nodejs//:yarn_bin": "yarn",
"@nodejs//:node_bin": "node",
},
toolchains = ["//bazel/browsers/chromium:toolchain_alias"],
)
5 changes: 0 additions & 5 deletions bazel/integration/tests/angular-cli/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

// This code runs within Bazel where the environment does not have access to
// the system Chrome browser. To workaround this we use Puppeteer to provide
// a local version of Chromium that can run within Bazel.
process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
basePath: '',
Expand Down
25 changes: 12 additions & 13 deletions bazel/integration/tests/angular-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~13.0.0-next.0",
"@angular/common": "~13.0.0-next.0",
"@angular/compiler": "~13.0.0-next.0",
"@angular/core": "~13.0.0-next.0",
"@angular/forms": "~13.0.0-next.0",
"@angular/platform-browser": "~13.0.0-next.0",
"@angular/platform-browser-dynamic": "~13.0.0-next.0",
"@angular/router": "~13.0.0-next.0",
"@angular/animations": "~13.0.0",
"@angular/common": "~13.0.0",
"@angular/compiler": "~13.0.0",
"@angular/core": "~13.0.0",
"@angular/forms": "~13.0.0",
"@angular/platform-browser": "~13.0.0",
"@angular/platform-browser-dynamic": "~13.0.0",
"@angular/router": "~13.0.0",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.0.0-next.9",
"@angular/cli": "~13.0.0-next.9",
"@angular/compiler-cli": "~13.0.0-next.0",
"@angular-devkit/build-angular": "~13.0.1",
"@angular/cli": "~13.0.1",
"@angular/compiler-cli": "~13.0.0",
"@types/jasmine": "~3.9.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.9.0",
Expand All @@ -34,7 +34,6 @@
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"puppeteer": "^10.4.0",
"typescript": "~4.4.3"
}
}
}
Loading

0 comments on commit c1dbbba

Please sign in to comment.