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

Require debug/prelude in spec helper #2273

Merged
merged 2 commits into from Mar 20, 2024
Merged

Require debug/prelude in spec helper #2273

merged 2 commits into from Mar 20, 2024

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented Mar 16, 2024

Because the latest debug gem now requires Ruby >= 2.7, if we require debug in older Rubies, it'll require a very outdated debug lib instead.

Also, requiring debug activates the debugger even when no breakpoints are set. Requiring debug/prelude can avoid it while allowing the use of breakpoints like binding.break or debugger.

Closes #2266

#skip-changelog

Because the latest debug gem now require Ruby >= 2.7, if we require `debug`
in older Rubies, it'll require a very outdated debug lib instead.
@st0012 st0012 added the testing label Mar 16, 2024
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Merging #2273 (34c1f19) into master (478c4cf) will increase coverage by 0.20%.
Report is 14 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2273      +/-   ##
==========================================
+ Coverage   97.41%   97.61%   +0.20%     
==========================================
  Files         102      112      +10     
  Lines        3828     4155     +327     
==========================================
+ Hits         3729     4056     +327     
  Misses         99       99              
Components Coverage Δ
sentry-ruby 98.30% <ø> (+0.16%) ⬆️
sentry-rails 95.05% <ø> (ø)
sentry-sidekiq 94.70% <ø> (ø)
sentry-resque 92.30% <ø> (+1.53%) ⬆️
sentry-delayed_job 95.60% <ø> (ø)
sentry-opentelemetry 100.00% <ø> (ø)

see 20 files with indirect coverage changes

@st0012 st0012 changed the title Only require debug when Ruby >= 2.7 Require debug/prelude in spec helper Mar 20, 2024
Requiring `debug` activates the debugger even when no breakpoints are hit.
Although the chance is low, it may slow down the test suite and/or cause
unexpected behavior.

This change requires `debug/prelude` instead of `debug` to avoid the
above issue while still allowing the use of breakpoints.
@st0012 st0012 merged commit a3375e8 into master Mar 20, 2024
123 of 124 checks passed
@st0012 st0012 deleted the fix-debug-requires branch March 20, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

investigate Ruby 2.6 & Rails 6.1.0 test
2 participants