Improve RUBYOPT's handling in tests
When debugging the issue related to https://github.com/ruby/irb/pull/919, I noticed that debugger tests don't respect the IRB version I specified in the Gemfile. This is because console tests force override the RUBYOPT env, which will remove the -rbundler/setup injected by bundler.
Additionally, if tests use run_rdbg with the rubyopt option, the RUBYOPT will be overridden yet again.
So in this commit I did 2 improvements:
-
run_rdbgshould append instead of override RUBYOPT - If tests are executed with bundler, we also run the debugger in PTY process with bundler by appending
-rbundler/setupto RUBYOPT
Launchable Report
:x: Test session #2825363 failed
details on CI
:bell: no issues :heavy_multiplication_x:1 test failed :heavy_check_mark:63 tests passed
Passed test sessions
:white_check_mark: Test session #2825347 passed
details on CI
:white_check_mark: Test session #2825349 passed
details on CI
:white_check_mark: Test session #2825350 passed
details on CI
:white_check_mark: Test session #2825351 passed
details on CI
:white_check_mark: Test session #2825352 passed
details on CI
:white_check_mark: Test session #2825353 passed
details on CI
:white_check_mark: Test session #2825355 passed
details on CI
:white_check_mark: Test session #2825357 passed
details on CI
:white_check_mark: Test session #2825358 passed
details on CI
:white_check_mark: Test session #2825359 passed
details on CI
:white_check_mark: Test session #2825360 passed
details on CI
:white_check_mark: Test session #2825373 passed
details on CI
:white_check_mark: Test session #2825407 passed
details on CI
:white_check_mark: Test session #2825408 passed
details on CI
:white_check_mark: Test session #2825409 passed
details on CI
:white_check_mark: Test session #2825412 passed
details on CI
:white_check_mark: Test session #2825413 passed
details on CI
:white_check_mark: Test session #2825414 passed
details on CI
:white_check_mark: Test session #2825423 passed
details on CI
:white_check_mark: Test session #2825444 passed
details on CI
:white_check_mark: Test session #2825457 passed
details on CI
:white_check_mark: Test session #2825468 passed
details on CI
Build: refs_pull_1097_merge_ec352d20ea65c331150d36bc214e196178f619ee
Ruby head is failing because the commit it uses doesn't include the workaround in https://github.com/ruby/irb/pull/919 yet. Once it picks a newer commit it should pass.
Thank you.