[rb] Run unit tests as a single Bazel target instead of per-file#17616
Conversation
Review Summary by QodoConsolidate Ruby unit tests into single Bazel target for faster CI
WalkthroughsDescription• Consolidate 73 Ruby unit test targets into single //rb/spec/unit:unit target • Remove per-file rb_unit_test macro and individual BUILD.bazel files • Significantly reduce CI execution time (17-61% improvement across platforms) • Update documentation and test references to reflect new structure Diagramflowchart LR
A["73 individual unit test targets"] -->|consolidate| B["Single //rb/spec/unit:unit target"]
B -->|reduces| C["CI execution time"]
C -->|Windows| D["-47%"]
C -->|TruffleRuby| E["-61%"]
C -->|JRuby| F["-51%"]
File Changes2. rb/spec/unit/BUILD.bazel
|
Code Review by Qodo
1. Edits under third_party/firebug
|
|
Thank you, @titusfortner for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
Ruby unit tests take a long time under Bazel, especially on Windows.
Measured impact on the unit-test jobs on GitHub runner:
On RBE:
Aggregate compute goes from 24 minutes to 1 minute. Wall clock doesn't change much because everything is in parallel on RBE, but reducing total compute is good.
💥 What does this PR do?
Runs the Ruby unit specs as a single Bazel target (
//rb/spec/unit:unit) instead of generatingone
rb_testtarget per spec file (~73 targets).🔧 Implementation Notes
No CI changes were needed:
ci-ruby.ymlselects unit tests via--test_size_filters small //rb/spec/...,which still matches the single
size = "small"target.The motivation was Windows CI time. The cost on Windows/JRuby/TruffleRuby isn't test execution — it's
the per-target fixed overhead (no symlinks on Windows means the runfiles tree is copied per target,
plus interpreter/JVM startup) paid ~73×. Consolidating to one target pays that tax once.
Trade-offs, since this is a deliberate change:
(full re-run)
parallel target re-paying the copy/startup tax).
🤖 AI assistance
🔄 Types of changes