From f24dd911b9d65c748f938e8590846a5185aba635 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Fri, 11 Sep 2026 13:54:07 -0500 Subject: [PATCH 1/3] [py] remove the remote BiDi test targets and their CI job --- .github/workflows/ci-python.yml | 18 ------------ py/BUILD.bazel | 52 --------------------------------- py/TESTING.md | 8 ++--- 3 files changed, 2 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index 288e97cea731f..805c07e9ba1a8 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -74,24 +74,6 @@ jobs: --local_test_jobs 1 --target_pattern_file=remote-targets.txt - remote-bidi-tests: - name: Remote BiDi Tests - uses: ./.github/workflows/bazel.yml - with: - name: Integration Tests Remote BiDi - needs-display: true - rerun-with-debug: true - download-artifact-name: targets - run: > - [ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt; - { echo "tests(//py:test-remote-bidi) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt; - bazel query --query_file=query.txt --output=label > remote-bidi-targets.txt; - ./scripts/github-actions/bazel-test-if-targets.sh - --keep_going - --flaky_test_attempts 3 - --local_test_jobs 1 - --target_pattern_file=remote-bidi-targets.txt - browser-tests: name: Browser Tests uses: ./.github/workflows/bazel.yml diff --git a/py/BUILD.bazel b/py/BUILD.bazel index cf7dabf39f1fe..fa9b8542bed3c 100644 --- a/py/BUILD.bazel +++ b/py/BUILD.bazel @@ -1136,48 +1136,6 @@ FEATURE_SUITE_DEFS = { if BROWSER_TESTS[browser].get("bidi", False) ] -# Generate test--remote-bidi targets (chrome and firefox only). -# Deliberately not folded into the test--remote aggregate: BiDi over Grid's -# websocket proxy is new coverage, so keep it out of the established remote job until -# it has proven stable. -[ - py_test_suite( - name = "test-%s-remote-bidi" % browser, - size = "large", - srcs = BIDI_TESTS + BIDI_IMPLEMENTATIONS, - args = [ - "--instafail", - "--bidi", - "--remote", - ] + BROWSERS[browser]["args"], - data = BROWSERS[browser]["data"] + [ - ":java-location", - "//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar", - "@bazel_tools//tools/jdk:current_java_runtime", - ], - env = { - "SE_BAZEL_JAVA_LOCATION": "$(rootpath :java-location)", - }, - env_inherit = ["DISPLAY"], - tags = ["no-sandbox"] + BROWSERS[browser]["tags"] + [ - "remote", - "%s-remote" % browser, - ], - target_compatible_with = BROWSERS[browser]["target_compatible_with"], - test_suffix = "%s-remote-bidi" % browser, - deps = [ - ":bidi_protocol", # bidi/protocol_tests.py imports the generated _bidi layer directly - ":common_alert", # bidi/browsing_context_tests.py calls EC.alert_is_present() - ":init-tree", - ":webserver", - ] + BROWSER_TESTS[browser]["deps"] + TEST_DEPS, - ) - for browser in [ - "chrome", - "firefox", - ] -] - # Generate test--remote-common targets (chrome and firefox only) [ py_test_suite( @@ -1317,16 +1275,6 @@ test_suite( ], ) -# Kept out of :test-remote so BiDi-over-Grid runs as its own CI job while it is new. -test_suite( - name = "test-remote-bidi", - tags = ["remote"], - tests = [ - ":test-chrome-remote-bidi", - ":test-firefox-remote-bidi", - ], -) - py_binary( name = "generate-api-listing", srcs = ["generate_api_module_listing.py"], diff --git a/py/TESTING.md b/py/TESTING.md index 3e0a2c023c6e2..77de87c1347c0 100644 --- a/py/TESTING.md +++ b/py/TESTING.md @@ -45,10 +45,8 @@ bazel test //py:test-chrome-bidi # Against a Grid server (chrome and firefox only). The suite starts its own # Selenium standalone server and talks to it with webdriver.Remote. -bazel test //py:test-chrome-remote # classic protocol -bazel test //py:test-chrome-remote-bidi # BiDi over Grid's websocket proxy -bazel test //py:test-remote # every classic remote suite -bazel test //py:test-remote-bidi # every BiDi remote suite +bazel test //py:test-chrome-remote +bazel test //py:test-remote # every remote suite # Test filters bazel test //py/... --test_tag_filters=chrome @@ -107,8 +105,6 @@ pytest py/test/selenium/webdriver/chrome/ --driver chrome --headless -v > To run against a Grid server, add `--remote`. It starts a Selenium standalone > server and runs the tests through `webdriver.Remote`, so it needs the Grid jar > built first (`bazel build //java/src/org/openqa/selenium/grid:selenium_server_deploy.jar`). -> `--bidi --remote` combine: Grid rewrites the `webSocketUrl` capability to its own -> `/session//se/bidi` endpoint and proxies the socket through to the node. ## Skipping Tests From 2c39a18e0f2976574857020173cf2f404348c632 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Fri, 11 Sep 2026 13:52:32 -0500 Subject: [PATCH 2/3] [py] add an opt-in list for BiDi tests that also run through Grid --- py/BUILD.bazel | 48 +++++++++++++++++++++++++++++++++++++++++++++++- py/TESTING.md | 4 ++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/py/BUILD.bazel b/py/BUILD.bazel index fa9b8542bed3c..bde652b182004 100644 --- a/py/BUILD.bazel +++ b/py/BUILD.bazel @@ -869,6 +869,10 @@ BIDI_TESTS = glob([ # Tests that have bidi and classic implementations. BIDI_IMPLEMENTATIONS = [] +# BiDi test files with Grid-specific behavior, run through Grid as well. Empty +# generates no targets: an empty test_suite would mean every test in the package. +REMOTE_BIDI_TESTS = [] + # Test files that only run against browsers supporting the given feature. # Each group is split into its own sub-suite so that changing the underlying # library only triggers that group's targets, not the full ~700-target suite. @@ -1136,6 +1140,47 @@ FEATURE_SUITE_DEFS = { if BROWSER_TESTS[browser].get("bidi", False) ] +# Generate test--remote-bidi targets (chrome and firefox only), folded +# into test--remote below. +[ + py_test_suite( + name = "test-%s-remote-bidi" % browser, + size = "large", + srcs = REMOTE_BIDI_TESTS + BIDI_IMPLEMENTATIONS, + args = [ + "--instafail", + "--bidi", + "--remote", + ] + BROWSERS[browser]["args"], + data = BROWSERS[browser]["data"] + [ + ":java-location", + "//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar", + "@bazel_tools//tools/jdk:current_java_runtime", + ], + env = { + "SE_BAZEL_JAVA_LOCATION": "$(rootpath :java-location)", + }, + env_inherit = ["DISPLAY"], + tags = ["no-sandbox"] + BROWSERS[browser]["tags"] + [ + "remote", + "%s-remote" % browser, + ], + target_compatible_with = BROWSERS[browser]["target_compatible_with"], + test_suffix = "%s-remote-bidi" % browser, + deps = [ + ":bidi_protocol", + ":common_alert", + ":init-tree", + ":webserver", + ] + BROWSER_TESTS[browser]["deps"] + TEST_DEPS, + ) + for browser in [ + "chrome", + "firefox", + ] + if REMOTE_BIDI_TESTS +] + # Generate test--remote-common targets (chrome and firefox only) [ py_test_suite( @@ -1255,12 +1300,13 @@ FEATURE_SUITE_DEFS = { ] # Aggregate test--remote = remote-common + remote-actions + remote-features +# (+ remote-bidi once REMOTE_BIDI_TESTS has entries) [test_suite( name = "test-%s-remote" % browser, tests = [ ":test-%s-remote-common" % browser, ":test-%s-remote-actions" % browser, - ] + [":test-%s-remote-%s" % (browser, f) for f in FEATURE_SUITE_DEFS], + ] + [":test-%s-remote-%s" % (browser, f) for f in FEATURE_SUITE_DEFS] + ([":test-%s-remote-bidi" % browser] if REMOTE_BIDI_TESTS else []), ) for browser in [ "chrome", "firefox", diff --git a/py/TESTING.md b/py/TESTING.md index 77de87c1347c0..de56d1d909ca6 100644 --- a/py/TESTING.md +++ b/py/TESTING.md @@ -105,6 +105,10 @@ pytest py/test/selenium/webdriver/chrome/ --driver chrome --headless -v > To run against a Grid server, add `--remote`. It starts a Selenium standalone > server and runs the tests through `webdriver.Remote`, so it needs the Grid jar > built first (`bazel build //java/src/org/openqa/selenium/grid:selenium_server_deploy.jar`). +> +> A BiDi test file with Grid-specific behavior can be listed in `REMOTE_BIDI_TESTS` +> in `py/BUILD.bazel`; it then also runs with `--bidi --remote` as part of +> `test--remote`. ## Skipping Tests From 2224af96e8327d55c9d967ca5c6dd9aeb03cac4d Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Fri, 11 Sep 2026 14:24:04 -0500 Subject: [PATCH 3/3] [py] source the opt-in remote BiDi suite only from REMOTE_BIDI_TESTS --- py/BUILD.bazel | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py/BUILD.bazel b/py/BUILD.bazel index bde652b182004..ab1b8dc61bf7d 100644 --- a/py/BUILD.bazel +++ b/py/BUILD.bazel @@ -1146,7 +1146,7 @@ FEATURE_SUITE_DEFS = { py_test_suite( name = "test-%s-remote-bidi" % browser, size = "large", - srcs = REMOTE_BIDI_TESTS + BIDI_IMPLEMENTATIONS, + srcs = REMOTE_BIDI_TESTS, args = [ "--instafail", "--bidi", @@ -1300,7 +1300,6 @@ FEATURE_SUITE_DEFS = { ] # Aggregate test--remote = remote-common + remote-actions + remote-features -# (+ remote-bidi once REMOTE_BIDI_TESTS has entries) [test_suite( name = "test-%s-remote" % browser, tests = [