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

Implement close API that cleans up state and reverses init logic #1844

Merged
merged 8 commits into from
Jul 19, 2022

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Jul 12, 2022

This helps some testing environments where they need to init/close around each test and expect the SDK to cleanup state.

The only logic not reversed is apply_patches which is fine since they already check if the patch is already applied and also no-op if initialized? is false.

fixes #1842

The only logic not reversed is `apply_patches` which is fine
since they already check if the patch is already applied
and also no-op if `initialized?` is false.
@st0012
Copy link
Collaborator

st0012 commented Jul 12, 2022

Can we have these test cases?

  • It can clean up the initialized SDK
  • The SDK can be reinitialized after cleaned up
  • It doesn't cause issues when called on the uninitialized SDK
  • It doesn't cause issues when called on the cleaned up SDK

@sl0thentr0py sl0thentr0py marked this pull request as ready for review July 13, 2022 14:06
@sl0thentr0py sl0thentr0py requested a review from st0012 July 13, 2022 14:06
@sl0thentr0py
Copy link
Member Author

@st0012 let me know if you're happy with the specs!

sentry-ruby/spec/sentry_spec.rb Outdated Show resolved Hide resolved
sentry-ruby/spec/sentry_spec.rb Outdated Show resolved Hide resolved
@st0012 st0012 added this to In progress in 5.x via automation Jul 16, 2022
@st0012 st0012 added this to the 5.4.0 milestone Jul 16, 2022
@sl0thentr0py sl0thentr0py requested a review from st0012 July 18, 2022 12:42
sentry-ruby/CHANGELOG.md Outdated Show resolved Hide resolved
sentry-ruby/lib/sentry-ruby.rb Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2022

Codecov Report

Merging #1844 (eb48be2) into master (1db9d5f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1844   +/-   ##
=======================================
  Coverage   98.37%   98.38%           
=======================================
  Files         146      146           
  Lines        8683     8735   +52     
=======================================
+ Hits         8542     8594   +52     
  Misses        141      141           
Impacted Files Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 96.51% <100.00%> (+0.21%) ⬆️
sentry-ruby/spec/sentry_spec.rb 99.79% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1db9d5f...eb48be2. Read the comment docs.

@sl0thentr0py sl0thentr0py requested a review from st0012 July 19, 2022 10:05
@st0012 st0012 merged commit 2f3e11a into master Jul 19, 2022
5.x automation moved this from In progress to Done Jul 19, 2022
@st0012 st0012 deleted the neel/close-api branch July 19, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5.x
Done
Development

Successfully merging this pull request may close these issues.

Add close api for sdk
4 participants