Skip to content

Fix iOS tests, upgrade iOS Firebase SDK #198

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

Merged
merged 10 commits into from
Aug 9, 2021

Conversation

shepeliev
Copy link
Contributor

After updating Firebase iOS SDK some tests fail because ld could not find the required frameworks.
Another problem, FirebaseFirestore 8.1.0 has Carthage bug that is the cause of missing gRPC-C++ framework. This PR fixes these issues. Also, I've enabled iOS testing at GitHub actions. Unfortunately, auth tests fail on iOS simulator, therefore I've added a skip flag for ignoring tests on iOS.

@shepeliev shepeliev changed the title Fix ios tests Fix iOS tests, upgrade iOS Firebase SDK Jul 5, 2021
@Reedyuk Reedyuk requested a review from nbransby July 6, 2021 06:06
@nbransby
Copy link
Member

cant we skip the ios tests at the build script instead of at the test level @shepeliev @Reedyuk ?

@Reedyuk
Copy link
Collaborator

Reedyuk commented Jul 16, 2021

Yeah we could add something to skip ios tests in the build gradle if you want this?

@nbransby
Copy link
Member

@Reedyuk yeah as that will a lot easier to maintain that at code level, but its just the auth tests we want to skip correct?

@nbransby
Copy link
Member

@shepeliev last time I checked I thought the ios test didn't work at all - they just froze, in fact the runTest implementation was just a guess:

actual fun runTest(test: suspend () -> Unit) = runBlocking {
    val testRun = MainScope().async { test() }
    while (testRun.isActive) {
        NSRunLoop.mainRunLoop.runMode(
            NSDefaultRunLoopMode,
            beforeDate = NSDate.create(timeInterval = 1.0, sinceDate = NSDate())
        )
        yield()
    }
    testRun.await()
}

Are you saying this actually works now?

@shepeliev
Copy link
Contributor Author

@shepeliev last time I checked I thought the ios test didn't work at all - they just froze, in fact the runTest implementation was just a guess:

actual fun runTest(test: suspend () -> Unit) = runBlocking {
    val testRun = MainScope().async { test() }
    while (testRun.isActive) {
        NSRunLoop.mainRunLoop.runMode(
            NSDefaultRunLoopMode,
            beforeDate = NSDate.create(timeInterval = 1.0, sinceDate = NSDate())
        )
        yield()
    }
    testRun.await()
}

Are you saying this actually works now?

Looks like it was an accurate guess ) because it works for me. Actually, I'm a newbie in KMP and Android background, so I can't say if iOS runTest implementation is propper, but I use it in another my project and as I said it works well enough.

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.

3 participants