Skip to content

Conversation

@armcknight
Copy link
Member

  • added tearDown methods that call clearTestState in other test cases that use SentryDependencyContainer (I missed these in test: clear test state in any test case using SentryDependencyContainer #3378 because I'd only searched for existing tearDown methods that were missing calls to clearTestState and not missing tearDown methods)
  • in a few ObjC test cases, just call [SentryDependencyContainer reset] because I haven't figured out how to access clearTestState from ObjC code
  • remove unused TestURLSession class

#skip-changelog

@codecov
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #3381 (0ec44dc) into main (282cc99) will decrease coverage by 0.005%.
The diff coverage is 100.000%.

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3381       +/-   ##
=============================================
- Coverage   89.323%   89.319%   -0.005%     
=============================================
  Files          500       499        -1     
  Lines        54869     54922       +53     
  Branches     19675     19686       +11     
=============================================
+ Hits         49011     49056       +45     
+ Misses        4983      4878      -105     
- Partials       875       988      +113     
Files Coverage Δ
...ts/SentryTests/Helper/SentryCurrentDateTests.swift 100.000% <100.000%> (ø)
Tests/SentryTests/Helper/SentryDateUtilTests.swift 100.000% <100.000%> (ø)
...Tests/Helper/SentryExtraContextProviderTests.swift 100.000% <100.000%> (ø)
.../Integrations/MetricKit/SentryMXManagerTests.swift 100.000% <100.000%> (ø)
...ns/MetricKit/SentryMetricKitIntegrationTests.swift 94.462% <100.000%> (+0.073%) ⬆️
...cking/SentryAppStartTrackingIntegrationTests.swift 91.666% <100.000%> (+0.087%) ⬆️
...egrations/SentryCrash/SentryCrashReportTests.swift 90.789% <100.000%> (+0.122%) ⬆️
...king/RateLimits/SentryDefaultRateLimitsTests.swift 100.000% <100.000%> (ø)
...rking/RateLimits/SentryRateLimitsParserTests.swift 100.000% <100.000%> (ø)
...RateLimits/SentryRetryAfterHeaderParserTests.swift 90.000% <100.000%> (+1.111%) ⬆️
... and 10 more

... and 31 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. What about adding a base test class that clears the test state in setup and teardown that all our tests use? If you agree, I will open up a PR.

@armcknight
Copy link
Member Author

LGTM. What about adding a base test class that clears the test state in setup and teardown that all our tests use? If you agree, I will open up a PR.

Yeah, I agree this would be ideal. I attempted it a while back as part of #2426 but the refactor proved to be too big. It would be better if it were scoped just to clearing test state at first, then maybe consider fixture/sut abstraction later.

@armcknight armcknight merged commit 89b645d into main Nov 7, 2023
@armcknight armcknight deleted the armcknight/test/more-state-cleanup branch November 7, 2023 18:54
Sign up for free to 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.

3 participants