ruby / debug

Debugging functionality for Ruby
BSD 2-Clause "Simplified" License
1.14k stars 127 forks source link

Improve RUBYOPT's handling in tests #1097

Open st0012 opened 7 months ago

st0012 commented 7 months ago

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:

  1. run_rdbg should append instead of override RUBYOPT
  2. If tests are executed with bundler, we also run the debugger in PTY process with bundler by appending -rbundler/setup to RUBYOPT
launchable-app[bot] commented 7 months ago

Launchable Report

:x: Test session #2825363 failedos:ubuntu-latest test_task:test_protocoldetails 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](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825347) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825347) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825347) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825349](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825349) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825349) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825349) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825350](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825350) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825350) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825350) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825351](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825351) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825351) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825351) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825352](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825352) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825352) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825352) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825353](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825353) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825353) [![test_task:test_test](https://img.shields.io/badge/test__task-test__test-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825353) [details on CI](https://github.com/ruby/debug/actions/runs/8736664543) :white_check_mark: Test session [#2825355](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825355) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825355) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825355) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825357](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825357) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825357) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825357) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825358](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825358) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825358) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825358) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825359](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825359) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825359) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825359) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825360](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825360) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825360) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825360) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825373](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825373) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825373) [![test_task:test_protocol](https://img.shields.io/badge/test__task-test__protocol-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825373) [details on CI](https://github.com/ruby/debug/actions/runs/8736664548) :white_check_mark: Test session [#2825407](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825407) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825407) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825407) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825408](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825408) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825408) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825408) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825409](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825409) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825409) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825409) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825412](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825412) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825412) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825412) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825413](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825413) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825413) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825413) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825414](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825414) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825414) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825414) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539) :white_check_mark: Test session [#2825423](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825423) passed [![os:macos-latest](https://img.shields.io/badge/os-macos--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825423) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825423) [details on CI](https://github.com/ruby/debug/actions/runs/8736664545) :white_check_mark: Test session [#2825444](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825444) passed [![os:macos-latest](https://img.shields.io/badge/os-macos--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825444) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825444) [details on CI](https://github.com/ruby/debug/actions/runs/8736664545) :white_check_mark: Test session [#2825457](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825457) passed [![os:macos-latest](https://img.shields.io/badge/os-macos--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825457) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825457) [details on CI](https://github.com/ruby/debug/actions/runs/8736664545) :white_check_mark: Test session [#2825468](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825468) passed [![os:ubuntu-latest](https://img.shields.io/badge/os-ubuntu--latest-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825468) [![test_task:test_console](https://img.shields.io/badge/test__task-test__console-blue.svg)](https://app.launchableinc.com/organizations/ruby/workspaces/debug/data/test-sessions/2825468) [details on CI](https://github.com/ruby/debug/actions/runs/8736664539)

Build: refs_pull_1097_merge_ec352d20ea65c331150d36bc214e196178f619ee

st0012 commented 7 months ago

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.