Add test coverage for legacy iOS database import + migration orchestr… - #1042
Merged
Conversation
…ation Splits LegacyMigrator.importDatabase into a pure buildLegacyPayload(realm:) (Realm -> JSON, no Room writes) plus a thin importLegacyDatabase(at:) wrapper, drops `private` from deleteLegacyArtefacts, and parameterizes runIfNeeded (defaults/documentsPath/importDatabase, all defaulting to production behaviour) so each is independently testable without touching real Realm/Room/UserDefaults.standard state. Adds LegacyMigratorDatabaseTests.swift: 19 cases covering payload building (marker field mapping, isTemp exclusion, name-fallback chain, waypoint ordering, unresolvable-waypoint route skipping, shared markers across routes, empty realm), artefact deletion, and runIfNeeded's four branches (fresh install, successful import, failed import retry, already done). Unverified locally - no macOS/Xcode toolchain available in this environment; needs an xcodebuild run before this is trusted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
davecraig
had a problem deploying
to
development
August 27, 2026 08:22 — with
GitHub Actions
Failure
LegacyMigratorDatabaseTests builds its fixtures with RealmSwift, but the iosAppTests target only depended on the iosApp target. Package products aren't inherited across a target dependency, so the xctest bundle had no RealmSwift to link against and `xcodebuild build-for-testing` failed with undefined symbols (Realm.init(configuration:queue:), _RLMRealmPathForFile, ...) for arm64. Add the package to the test target with `embed: false` -- the host app already embeds the framework and the bundle loads inside Soundscape.app. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The single `test` job ran the unit tests, built the debug APK and then ran the instrumentation tests on an emulator, all in series. The two test suites don't depend on each other, so split them into `unit-test` and `instrumentation-test`, which run in parallel alongside lint and ios-test. Both jobs fetch the offline map fixtures -- the unit tests read them out of the test resources and the instrumentation job pushes one onto the emulator -- but that step is cached, so the duplicate fetch is cheap. assembleDebug stays ahead of the emulator step in the instrumentation job so the slow Gradle work doesn't run with an emulator sitting open. Note that the `main` ruleset still requires a status check named `test`, which no longer exists; the required checks need updating to the new job names before this can merge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
davecraig
had a problem deploying
to
development
August 27, 2026 09:09 — with
GitHub Actions
Failure
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.
…ation
Splits LegacyMigrator.importDatabase into a pure buildLegacyPayload(realm:) (Realm -> JSON, no Room writes) plus a thin importLegacyDatabase(at:) wrapper, drops
privatefrom deleteLegacyArtefacts, and parameterizes runIfNeeded (defaults/documentsPath/importDatabase, all defaulting to production behaviour) so each is independently testable without touching real Realm/Room/UserDefaults.standard state.Adds LegacyMigratorDatabaseTests.swift: 19 cases covering payload building (marker field mapping, isTemp exclusion, name-fallback chain, waypoint ordering, unresolvable-waypoint route skipping, shared markers across routes, empty realm), artefact deletion, and runIfNeeded's four branches (fresh install, successful import, failed import retry, already done).
Unverified locally - no macOS/Xcode toolchain available in this environment; needs an xcodebuild run before this is trusted.