Skip to content

Commit 4935792

Browse files
committed
[rb] Run remote tests on RBE
1 parent 17d927b commit 4935792

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

.github/workflows/ci-ruby.yml

-9
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,11 @@ jobs:
7575
- firefox
7676
- safari
7777
os:
78-
- ubuntu
7978
- windows
8079
- macos
8180
exclude:
82-
- browser: edge
83-
os: ubuntu
8481
- browser: edge
8582
os: macos
86-
- browser: safari
87-
os: ubuntu
8883
- browser: safari
8984
os: windows
9085
with:
@@ -111,10 +106,6 @@ jobs:
111106
include:
112107
- browser: edge
113108
os: windows
114-
- browser: chrome
115-
os: ubuntu
116-
- browser: firefox
117-
os: ubuntu
118109
- browser: safari
119110
os: macos
120111
with:

.skipped-tests

+13
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,20 @@
2323
-//py:test-chrome-test/selenium/webdriver/chrome/chrome_service_tests.py
2424
-//py:test-chrome-test/selenium/webdriver/chrome/proxy_tests.py
2525
-//rb/spec/integration/selenium/webdriver/chrome:service-chrome
26+
-//rb/spec/integration/selenium/webdriver/chrome:service-chrome-remote
2627
-//rb/spec/integration/selenium/webdriver/edge:service-edge
28+
-//rb/spec/integration/selenium/webdriver/edge:service-edge-remote
2729
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox
30+
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox-remote
2831
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox-beta
32+
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox-beta-remote
2933
-//rb/spec/integration/selenium/webdriver:element-chrome
34+
-//rb/spec/integration/selenium/webdriver:element-chrome-remote
35+
-//rb/spec/integration/selenium/webdriver/remote:driver-chrome-remote
36+
-//rb/spec/integration/selenium/webdriver/remote:driver-edge-remote
37+
-//rb/spec/integration/selenium/webdriver/remote:driver-firefox-remote
38+
-//rb/spec/integration/selenium/webdriver/remote:driver-firefox-beta-remote
39+
-//rb/spec/integration/selenium/webdriver/remote:element-chrome-remote
40+
-//rb/spec/integration/selenium/webdriver/remote:element-edge-remote
41+
-//rb/spec/integration/selenium/webdriver/remote:element-firefox-remote
42+
-//rb/spec/integration/selenium/webdriver/remote:element-firefox-beta-remote

rb/.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6
1+
jruby-9.4.6.0

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

+13-3
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,24 @@ def app_server
8585
end
8686

8787
def remote_server
88+
if ENV.key?('CHROMEDRIVER_BINARY')
89+
args = ["-Dwebdriver.chrome.driver=#{ENV['CHROMEDRIVER_BINARY']}"]
90+
elsif ENV.key?('MSEDGEDRIVER_BINARY')
91+
args = ["-Dwebdriver.edge.driver=#{ENV['MSEDGEDRIVER_BINARY']}"]
92+
elsif ENV.key?('GECKODRIVER_BINARY')
93+
args = ["-Dwebdriver.gecko.driver=#{ENV['GECKODRIVER_BINARY']}"]
94+
else
95+
args = %w[--selenium-manager true --enable-managed-downloads true]
96+
end
97+
8898
@remote_server ||= Selenium::Server.new(
8999
remote_server_jar,
90100
java: bazel_java,
91101
port: random_port,
92102
log_level: WebDriver.logger.debug? && 'FINE',
93103
background: true,
94104
timeout: 60,
95-
args: %w[--selenium-manager true --enable-managed-downloads true]
105+
args: args
96106
)
97107
end
98108

@@ -250,15 +260,15 @@ def safari_preview_driver(**opts)
250260
def chrome_options(args: [], **opts)
251261
opts[:binary] ||= ENV['CHROME_BINARY'] if ENV.key?('CHROME_BINARY')
252262
args << '--headless=chrome' if ENV['HEADLESS']
253-
args << '--no-sandbox' if ENV['NO_SANDBOX']
263+
args << '--no-sandbox' unless Platform.windows?
254264
args << '--disable-gpu'
255265
WebDriver::Options.chrome(browser_version: 'stable', args: args, **opts)
256266
end
257267

258268
def edge_options(args: [], **opts)
259269
opts[:binary] ||= ENV['EDGE_BINARY'] if ENV.key?('EDGE_BINARY')
260270
args << '--headless=chrome' if ENV['HEADLESS']
261-
args << '--no-sandbox' if ENV['NO_SANDBOX']
271+
args << '--no-sandbox' unless Platform.windows?
262272
args << '--disable-gpu'
263273
WebDriver::Options.edge(browser_version: 'stable', args: args, **opts)
264274
end

rb/spec/tests.bzl

+1-10
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ BROWSERS = {
3030
}) | select({
3131
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
3232
"//conditions:default": {},
33-
}) | select({
34-
"@platforms//os:windows": {},
35-
"//conditions:default": {"NO_SANDBOX": "true"},
3633
}),
3734
},
3835
"edge": {
@@ -56,9 +53,6 @@ BROWSERS = {
5653
}) | select({
5754
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
5855
"//conditions:default": {},
59-
}) | select({
60-
"@platforms//os:windows": {},
61-
"//conditions:default": {"NO_SANDBOX": "true"},
6256
}),
6357
},
6458
"firefox": {
@@ -188,10 +182,7 @@ def rb_integration_test(name, srcs, deps = [], data = [], browsers = BROWSERS.ke
188182
"WD_SPEC_DRIVER": "remote",
189183
},
190184
main = "@bundle//bin:rspec",
191-
tags = COMMON_TAGS + BROWSERS[browser]["tags"] + tags + [
192-
"{}-remote".format(browser),
193-
"skip-remote", # Do we want to run remote tests in RBE?
194-
],
185+
tags = COMMON_TAGS + BROWSERS[browser]["tags"] + tags + ["{}-remote".format(browser)],
195186
deps = ["//rb/spec/integration/selenium/webdriver:spec_helper"] + BROWSERS[browser]["deps"] + deps,
196187
visibility = ["//rb:__subpackages__"],
197188
target_compatible_with = BROWSERS[browser]["target_compatible_with"],

0 commit comments

Comments
 (0)