[rb] resolve spec runfiles via Bazel::Runfiles#17810
Conversation
PR Summary by QodoResolve Ruby spec runfiles via Bazel::Runfiles (manifest + dir support)
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
|
Code review by qodo was updated up to the latest commit aad21e1 |
There was a problem hiding this comment.
Pull request overview
This PR consolidates Ruby integration spec runfiles path resolution by introducing a shared Bazel::Runfiles helper (vendored from rules_ruby#374) and switching spec configuration to use Bazel $(rlocationpath ...) values, enabling manifest-based resolution for environments where RUNFILES_DIR is not set (e.g., Windows/RBE).
Changes:
- Switches pinned browser/driver env vars in
rb/spec/tests.bzlfrom$(location ...)to$(rlocationpath ...). - Replaces the hand-rolled
rlocationhelper intest_environment.rbwithBazel::Runfiles.createandrunfiles.rlocation(...). - Adds a vendored
Bazel::Runfilesimplementation underspec_support/bazel/runfiles.rb.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rb/spec/tests.bzl | Updates spec env var wiring to use $(rlocationpath ...) for runfiles-friendly paths. |
| rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb | Uses Bazel::Runfiles for resolving Bazel-provided paths (including manifest-based resolution). |
| rb/spec/integration/selenium/webdriver/spec_support/bazel/runfiles.rb | Adds vendored Bazel::Runfiles helper used by the Ruby spec suite. |
|
Code review by qodo was updated up to the latest commit b4c64bd |
|
Code review by qodo was updated up to the latest commit 37898fa |
|
Code review by qodo was updated up to the latest commit feb389c |
|
Code review by qodo was updated up to the latest commit e4a63fb |
|
Code review by qodo was updated up to the latest commit 3f2938b |
🔗 Related Issues
Adopts the runfiles library from bazel-contrib/rules_ruby#374 ahead of it merging/releasing.
💥 What does this PR do?
Consolidates the Ruby spec suite's runfiles path resolution onto a single
Bazel::Runfileshelper, replacing the hand-rolledrlocationmethod intest_environment.rb. The pinned browser, driver, and JDK paths now flow through$(rlocationpath ...)in the BUILD files and resolve via the shared library, which additionally understands the runfiles manifest — so resolution works on Windows and RBE where only a manifest exists andRUNFILES_DIRis unset.🔧 Implementation Notes
The
Bazel::Runfileshelper is vendored atrb/lib/bazel/runfiles.rband loaded withrequire 'bazel/runfiles'. It sits underrb/lib(the Ruby load-path root, so the require resolves for free) rather than the spec tree, so non-spec code can require it too, and because that path mirrors exactly what rules_ruby#374 exposes. It is not packaged in the gem — the gemspec globs onlylib/selenium/webdriver/**— and it is excluded from Steep as build/test tooling. This is an interim vendor: when a rules_ruby release shipsBazel::Runfiles, deleterb/lib/bazel/runfiles.rb, drop the Steep ignore, and add the@rules_ruby//ruby/runfilesdep — everyrequire 'bazel/runfiles'line stays and silently resolves against the ruleset's built-in instead.🤖 AI assistance
test_environment.rbrefactor, and thetests.bzl/BUILD wiring💡 Additional Considerations
Placed in
rb/lib/bazel(not the spec tree) so the BiDi/CDP generators can adopt it next; migrating them (bidi_generate.rb,check_generated.rb#schema_path) needs a small load-path shim under stock rules_ruby and is deferred to a follow-up.🔄 Types of changes