Improve unit test coverage#23
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands unit test coverage around API key persistence/behavior, error mapping, and client delegation, and wires a new ConnectClient test target into the package/Xcode test configuration.
Changes:
- Add new focused tests for
APIKeyencoding/decoding/equality/hashing and keychain conversions, plus additionalAPIKeyControllerbehaviors (sorting, lazy-load, delete, preview). - Add new behavioral tests for
mapErrorToConnectErrorandAppStoreConnectClientrequest delegation. - Register
ConnectClientTestsin SwiftPM + Xcode scheme/test plan and fix anAPIKeyErrormessage formatting issue.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/ConnectCoreTests/MapErrorTests.swift | Adds coverage for mapErrorToConnectError mapping behavior (localized, cancelled, service errors, unhandled). |
| Tests/ConnectClientTests/AppStoreConnectClientTests.swift | Adds delegation tests for decoded/empty/paged client requests. |
| Tests/ConnectAccountsTests/ListAPIKeysTests.swift | Adds sorting-by-name coverage for loadAPIKeys(). |
| Tests/ConnectAccountsTests/DeleteAPIKeyTests.swift | Adds coverage for lazy-load delete, missing-key behavior, and preview state. |
| Tests/ConnectAccountsTests/APIKeyTests.swift | Adds focused APIKey encoding/decoding/hash/equality and keychain round-trip tests. |
| Tests/ConnectAccountsTests/APIKeyTestHelpers.swift | Introduces shared APIKeyFixture test helper. |
| Tests/ConnectAccountsTests/AddAPIKeyTests.swift | Adds coverage for sorted insertion and lazy-load behavior in addAPIKey. |
| Testplan.xctestplan | Includes the new ConnectClientTests target in the test plan. |
| Sources/ConnectAccounts/APIKeyError.swift | Fixes missing closing parenthesis in an error message. |
| Package.swift | Adds the ConnectClientTests SwiftPM test target. |
| .swiftpm/xcode/xcshareddata/xcschemes/AppStoreConnectKit-Package.xcscheme | Adds ConnectClientTests to the Xcode scheme test action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
===========================================
+ Coverage 73.67% 85.11% +11.43%
===========================================
Files 23 27 +4
Lines 946 1169 +223
===========================================
+ Hits 697 995 +298
+ Misses 249 174 -75 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Coverage