Skip to content

Commit

Permalink
[rb] Use no-sandbox on non-Windows
Browse files Browse the repository at this point in the history
This is required on RBE which runs Docker linux
  • Loading branch information
p0deje committed May 2, 2024
1 parent f54ba8b commit 8d94b34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ def safari_preview_driver(**opts)
def chrome_options(args: [], **opts)
opts[:binary] ||= ENV['CHROME_BINARY'] if ENV.key?('CHROME_BINARY')
args << '--headless=chrome' if ENV['HEADLESS']
args << '--no-sandbox' if ENV['NO_SANDBOX']
args << '--disable-gpu'
WebDriver::Options.chrome(browser_version: 'stable', args: args, **opts)
end

def edge_options(args: [], **opts)
opts[:binary] ||= ENV['EDGE_BINARY'] if ENV.key?('EDGE_BINARY')
args << '--headless=chrome' if ENV['HEADLESS']
args << '--no-sandbox' if ENV['NO_SANDBOX']
args << '--disable-gpu'
WebDriver::Options.edge(browser_version: 'stable', args: args, **opts)
end
Expand Down
6 changes: 6 additions & 0 deletions rb/spec/tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ BROWSERS = {
}) | select({
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
"//conditions:default": {},
}) | select({
"@platforms//os:windows": {},
"//conditions:default": {"NO_SANDBOX": "true"},
}),
},
"edge": {
Expand All @@ -53,6 +56,9 @@ BROWSERS = {
}) | select({
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
"//conditions:default": {},
}) | select({
"@platforms//os:windows": {},
"//conditions:default": {"NO_SANDBOX": "true"},
}),
},
"firefox": {
Expand Down

0 comments on commit 8d94b34

Please sign in to comment.