Skip to content

Commit 7497e38

Browse files
authored
[bazel] Get python large "auto" tests running on engflow (#12159)
1 parent 937236c commit 7497e38

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

py/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ py_library(
325325
"--instafail",
326326
] + BROWSERS[browser]["args"],
327327
data = BROWSERS[browser]["data"],
328+
env_inherit = ["DISPLAY"],
328329
tags = [
329330
"no-sandbox",
330331
] + BROWSERS[browser]["tags"],

py/conftest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def fin():
127127
if driver_class == "WPEWebKit":
128128
options = get_options(driver_class, request.config)
129129
if driver_path is not None:
130-
kwargs["executable_path"] = driver_path
130+
kwargs["service"] = get_service(driver_class, driver_path)
131131
if options is not None:
132132
kwargs["options"] = options
133133

@@ -169,6 +169,17 @@ def get_options(driver_class, config):
169169
return options
170170

171171

172+
def get_service(driver_class, executable):
173+
# Let the default behaviour be used if we don't set the driver executable
174+
if not executable:
175+
return None
176+
177+
module = getattr(webdriver, driver_class.lower())
178+
service = module.service.Service(executable_path=executable)
179+
180+
return service
181+
182+
172183
@pytest.fixture(scope="session", autouse=True)
173184
def stop_driver(request):
174185
def fin():

py/private/browsers.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ chrome_args = select({
1717
"@selenium//common:use_pinned_linux_chrome": [
1818
"--driver-binary=$(location @linux_chromedriver//:chromedriver)",
1919
"--browser-binary=$(location @linux_chrome//:chrome-linux/chrome)",
20+
"--browser-args=--disable-dev-shm-usage",
21+
"--browser-args=--no-sandbox",
2022
],
2123
"@selenium//common:use_pinned_macos_chrome": [
2224
"--driver-binary=$(location @mac_chromedriver//:chromedriver)",

0 commit comments

Comments
 (0)