Skip to content

Commit 7e19893

Browse files
committed
[rb] Replace debug session with Bazel run_under flag
This helps to avoid conflicts with RubyMine built-in debugger.
1 parent 69f44a3 commit 7e19893

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ test:windows --test_env=PROGRAMFILES(X86)="C:\\Program Files (x86)"
7777
test --test_timeout=1800
7878

7979
test:node_debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
80+
test:ruby_debug --test_output=streamed --test_env=RUBY_DEBUG_FORK_MODE=parent --run_under="@bundle//:bin/rdbg --nonstop --open --command"
8081

8182
# The RBE to use
8283
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ echo 'RUBY_VERSION = "<X.Y.Z>"' > rb/ruby_version.bzl
274274
If you want to debug code in tests, you can do it via [`debug`](https://github.com/ruby/debug) gem:
275275

276276
1. Add `binding.break` to the code where you want the debugger to start.
277-
2. Run `bazel test --test_output streamed <test>`. Streaming output is not required, but will clearly say when debugger starts.
277+
2. Run tests with `ruby_debug` configuration: `bazel test --config ruby_debug <test>`.
278278
3. When debugger starts, run the following in a separate terminal to connect to debugger:
279279

280280
```sh

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919

20-
begin
21-
require 'debug/session'
22-
DEBUGGER__::CONFIG[:fork_mode] = :parent
23-
DEBUGGER__.open(nonstop: true)
24-
rescue LoadError
25-
# not supported on JRuby and TruffleRuby
26-
end
27-
2820
require 'rubygems'
2921
require 'time'
3022
require 'rspec'

0 commit comments

Comments
 (0)