Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RUBYOPT's handling in tests #1097

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Apr 11, 2024

When debugging the issue related to ruby/irb#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

Copy link

launchable-app bot commented Apr 11, 2024

Launchable Report

❌ Test session #2825363 failedos:ubuntu-latest test_task:test_protocoldetails on CI
🔔 no issues ✖️1 test failed ✔️63 tests passed

Passed test sessions

✅ Test session #2825347 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825349 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825350 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825351 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825352 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825353 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2825355 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825357 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825358 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825359 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825360 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825373 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2825407 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825408 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825409 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825412 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825413 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825414 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2825423 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2825444 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2825457 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2825468 passed os:ubuntu-latest test_task:test_consoledetails on CI

Build: refs_pull_1097_merge_ec352d20ea65c331150d36bc214e196178f619ee

@st0012
Copy link
Member Author

st0012 commented Apr 11, 2024

Ruby head is failing because the commit it uses doesn't include the workaround in ruby/irb#919 yet. Once it picks a newer commit it should pass.

@st0012 st0012 force-pushed the use-bundler-to-run-console-tests branch from 0ebf72f to aba810f Compare April 11, 2024 20:34
When debugging the issue related to ruby/irb#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.

Further more, 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
@st0012 st0012 force-pushed the use-bundler-to-run-console-tests branch from aba810f to ec352d2 Compare April 18, 2024 10:53
@ko1
Copy link
Collaborator

ko1 commented Dec 17, 2024

Thank you.

@ko1 ko1 merged commit 3685859 into ruby:master Dec 17, 2024
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants