Skip to content

Commit 2418844

Browse files
committed
[rb] Run all unit tests in RBE
1 parent cc93539 commit 2418844

File tree

7 files changed

+26
-11
lines changed

7 files changed

+26
-11
lines changed

WORKSPACE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
3636

3737
bazel_skylib_workspace()
3838

39+
http_archive(
40+
name = "aspect_bazel_lib",
41+
sha256 = "f75d03783588e054899eb0729a97fb5b8973c1a26f30373fafd485c90bf207d1",
42+
strip_prefix = "bazel-lib-2.4.2",
43+
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.4.2/bazel-lib-v2.4.2.tar.gz",
44+
)
45+
46+
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains")
47+
48+
aspect_bazel_lib_dependencies()
49+
50+
aspect_bazel_lib_register_toolchains()
51+
3952
http_archive(
4053
name = "rules_python",
4154
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",

rb/lib/selenium/devtools/BUILD.bazel

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
1+
load("@aspect_bazel_lib//lib:run_binary.bzl", "run_binary")
22
load("@rules_ruby//ruby:defs.bzl", "rb_binary", "rb_library")
33

44
package(default_visibility = ["//rb:__subpackages__"])
@@ -38,17 +38,14 @@ rb_binary(
3838
"//common/devtools/chromium/" + version + ":browser_protocol",
3939
"//common/devtools/chromium/" + version + ":js_protocol",
4040
],
41-
outs = [
42-
version,
43-
version + ".rb",
44-
],
41+
outs = [version + ".rb"],
4542
args = [
4643
"$(location //common/devtools/chromium/" + version + ":browser_protocol)",
4744
"$(location //common/devtools/chromium/" + version + ":js_protocol)",
48-
"$(location :" + version + ")/",
4945
"$(location :" + version + ".rb)",
5046
version,
5147
],
48+
out_dirs = [version],
5249
tool = ":cdp-generate",
5350
)
5451
for version in CDP_VERSIONS

rb/lib/selenium/devtools/support/cdp_client_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def process_loader(domains)
9898
end
9999

100100
if $PROGRAM_NAME == __FILE__
101-
browser_protocol_path, js_protocol_path, output_dir, loader_path, version = *ARGV
101+
browser_protocol_path, js_protocol_path, loader_path, version = *ARGV
102102

103103
Selenium::DevTools::Support::CDPClientGenerator.new.call(
104104
browser_protocol_path: browser_protocol_path,
105105
js_protocol_path: js_protocol_path,
106-
output_dir: output_dir,
106+
output_dir: loader_path.sub(/\.rb$/, ''),
107107
loader_path: loader_path,
108108
version: version
109109
)

rb/spec/unit/selenium/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rb_test(
1515
"//rb/lib/selenium:webdriver",
1616
"//rb/lib/selenium/webdriver:atoms",
1717
"//rb/lib/selenium/webdriver:common",
18+
"//rb/spec/unit/selenium/webdriver:spec_helper",
1819
"@bundle",
1920
],
2021
)
@@ -33,6 +34,7 @@ rb_test(
3334
"//rb/lib/selenium:webdriver",
3435
"//rb/lib/selenium/webdriver:atoms",
3536
"//rb/lib/selenium/webdriver:common",
37+
"//rb/spec/unit/selenium/webdriver:spec_helper",
3638
"@bundle",
3739
],
3840
)

rb/spec/unit/selenium/devtools/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rb_test(
1515
"//rb/lib/selenium/devtools:cdp-generate",
1616
"//rb/lib/selenium/webdriver:atoms",
1717
"//rb/lib/selenium/webdriver:common",
18+
"//rb/spec/unit/selenium/webdriver:spec_helper",
1819
"@bundle",
1920
],
2021
)

rb/spec/unit/selenium/server_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ module Selenium
193193

194194
it 'raises Selenium::Server::Error if the server is not launched within the timeout' do
195195
allow(File).to receive(:exist?).with('selenium_server_deploy.jar').and_return(true)
196+
allow(WebDriver::ChildProcess).to receive(:build)
197+
.with('java', '-jar', 'selenium_server_deploy.jar', 'standalone', '--port', port.to_s)
198+
.and_return(mock_process)
196199

197200
poller = instance_double(WebDriver::SocketPoller)
198201
allow(poller).to receive(:connected?).and_return(false)

scripts/github-actions/ci-build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ bazel test --config=remote-ci --build_tests_only \
2020
//java/... \
2121
//javascript/atoms/... //javascript/webdriver/... \
2222
//py/... \
23-
//rb/spec/unit/selenium/webdriver/... -- $(cat .skipped-tests | tr '\n' ' ')
23+
//rb/spec/unit/... -- $(cat .skipped-tests | tr '\n' ' ')
2424

2525
# Build the packages we want to ship to users
26-
bazel build --config=remote-ci //dotnet:all java/src/... //javascript/node/selenium-webdriver:selenium-webdriver //py:selenium-wheel
27-
26+
bazel build --config=remote-ci //dotnet:all java/src/... //javascript/node/selenium-webdriver:selenium-webdriver //py:selenium-wheel

0 commit comments

Comments
 (0)