Skip to content

Commit

Permalink
test: switch angular CLI integration test to specify internet require…
Browse files Browse the repository at this point in the history
…ment

Adds the `requires-network` access tag to the Angular CLI integration
test. Internet access is by default not allowed. Also switches our
RBE platform to the one with network acesss (it's acceptable doing that
because we explicitly have network sandboxing enabled). This allows the
Angular CLI integration test to run with RBE (which is a good test for
us).

Now that this test does not need to run outside of sandbox anymore,
we'll re-enable the Bazel sandboxing but have to disable the inner
Chromium one. This is reasonable and there is no risk with doing that
as Chromium generally runs without sandbox in Bazel actions/tests.
  • Loading branch information
devversion committed Oct 14, 2021
1 parent 4c652ca commit f8a3346
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ build:remote --auth_enabled=true
# is provided by the shared dev-infra package and targets k8 remote containers.
build:remote --crosstool_top=//bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=//bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=//bazel/remote-execution:platform
build:remote --host_platform=//bazel/remote-execution:platform
build:remote --platforms=//bazel/remote-execution:platform
build:remote --extra_execution_platforms=//bazel/remote-execution:platform_with_network
build:remote --host_platform=//bazel/remote-execution:platform_with_network
build:remote --platforms=//bazel/remote-execution:platform_with_network

# Set remote caching settings
build:remote --remote_accept_cached=true
Expand Down
7 changes: 2 additions & 5 deletions bazel/integration/tests/angular-cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ integration_test(
"@nodejs//:yarn_files",
],
tags = [
# Chromium cannot run in Sandbox. For this test, sandbox is disabled.
# Additionally, we need to disable RBE as this test relies on internet
# access for installing the NPM packages.
"no-sandbox",
"no-remote-exec",
# This test relies on `yarn` so there needs to be internet access.
"requires-network",
],
tool_mappings = {
"@nodejs//:yarn_bin": "yarn",
Expand Down
10 changes: 9 additions & 1 deletion bazel/integration/tests/angular-cli/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ module.exports = function (config) {
},
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
Expand All @@ -39,7 +45,9 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
// Chrome cannot run with sandbox enabled as this test already runs within
// the Bazel sandbox environment and the sandboxes would conflict otherwise.
browsers: ['ChromeHeadlessNoSandbox'],
singleRun: false,
restartOnFileChange: true,
});
Expand Down

0 comments on commit f8a3346

Please sign in to comment.