Skip to content

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

Merged
st0012 merged 8 commits intomasterfrom
neel/close-api
Jul 19, 2022
Merged

Implement close API that cleans up state and reverses init logic#1844
st0012 merged 8 commits intomasterfrom
neel/close-api

Conversation

@sl0thentr0py
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Member Author

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

@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
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 19, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (1db9d5f) to head (eb48be2).
Report is 501 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1844   +/-   ##
=======================================
  Coverage   98.37%   98.38%           
=======================================
  Files         146      146           
  Lines        8683     8735   +52     
=======================================
+ Hits         8542     8594   +52     
  Misses        141      141           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sl0thentr0py sl0thentr0py requested a review from st0012 July 19, 2022 10:05
@st0012 st0012 merged commit 2f3e11a into master 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

None yet

Development

Successfully merging this pull request may close these issues.

Add close api for sdk

4 participants