fix(ios): repair stale RootKey XCTests and the CI that masked them#134
Open
gmaclennan wants to merge 2 commits into
Open
fix(ios): repair stale RootKey XCTests and the CI that masked them#134gmaclennan wants to merge 2 commits into
gmaclennan wants to merge 2 commits into
Conversation
`RootKeyStore.loadOrInitialize()` and the `RootKeyProvider` closure now return `RootKeyResult` (`.key` / `.generated`), not raw `Data`. The example app's XCTest sources still used the old shape and failed to compile: - RootKeyStoreTests: `.count` / `==` on the result -> use `.key`, and assert `.generated` (true on first call, false on the second). - ComapeoCoreModuleTests: the `rootKeyProvider` closure returned `Data` -> wrap in `RootKeyResult`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`xcodebuild test ... | tee xcodebuild-test.log` made the step exit with tee's status (always 0), so a failing or non-compiling test target was reported green -- which is why the stale RootKey XCTests went unnoticed. Add `set -o pipefail`. Also fix the failure-summary step's log path (`example/ios` -> `apps/example/ios`) so it can actually dump the log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What & why
RootKeyStore.loadOrInitialize()and theRootKeyProviderclosure return aRootKeyResultstruct (.key: Data,.generated: Bool) — seeios/NodeJSService.swiftandios/RootKeyStore.swift. The example app's XCTest sources still treated the return value as rawDataand did not compile against the current API.Test fixes
apps/example/tests/ios/RootKeyStoreTests.swift—first.count→first.key.count,first == second→first.key == second.key; addedXCTAssertTrue(first.generated)/XCTAssertFalse(second.generated)(first call generates, second loads).apps/example/tests/ios/ComapeoCoreModuleTests.swift— therootKeyProviderclosure returnedData; wrapped it inRootKeyResult. The whole test target compiles together, so this had to be fixed alongsideRootKeyStoreTests.CI fix (why this stayed broken)
While checking why CI was green despite tests that don't compile, I found the
Run integration testsstep masks failures:The pipe makes the step exit with
tee's status (always0), so a failing or non-compiling test target reported green — the stale tests had been broken onmainfor weeks unnoticed. Fixed by addingset -o pipefail. Also fixed theSurface xcodebuild failure summarystep, which grepped the wrong path (example/ios/…→apps/example/ios/…).Verification
Ran the full CI pipeline locally (npm install → download nodejs-mobile → backend build → expo prebuild → pod install →
xcodebuild test) on Xcode 26.5 / iOS 26.5 sim.Keychain error: OSStatus -34018(errSecMissingEntitlement) and exits before the runner connects. This is the documented "local sim can't run the backend" limitation; actual pass/fail belongs on a real device / BrowserStack.With
pipefailin place and the target now compiling, theintegration-testsjob will actually gate onxcodebuild testfor the first time — and will likely go red on the same-34018(the example app has nokeychain-access-groupsentitlement and the CI build usesCODE_SIGNING_ALLOWED=NO). That's previously-hidden state surfacing, not a regression from this PR. Follow-up options: add a sim keychain entitlement, scope the job to non-backend tests, or move that coverage to the device/BrowserStack path.🤖 Generated with Claude Code