Skip to content

Improve RUBYOPT's handling in tests - #1097

Merged
ko1 merged 1 commit into
ruby:masterfrom
Shopify:use-bundler-to-run-console-tests
Dec 17, 2024
Merged

Improve RUBYOPT's handling in tests#1097
ko1 merged 1 commit into
ruby:masterfrom
Shopify:use-bundler-to-run-console-tests

Conversation

@st0012

Copy link
Copy Markdown
Member

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

@cloudbees-smart-tests

cloudbees-smart-testsBot commented Apr 11, 2024

Copy link
Copy Markdown

Launchable Report

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

Passed test sessions

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

Build: refs_pull_1097_merge_ec352d20ea65c331150d36bc214e196178f619ee

@st0012

Copy link
Copy Markdown
MemberAuthor

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
st0012force-pushed the use-bundler-to-run-console-tests branch from 0ebf72f to aba810fCompareApril 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
st0012force-pushed the use-bundler-to-run-console-tests branch from aba810f to ec352d2CompareApril 18, 2024 10:53
@ko1

ko1 commented Dec 17, 2024

Copy link
Copy Markdown
Collaborator

Thank you.

@ko1
ko1 merged commit 3685859 into ruby:masterDec 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@st0012@ko1