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

PackageTypeTests: fixed iOS 12 #2807

Merged
merged 1 commit into from
Jul 14, 2023
Merged

PackageTypeTests: fixed iOS 12 #2807

merged 1 commit into from
Jul 14, 2023

Conversation

NachoSoto
Copy link
Contributor

Follow up to #2797.
These tests are failing there because:

failed - Failed encoding 'PackageType.unknown': invalidValue(PackageType.unknown, Swift.EncodingError.Context(codingPath: [], debugDescription: "Top-level PackageType encoded as null JSON fragment.", underlyingError: nil))

@NachoSoto NachoSoto added the test label Jul 13, 2023
@NachoSoto NachoSoto requested a review from a team July 13, 2023 17:19
@NachoSoto NachoSoto enabled auto-merge (squash) July 13, 2023 17:19
override func setUpWithError() throws {
try super.setUpWithError()

// iOS 12 does not support encoding top level objects as JSON
Copy link
Member

Choose a reason for hiding this comment

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

Could you elaborate on this?
how does the extension work in older versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works, we just can't test it with these as top level objects.
We'd have to test it encoding something like [String: PackageType].

So solutions:

  • Update test so it works in iOS 12 too (I didn't do it because I didn't think it was worth it)
  • Improve comment to make that more clear

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

maybe we can set this up as something to follow-up on after the 2 weeks? Like, I don't think it's worth spending a lot of time on right now, but... We've had issues with iOS 12 in the not-too-distant past

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's worth spending a lot of time on right now,

Yeah that's why I took this approach.
But it's trivial to update the test to avoid this being a root type, let me just do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aboedo done.

@NachoSoto NachoSoto disabled auto-merge July 13, 2023 22:54
Follow up to #2797.
These tests are failing there because:
```
failed - Failed encoding 'PackageType.unknown': invalidValue(PackageType.unknown, Swift.EncodingError.Context(codingPath: [], debugDescription: "Top-level PackageType encoded as null JSON fragment.", underlyingError: nil))
```
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #2807 (9784622) into main (e2ecdd0) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2807      +/-   ##
==========================================
+ Coverage   86.54%   86.56%   +0.02%     
==========================================
  Files         215      215              
  Lines       15484    15484              
==========================================
+ Hits        13400    13404       +4     
+ Misses       2084     2080       -4     

see 2 files with indirect coverage changes

@NachoSoto NachoSoto merged commit a131cbd into main Jul 14, 2023
2 checks passed
@NachoSoto NachoSoto deleted the fix-ios-12-tests branch July 14, 2023 18:10
NachoSoto added a commit that referenced this pull request Jul 19, 2023
**This is an automatic release.**

### Dependency Updates
* Bump fastlane from 2.213.0 to 2.214.0 (#2824) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* `MainThreadMonitor`: don't crash if there is no test in progress
(#2838) via NachoSoto (@NachoSoto)
* `CI`: fixed Fastlane APITester lanes (#2836) via NachoSoto
(@NachoSoto)
* `Integration Tests`: workaround Swift runtime crash (#2826) via
NachoSoto (@NachoSoto)
* `@EnsureNonEmptyArrayDecodable` (#2831) via NachoSoto (@NachoSoto)
* `iOS 17`: added tests for simulating cancellations (#2597) via
NachoSoto (@NachoSoto)
* `CI`: make all `Codecov` jobs `informational` (#2828) via NachoSoto
(@NachoSoto)
* `MainThreadMonitor`: check deadlocks only ever N seconds (#2820) via
NachoSoto (@NachoSoto)
* New `@NonEmptyStringDecodable` (#2819) via NachoSoto (@NachoSoto)
* `MockDeviceCache`: avoid using real `UserDefaults` (#2814) via
NachoSoto (@NachoSoto)
* `throwAssertion`: fixed Xcode 15 compilation (#2813) via NachoSoto
(@NachoSoto)
* `CustomEntitlementsComputation`: fixed API testers (#2815) via
NachoSoto (@NachoSoto)
* `PackageTypeTests`: fixed iOS 12 (#2807) via NachoSoto (@NachoSoto)
* `Tests`: avoid race-condition in leak detection (#2806) via NachoSoto
(@NachoSoto)
* Revert "`Unit Tests`: removed leak detection" (#2805) via NachoSoto
(@NachoSoto)
* `PackageType: Codable` implementation (#2797) via NachoSoto
(@NachoSoto)
* `SystemInfo.init` no longer `throws` (#2803) via NachoSoto
(@NachoSoto)
* `Trusted Entitlements`: add support for signing `POST` body (#2753)
via NachoSoto (@NachoSoto)
* `Tests`: unified default timeouts (#2801) via NachoSoto (@NachoSoto)
* `Tests`: removed forced-unwrap (#2799) via NachoSoto (@NachoSoto)
* `Tests`: added missing `super.setUp()` (#2804) via NachoSoto
(@NachoSoto)
* Replaced `FatalErrorUtil` with `Nimble` (#2802) via NachoSoto
(@NachoSoto)
* `Tests`: fixed another flaky test (#2795) via NachoSoto (@NachoSoto)
* `TimingUtil`: improved tests by using `Clock` (#2794) via NachoSoto
(@NachoSoto)
* `IgnoreDecodeErrors`: log decoding error (#2778) via NachoSoto
(@NachoSoto)
* `TestLogHandler`: changed all tests to explicitly deinitialize it
(#2784) via NachoSoto (@NachoSoto)
* `LocalReceiptParserStoreKitTests`: fixed flaky test failure (#2785)
via NachoSoto (@NachoSoto)
* `Unit Tests`: removed leak detection (#2792) via NachoSoto
(@NachoSoto)
* `Tests`: fixed another flaky failure with asynchronous check (#2786)
via NachoSoto (@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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