Skip to content

HTTPClientTests: refactored tests to use waitUntil#2257

Merged
NachoSoto merged 2 commits into
mainfrom
http-client-tests-wait-until-2
Feb 3, 2023
Merged

HTTPClientTests: refactored tests to use waitUntil#2257
NachoSoto merged 2 commits into
mainfrom
http-client-tests-wait-until-2

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

See also #2168 and #2071.

I was looking into randomness in tests that might lead to test coverage fluctuations and saw that these tests could be simplified to avoid use of toEventually.

@NachoSoto NachoSoto added the test label Feb 2, 2023
@NachoSoto NachoSoto requested a review from a team February 2, 2023 17:38
See also #2168 and #2071.

I was looking into randomness in tests that might lead to test coverage fluctuations and saw that these tests could be simplified to avoid use of `toEventually`.
@RevenueCat RevenueCat deleted a comment from codecov Bot Feb 2, 2023
@NachoSoto NachoSoto force-pushed the http-client-tests-wait-until-2 branch from 99a297d to c99fc47 Compare February 2, 2023 23:04
@codecov

codecov Bot commented Feb 2, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2257 (99a297d) into main (2e689b1) will decrease coverage by 0.05%.
The diff coverage is n/a.

❗ Current head 99a297d differs from pull request most recent head c99fc47. Consider uploading reports for the commit c99fc47 to get more accurate results

@@            Coverage Diff             @@
##             main    #2257      +/-   ##
==========================================
- Coverage   85.89%   85.85%   -0.05%     
==========================================
  Files         183      183              
  Lines       12119    12125       +6     
==========================================
  Hits        10410    10410              
- Misses       1709     1715       +6     
Impacted Files Coverage Δ
...s/Logging/Strings/ManageSubscriptionsStrings.swift 75.00% <0.00%> (-6.25%) ⬇️
...chasing/StoreKitAbstractions/SK1StoreProduct.swift 92.30% <0.00%> (-5.77%) ⬇️
Sources/Support/ManageSubscriptionsHelper.swift 68.04% <0.00%> (-2.07%) ⬇️
...ources/Purchasing/IntroEligibilityCalculator.swift 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

self.client.perform(request) { (_: EmptyResponse) in completion() }
}

expect(headerPresent.value).toEventually(equal(true))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a few of these didn't have a timeout and will have it now so it's a slight change, but I think those are ok.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

toEventually had a default timeout as well.

@NachoSoto NachoSoto enabled auto-merge (squash) February 3, 2023 15:09
@NachoSoto NachoSoto merged commit ec69c2d into main Feb 3, 2023
@NachoSoto NachoSoto deleted the http-client-tests-wait-until-2 branch February 3, 2023 15:18
NachoSoto pushed a commit that referenced this pull request Feb 8, 2023
**This is an automatic release.**

### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `738f255` to `9255366`
(#2264) via dependabot[bot] (@dependabot[bot])
* Update `Gemfile.lock` (#2254) via Cesar de la Vega (@vegaro)
### Other Changes
* `HTTPClient`: added support for sending `X-Nonce` (#2214) via
NachoSoto (@NachoSoto)
* `Configuration`: added (`internal` for now) API to load public key
(#2215) via NachoSoto (@NachoSoto)
* Replaced `Any` uses for workaround with `Box` (#2250) via NachoSoto
(@NachoSoto)
* `HTTPClientTests`: fixed failing test with missing assertions (#2262)
via NachoSoto (@NachoSoto)
* `HTTPClientTests`: refactored tests to use `waitUntil` (#2257) via
NachoSoto (@NachoSoto)
* PurchaseTester: Add Receipt Inspector UI (#2249) via Andy Boedo
(@aboedo)
* Adds dependabot (#2259) via Cesar de la Vega (@vegaro)
* `StoreKit1WrapperTests`: avoid using `Bool.random` to fix flaky code
coverage (#2258) via NachoSoto (@NachoSoto)
* `IntroEligibilityCalculator`: changed logic to handle products with no
subscription group (#2247) via NachoSoto (@NachoSoto)
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.

2 participants