Skip to content

Commit 71ad272

Browse files
aguspetitusfortner
andauthored
[rb] add guard for browser version (#15899)
* [build] allow tests tagged exclusive-if-local to run on rbe * Add version guard * Update browsers * Fix BiDi execution in beta chrome * Fetch beta chrome version * add guard clause * add reason * simplify regex * Update chrome beta and simplify hash * remove syntax error --------- Co-authored-by: titusfortner <titus.fortner@gmail.com>
1 parent 9318b7a commit 71ad272

File tree

5 files changed

+50
-31
lines changed

5 files changed

+50
-31
lines changed

common/repositories.bzl

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/linux-x86_64/en-US/firefox-140.0b8.tar.xz",
54-
sha256 = "1fa8bcb1e242ffbad091b3ee7067ece582d34508db394e656832ab07b058e96e",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b9/linux-x86_64/en-US/firefox-140.0b9.tar.xz",
54+
sha256 = "812450fa61d36d44944fc9691a628b5c87d18268e68a15d9e54ac82ba4adfba5",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/mac/en-US/Firefox%20140.0b8.dmg",
76-
sha256 = "7e648f5e0305a6abedb698ea5b29971cd1eb58225b998baa85a82d94bcf75342",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b9/mac/en-US/Firefox%20140.0b9.dmg",
76+
sha256 = "7c764a8210fe44797ba49982bede4d32235b33c7c996f4caffd15e5a06cf62a1",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/881a4aef-792c-4d81-a76f-3cf546510d68/MicrosoftEdge-137.0.3296.68.pkg",
127-
sha256 = "4de62ee93ba67db666597807fc991e749f073af07a577dfdfc56dbf19409c87d",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/07df5fb0-0542-41c3-ad8d-889adf2b954f/MicrosoftEdge-137.0.3296.83.pkg",
127+
sha256 = "bc49d876669ae029e5f1236615cbe2e26dd2588a3048c450c1ae600fef6c454b",
128128
move = {
129-
"MicrosoftEdge-137.0.3296.68.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-137.0.3296.83.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_137.0.3296.68-1_amd64.deb",
147-
sha256 = "76099017ace977c74060aa134a289d93c554e9d67f6561039580fdd483da0c41",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_137.0.3296.83-1_amd64.deb",
147+
sha256 = "c1b8a28efc73cb233d971a0cb5c40716a6580a196c1e1d213504f0760c4fa596",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/137.0.3296.68/edgedriver_linux64.zip",
169-
sha256 = "0605ae9e651befd470826ff3c3baf74b3d40599c25f1edd60b09d10f5b97144a",
168+
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_linux64.zip",
169+
sha256 = "141cd4cd42b7642dec1f215e0b1a0c1dae05f573218cb8ef18b876efa14f152a",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.azureedge.net/137.0.3296.68/edgedriver_mac64.zip",
186-
sha256 = "29b331d365361f0e9ef68c2e573f33ca895b3fa607823a66de9d6f226dbe4a54",
185+
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_mac64.zip",
186+
sha256 = "e361cfea041e649944a60a41ec40076be35fda8608e9011fad638ec0491a1f79",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chrome-linux64.zip",
203-
sha256 = "da1424d975dbe963b0a7f7f8e8c2e477bfed6b3430a2bc0b287f1c247ec62ee3",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/linux64/chrome-linux64.zip",
203+
sha256 = "680a672ed0cc7b8fae6ee5b21691a55273228b05e1f3f80580606c4db203994a",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -220,8 +220,8 @@ js_library(
220220
)
221221
http_archive(
222222
name = "mac_chrome",
223-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chrome-mac-x64.zip",
224-
sha256 = "2ea79a9457dbaffae6fbdf592c93776ac859dca98b448f7513cdd68234454a07",
223+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/mac-x64/chrome-mac-x64.zip",
224+
sha256 = "86d2e1cb317e78c4f5aefc70cf00e4fdaf9dcc80cf4ca3634abccf6d8781181e",
225225
strip_prefix = "chrome-mac-x64",
226226
patch_cmds = [
227227
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -241,8 +241,8 @@ js_library(
241241
)
242242
http_archive(
243243
name = "linux_chromedriver",
244-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chromedriver-linux64.zip",
245-
sha256 = "cade69e8d67f4951049e56d796111755e0bf9240d26378975a95c8423bb3f55a",
244+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/linux64/chromedriver-linux64.zip",
245+
sha256 = "f4138b39e4fbe948e887ed5c1e0286c539fa81657cd5f2d8d51c1f68921a8880",
246246
strip_prefix = "chromedriver-linux64",
247247
build_file_content = """
248248
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -259,8 +259,8 @@ js_library(
259259

260260
http_archive(
261261
name = "mac_chromedriver",
262-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chromedriver-mac-x64.zip",
263-
sha256 = "d80825e87543d99ad7a8b9356fb236ddb7df3ba087f8f314991195da27a7ccc3",
262+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/mac-x64/chromedriver-mac-x64.zip",
263+
sha256 = "3502bec185bbb2732f21648d02ed3ac3c478ddfa35f3deddc9cc1433335309b7",
264264
strip_prefix = "chromedriver-mac-x64",
265265
build_file_content = """
266266
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -277,8 +277,8 @@ js_library(
277277

278278
http_archive(
279279
name = "linux_beta_chrome",
280-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chrome-linux64.zip",
281-
sha256 = "e4bb8769b613eacd7cc40e48f3f63d96de9e9ee642360b4a79bedd502291c544",
280+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/linux64/chrome-linux64.zip",
281+
sha256 = "4fd1afa4d0bb059114c1f244c09722d03aad151681adb40e09235ad9592d6e49",
282282
build_file_content = """
283283
load("@aspect_rules_js//js:defs.bzl", "js_library")
284284
package(default_visibility = ["//visibility:public"])
@@ -298,8 +298,8 @@ js_library(
298298
)
299299
http_archive(
300300
name = "mac_beta_chrome",
301-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chrome-mac-x64.zip",
302-
sha256 = "46dbfe39930cd3a2a45bc85a70bb49c291c258fde5be4d3d4deecc8e3181ae2f",
301+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/mac-x64/chrome-mac-x64.zip",
302+
sha256 = "e312cd055c263120b75e6387a294458d340e57da332efca89f7afdc4541458b9",
303303
strip_prefix = "chrome-mac-x64",
304304
patch_cmds = [
305305
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -319,8 +319,8 @@ js_library(
319319
)
320320
http_archive(
321321
name = "linux_beta_chromedriver",
322-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chromedriver-linux64.zip",
323-
sha256 = "b180e7569aa10a10e5b112b2b6cc21d126499122eaba0e90d264713285cc9104",
322+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/linux64/chromedriver-linux64.zip",
323+
sha256 = "eb423d4d1928fe03ad2414316c103607bf4624029f8fc115c54bcc4b1f613f0d",
324324
strip_prefix = "chromedriver-linux64",
325325
build_file_content = """
326326
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -337,8 +337,8 @@ js_library(
337337

338338
http_archive(
339339
name = "mac_beta_chromedriver",
340-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chromedriver-mac-x64.zip",
341-
sha256 = "fda50dbab46115e2185cae0f3eeb8526c3f95175b0d4f7f7871aaf1e63590d5c",
340+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/mac-x64/chromedriver-mac-x64.zip",
341+
sha256 = "b9863dc8e00469b5eb74be7472653694c9fd6943e3e47ec9e1b00c93c9fb68a6",
342342
strip_prefix = "chromedriver-mac-x64",
343343
build_file_content = """
344344
load("@aspect_rules_js//js:defs.bzl", "js_library")

rb/spec/integration/selenium/webdriver/fedcm_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Selenium
2323
module WebDriver
2424
module FedCM
2525
describe FedCM,
26+
exclude: {version: GlobalTestEnv.beta_chrome_version, reason: 'https://issues.chromium.org/u/0/issues/425801332'},
2627
exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: %i[chrome edge]}] do
2728
let(:dialog) { driver.fedcm_dialog }
2829

rb/spec/integration/selenium/webdriver/network_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe Network, exclusive: {bidi: true, reason: 'only executed when bidi is enabled'},
24+
describe Network, exclude: {version: GlobalTestEnv.beta_chrome_version},
25+
exclusive: {bidi: true, reason: 'only executed when bidi is enabled'},
2526
only: {browser: %i[chrome edge firefox]} do
2627
let(:username) { SpecSupport::RackServer::TestApp::BASIC_AUTH_CREDENTIALS.first }
2728
let(:password) { SpecSupport::RackServer::TestApp::BASIC_AUTH_CREDENTIALS.last }

rb/spec/integration/selenium/webdriver/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def example_finished(notification)
7272
guards.add_condition(:headless, !ENV['HEADLESS'].nil?)
7373
guards.add_condition(:bidi, !ENV['WEBDRIVER_BIDI'].nil?)
7474
guards.add_condition(:rbe, GlobalTestEnv.rbe?)
75+
guards.add_condition(:version, GlobalTestEnv.browser_version)
7576

7677
results = guards.disposition
7778
send(*results) if results

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def browser
5757
end
5858
end
5959

60+
def browser_version
61+
driver_instance.capabilities.browser_version
62+
end
63+
6064
def driver_instance(...)
6165
@driver_instance || create_driver!(...)
6266
end
@@ -189,6 +193,18 @@ def create_driver!(listener: nil, **, &block)
189193
raise e
190194
end
191195

196+
def beta_chrome_version
197+
chrome_beta_url = 'https://chromereleases.googleblog.com/search/label/Beta%20updates'
198+
199+
uri = URI.parse(chrome_beta_url)
200+
201+
response = Net::HTTP.get_response(uri)
202+
203+
return "Failed to fetch Chrome Beta page: #{response&.code}" unless response.is_a?(Net::HTTPSuccess)
204+
205+
response.body.match(/\d+\.\d+\.\d+\.\d+/).to_s
206+
end
207+
192208
private
193209

194210
def build_options(**)
@@ -204,7 +220,7 @@ def current_env
204220
{
205221
browser: browser,
206222
driver: driver,
207-
version: driver_instance.capabilities.browser_version,
223+
version: browser_version,
208224
platform: Platform.os,
209225
ci: Platform.ci,
210226
rbe: rbe?

0 commit comments

Comments
 (0)