File tree Expand file tree Collapse file tree 8 files changed +2922
-2711
lines changed Expand file tree Collapse file tree 8 files changed +2922
-2711
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,18 @@ build:remote --auth_enabled=true
86
86
# is provided by the shared dev-infra package and targets k8 remote containers.
87
87
build:remote --crosstool_top=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain_suite
88
88
build:remote --extra_toolchains=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain
89
- build:remote --extra_execution_platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
90
- build:remote --host_platform=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
91
- build:remote --platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
89
+ build:remote --extra_execution_platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform_with_network
90
+ build:remote --host_platform=@npm//@angular/dev-infra-private/bazel/remote-execution:platform_with_network
91
+ build:remote --platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform_with_network
92
+
93
+ ################################
94
+ # Sandbox settings #
95
+ ################################
96
+
97
+ # By default, network access should be disabled unless explicitly granted for certain targets
98
+ # using the `requires-network` tag. https://docs.bazel.build/versions/main/be/common-definitions.html
99
+ build --sandbox_default_allow_network=false
100
+ test --sandbox_default_allow_network=false
92
101
93
102
################################
94
103
# --config=build-results #
Original file line number Diff line number Diff line change @@ -23,12 +23,10 @@ node_integration_test(
23
23
"yarn test" ,
24
24
],
25
25
npm_packages = npmPackageMappings ,
26
+ setup_chromium = True ,
26
27
tags = [
27
- # Chromium cannot run in Sandbox. For this test, sandbox is disabled.
28
- # Additionally, we need to disable RBE as this test relies on internet
29
- # access for installing the NPM packages.
30
- "no-sandbox" ,
31
- "no-remote-exec" ,
28
+ # This test relies on `yarn` so there needs to be internet access.
29
+ "requires-network" ,
32
30
],
33
31
)
34
32
@@ -41,18 +39,14 @@ node_integration_test(
41
39
# See: https://github.com/yarnpkg/yarn/issues/2165.
42
40
# TODO(devversion): determine if a solution/workaround could live in the test runner.
43
41
"yarn install --cache-folder .yarn_cache_folder/" ,
44
- "node --version" ,
45
- "yarn node --version" ,
46
42
"yarn ng add @angular/material" ,
47
43
"yarn test" ,
48
44
],
49
45
npm_packages = npmPackageMappings ,
46
+ setup_chromium = True ,
50
47
tags = [
51
- # Chromium cannot run in Sandbox. For this test, sandbox is disabled.
52
- # Additionally, we need to disable RBE as this test relies on internet
53
- # access for installing the NPM packages.
54
- "no-sandbox" ,
55
- "no-remote-exec" ,
48
+ # This test relies on `yarn` so there needs to be internet access.
49
+ "requires-network" ,
56
50
],
57
51
tool_mappings = {
58
52
"@node12_host//:yarn_bin" : "yarn" ,
Original file line number Diff line number Diff line change 1
1
// Karma configuration file, see link for more information
2
2
// https://karma-runner.github.io/1.0/config/configuration-file.html
3
3
4
- // This code runs within Bazel where the environment does not have access to
5
- // the system Chrome browser. To workaround this we use Puppeteer to provide
6
- // a local version of Chromium that can run within Bazel.
7
- process . env . CHROME_BIN = require ( 'puppeteer' ) . executablePath ( ) ;
8
-
9
4
module . exports = function ( config ) {
10
5
config . set ( {
11
6
basePath : '' ,
@@ -34,12 +29,20 @@ module.exports = function (config) {
34
29
subdir : '.' ,
35
30
reporters : [ { type : 'html' } , { type : 'text-summary' } ] ,
36
31
} ,
32
+ customLaunchers : {
33
+ ChromeHeadlessNoSandbox : {
34
+ base : 'ChromeHeadless' ,
35
+ flags : [ '--no-sandbox' ] ,
36
+ } ,
37
+ } ,
37
38
reporters : [ 'progress' , 'kjhtml' ] ,
38
39
port : 9876 ,
39
40
colors : true ,
40
41
logLevel : config . LOG_INFO ,
41
42
autoWatch : true ,
42
- browsers : [ 'ChromeHeadless' ] ,
43
+ // Chrome cannot run with sandbox enabled as this test already runs within
44
+ // the Bazel sandbox environment and the sandboxes would conflict otherwise.
45
+ browsers : [ 'ChromeHeadlessNoSandbox' ] ,
43
46
singleRun : false ,
44
47
restartOnFileChange : true ,
45
48
} ) ;
Original file line number Diff line number Diff line change 37
37
"karma-coverage" : " ~2.0.3" ,
38
38
"karma-jasmine" : " ~4.0.0" ,
39
39
"karma-jasmine-html-reporter" : " ~1.7.0" ,
40
- "puppeteer" : " ^10.4.0" ,
41
40
"typescript" : " file:../../node_modules/typescript"
42
41
}
43
42
}
You can’t perform that action at this time.
0 commit comments