You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to run existing api through webdriver-bidi and webdriver-classic settings while we transition, but there is no need to run everything with webdriver-bidi when it hasn't been implemented yet
💥 What does this PR do?
reduces how many tests are run to only those affected
🔧 Implementation Notes
I was going to do this with Ruby guards, but that would be harder to deal with
🔄 Types of changes
Cleanup (formatting, renaming)
PR Type
Enhancement
Description
Minimize Ruby BiDi test targets by only creating -bidi variants for tests explicitly tagged with "bidi"
Remove unnecessary BiDi test targets from skipped tests list
Consolidate BiDi-specific tests into dedicated test files with proper tagging
Simplify build configuration by eliminating redundant BiDi target generation
Diagram Walkthrough
flowchart LR
A["rb_integration_test function"] -->|Check for bidi tag| B["Create -bidi target?"]
B -->|bidi tag present| C["Generate -bidi variant"]
B -->|bidi tag absent| D["Skip -bidi generation"]
E["BiDi test files"] -->|Tag with bidi| F["Selective target creation"]
G[".skipped-tests"] -->|Remove obsolete entries| H["Cleaner skip list"]
Loading
File Walkthrough
Relevant files
Enhancement
tests.bzl
Add conditional BiDi target generation based on tags
rb/spec/tests.bzl
Added conditional check to skip -bidi target creation for tests not tagged with "bidi"
Prevents unnecessary BiDi test variants from being generated during build
Reduces build complexity by only creating BiDi targets when explicitly needed
Investigate and resolve repeated "Error: ConnectFailure (Connection refused)" when instantiating multiple ChromeDriver sessions after the first one on Ubuntu 16.04 with Chrome 65/Chromedriver 2.35 and Selenium 3.9.0.
Provide a fix or guidance so that subsequent ChromeDriver instantiations do not produce ConnectFailure errors.
Validate behavior specifically for Chrome on the stated environment, ensuring reliability across multiple driver instances.
✅ Fix off-by-one error in slicingSuggestion Impact:The commit updated the name slicing from f[:-7] to f[:-8] in the rb_integration_test block, implementing the suggested fix.
code diff:
[
rb_integration_test(
- name = f[:-7],+ name = f[:-8],
srcs = [f],
tags = ["bidi"],
)
Correct the string slicing from f[:-7] to f[:-8] to properly remove the _spec.rb suffix from test file names.
[
rb_integration_test(
- name = f[:-7],+ name = f[:-8],
srcs = [f],
tags = ["bidi"],
)
for f in _BIDI_FILES
]
[Suggestion processed]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a functional bug in the build script. The incorrect string slicing f[:-7] would generate malformed test target names, likely causing build failures or tests not being correctly identified.
High
Learned best practice
✅ Remove early macro returnSuggestion Impact:The early return was removed and replaced with a conditional that only creates the BiDi test target when "bidi" is in tags, ensuring other targets are unaffected.
code diff:
- # Generate a test target for bidi browser execution.- if "bidi" not in tags:- return # don't create -bidi targets for non-BiDi tests-- rb_test(- name = "{}-{}-bidi".format(name, browser),- size = "large",- srcs = srcs,- args = ["rb/spec/"],- data = BROWSERS[browser]["data"] + data + ["//common/src/web"],- env = BROWSERS[browser]["env"] | {"WEBDRIVER_BIDI": "true"},- main = "@bundle//bin:rspec",- tags = COMMON_TAGS + BROWSERS[browser]["tags"] + tags + ["{}-bidi".format(browser)],- deps = depset(- ["//rb/spec/integration/selenium/webdriver:spec_helper", "//rb/lib/selenium/webdriver:bidi"] +- BROWSERS[browser]["deps"] +- deps,- ),- visibility = ["//rb:__subpackages__"],- target_compatible_with = BROWSERS[browser]["target_compatible_with"],- )+ # Generate a test target for bidi browser execution if there is a matching tag+ if "bidi" in tags:+ rb_test(+ name = "{}-{}-bidi".format(name, browser),+ size = "large",+ srcs = srcs,+ args = ["rb/spec/"],+ data = BROWSERS[browser]["data"] + data + ["//common/src/web"],+ env = BROWSERS[browser]["env"] | {"WEBDRIVER_BIDI": "true"},+ main = "@bundle//bin:rspec",+ tags = COMMON_TAGS + BROWSERS[browser]["tags"] + tags + ["{}-bidi".format(browser)],+ deps = depset(+ ["//rb/spec/integration/selenium/webdriver:spec_helper", "//rb/lib/selenium/webdriver:bidi"] ++ BROWSERS[browser]["deps"] ++ deps,+ ),+ visibility = ["//rb:__subpackages__"],+ target_compatible_with = BROWSERS[browser]["target_compatible_with"],+ )
Avoid returning early from the macro; guard only the BiDi target creation with a conditional so other targets remain unaffected and macro flow stays predictable.
-if "bidi" not in tags:- return # don't create -bidi targets for non-BiDi tests+if "bidi" in tags:+ rb_test(+ name = "{}-{}-bidi".format(name, browser),+ size = "large",+ srcs = srcs,+ # ...+ )
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 6
__
Why:
Relevant best practice - Keep build macros pure and predictable by avoiding early returns that skip subsequent target generation unexpectedly; prefer structured conditionals so all intended targets are considered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
The goal is to run existing api through webdriver-bidi and webdriver-classic settings while we transition, but there is no need to run everything with webdriver-bidi when it hasn't been implemented yet
💥 What does this PR do?
reduces how many tests are run to only those affected
🔧 Implementation Notes
I was going to do this with Ruby guards, but that would be harder to deal with
🔄 Types of changes
PR Type
Enhancement
Description
Minimize Ruby BiDi test targets by only creating -bidi variants for tests explicitly tagged with "bidi"
Remove unnecessary BiDi test targets from skipped tests list
Consolidate BiDi-specific tests into dedicated test files with proper tagging
Simplify build configuration by eliminating redundant BiDi target generation
Diagram Walkthrough
File Walkthrough
tests.bzl
Add conditional BiDi target generation based on tagsrb/spec/tests.bzl
-biditarget creation for tests nottagged with "bidi"
build
needed
BUILD.bazel
Consolidate BiDi tests with selective taggingrb/spec/integration/selenium/webdriver/BUILD.bazel
bidi_spec.rbfrom standalone target to list-based generationwith "bidi" tag
navigation_spec.rbandnetwork_spec.rbto BiDi-specific testfiles
rb_integration_testdefinition to loop-basedgeneration for BiDi tests
network_spec.rbto exclusion list in glob patternBUILD.bazel
Tag BiDi tests with bidi identifierrb/spec/integration/selenium/webdriver/bidi/BUILD.bazel
"exclusive-if-local" tag
generation
.skipped-tests
Remove obsolete BiDi test skip entries.skipped-tests
service-chrome-bidi,driver-firefox-beta-bidi,element-chrome-bidiremovedgeneration
BUILD.bazel
Remove unused BiDi dependencyrb/spec/BUILD.bazel
//rb/spec/integration/selenium/webdriver:biditarget
library reference