From ca18a497effe3614e3b45c751a086d1d408c0959 Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Tue, 26 Sep 2023 15:00:52 +0200 Subject: [PATCH] Remove assemble to speed up CI for js tests & make runTest > 10sec --- .github/workflows/pull_request.yml | 2 -- .../jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ea674aa90..0750bbd71 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -39,8 +39,6 @@ jobs: run: npm install -g firebase-tools - name: Start Firebase emulator run: "firebase emulators:start --config=./test/firebase.json &" - - name: Assemble - run: ./gradlew assemble - name: Run JS Tests run: ./gradlew cleanTest jsTest - name: Upload JS test artifact diff --git a/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt index a80fee0ff..3c75398d3 100644 --- a/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -6,12 +6,13 @@ package dev.gitlive.firebase.firestore import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.test.runTest +import kotlin.time.Duration.Companion.minutes actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = runTest { test() } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) = runTest(timeout = 5.minutes) { test() } @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) actual annotation class IgnoreForAndroidUnitTest