Repository navigation
Run the tests on iOS and add the iOS CI job #373 - #402
Merged
Merged
Conversation
- MockK doesn't run on Kotlin/Native, so the use-case, repository and ViewModel tests move to commonTest on hand-written fakes: a configurable FakeMarketRepository in core:testing, FakeMarketsApi/FakeMarketDao next to the repository test, real HttpResponses from ktor's MockEngine. MockK is dropped from the catalog - Kotest on Native: the KMP convention applies KSP and the io.kotest plugin in modules with a commonTest, so iosSimulatorArm64Test runs every spec - DAO checks live once in commonTest (MarketDaoChecks), run by the Robolectric MarketDaoTest and the iOS MarketDaoSpec, each with its own inMemoryMarketDatabase() actual (BundledSQLiteDriver on iOS) - iosAppTests: Swift Testing tests on ScreenModel, in a hosted test bundle that doesn't link a second copy of Shared - MarketDetailScreenTest builds the real use cases on the fake, so they're final again - CI: an ios job on macOS that selects the newest Xcode, picks the newest iPhone simulator, runs iosSimulatorArm64Test and xcodebuild test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated by 🚫 Danger Kotlin against e1d1007 |
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.
Closes #373 (part of #356 Phase 2).
What
MarketRepositoryImplTest, 3 ViewModel tests) move tocommonTest.FakeMarketRepository(core:testing) is now configurable per method and records calls. Its defaults are unchanged.FakeMarketsApi/FakeMarketDaoand realHttpResponses from ktor'sMockEngine(new test-only depktor-client-mock).mockk-androidleave the catalog.composenews.kmp.libraryapplies KSP and theio.kotestplugin in modules with asrc/commonTest, soiosSimulatorArm64Testfinds every spec.commonTest(MarketDaoChecks). The RobolectricMarketDaoTestand the iOSMarketDaoSpecrun them, each with its owninMemoryMarketDatabase()actual (AndroidSQLiteDriver/BundledSQLiteDriver).iosAppTestsbundle with threeScreenModeltests: initial state, events reaching the ViewModel, and dropping the model clearing it. It's hosted by the app and doesn't link a second copy ofShared.MarketDetailScreenTest(androidTest) builds the real use cases on the fake, soGetMarketChartUseCase,GetMarketDetailUseCaseandToggleFavoriteMarketListUseCaseare final again.iosjob onmacos-latest(60 min timeout). It selects the newest installed Xcode, picks the newest iPhone simulator (failing clearly if there's none), then runs:shared:linkDebugFrameworkIosSimulatorArm64 iosSimulatorArm64Testandxcodebuild test. The Android job is unchanged.Verified locally
./gradlew test lintKotlin detektAll linkDebugTestIosSimulatorArm64 :konsist:testand theapp/marketdetail:uiandroidTest compiles pass.xcodebuild build-for-testingfor a generic simulator succeeds.Not run locally
This Mac has no iOS Simulator runtime, so the Kotlin tests on iOS, the Swift tests and the new CI steps run for the first time in this PR's
iosjob.🤖 Generated with Claude Code