From a4fa06ae6fa5832bec3d8b0b7bf54e1b6e7078be Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Tue, 26 Sep 2023 15:39:23 +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 08c18e8e0..39b29643f 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 3443f0171..91fb960f4 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 @@ -7,12 +7,13 @@ package dev.gitlive.firebase.firestore import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.test.runTest import kotlin.js.json +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() } actual fun encodedAsMap(encoded: Any?): Map { return (js("Object").entries(encoded) as Array>).associate {