Skip to content

Commit 5dd6145

Browse files
committed
Fix for ios tests
1 parent f3f693a commit 5dd6145

File tree

15 files changed

+109
-42
lines changed

15 files changed

+109
-42
lines changed

firebase-app/src/commonTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ class FirebaseAppTest {
1212
fun testInitialize() = runTest {
1313
Firebase.initialize(
1414
context,
15-
firebaseOptions
15+
FirebaseOptions(
16+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
17+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
18+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
19+
storageBucket = "fir-kotlin-sdk.appspot.com",
20+
projectId = "fir-kotlin-sdk",
21+
gcmSenderId = "846484016111"
22+
)
1623
)
1724

1825
assertEquals(1, Firebase.apps(context).size)

firebase-auth/src/commonTest/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ class FirebaseAuthTest {
2121
fun initializeFirebase() {
2222
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
2323
context,
24-
firebaseOptions
24+
FirebaseOptions(
25+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
26+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
27+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
28+
storageBucket = "fir-kotlin-sdk.appspot.com",
29+
projectId = "fir-kotlin-sdk",
30+
gcmSenderId = "846484016111"
31+
)
2532
)
2633

2734
auth = Firebase.auth(app).apply {

firebase-config/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ kotlin {
121121
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
122122
if (name.lowercase().contains("ios")) {
123123
optIn("kotlinx.cinterop.ExperimentalForeignApi")
124+
optIn("kotlinx.cinterop.BetaInteropApi")
124125
}
125126
}
126127
}

firebase-config/src/commonTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ package dev.gitlive.firebase.remoteconfig
77
import dev.gitlive.firebase.Firebase
88
import dev.gitlive.firebase.FirebaseOptions
99
import dev.gitlive.firebase.apps
10-
import dev.gitlive.firebase.firebaseOptions
1110
import dev.gitlive.firebase.initialize
1211
import dev.gitlive.firebase.runTest
13-
import kotlinx.coroutines.test.TestResult
1412
import kotlin.test.AfterTest
1513
import kotlin.test.BeforeTest
1614
import kotlin.test.Ignore
@@ -35,7 +33,14 @@ class FirebaseRemoteConfigTest {
3533
fun initializeFirebase() {
3634
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
3735
context,
38-
firebaseOptions
36+
FirebaseOptions(
37+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
38+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
39+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
40+
storageBucket = "fir-kotlin-sdk.appspot.com",
41+
projectId = "fir-kotlin-sdk",
42+
gcmSenderId = "846484016111"
43+
)
3944
)
4045

4146
remoteConfig = Firebase.remoteConfig(app)

firebase-crashlytics/src/commonTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ package dev.gitlive.firebase.crashlytics
77
import dev.gitlive.firebase.Firebase
88
import dev.gitlive.firebase.FirebaseOptions
99
import dev.gitlive.firebase.apps
10-
import dev.gitlive.firebase.firebaseOptions
1110
import dev.gitlive.firebase.initialize
1211
import dev.gitlive.firebase.runBlockingTest
1312
import dev.gitlive.firebase.runTest
14-
import kotlinx.coroutines.CoroutineScope
15-
import kotlinx.coroutines.test.TestResult
1613
import kotlin.test.AfterTest
1714
import kotlin.test.BeforeTest
1815
import kotlin.test.Test
@@ -31,7 +28,14 @@ class FirebaseCrashlyticsTest {
3128
fun initializeFirebase() {
3229
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
3330
context,
34-
firebaseOptions
31+
FirebaseOptions(
32+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
33+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
34+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
35+
storageBucket = "fir-kotlin-sdk.appspot.com",
36+
projectId = "fir-kotlin-sdk",
37+
gcmSenderId = "846484016111"
38+
)
3539
)
3640

3741
crashlytics = Firebase.crashlytics(app)

firebase-database/src/commonTest/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ class FirebaseDatabaseTest {
2828
fun initializeFirebase() {
2929
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
3030
context,
31-
firebaseOptions
31+
FirebaseOptions(
32+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
33+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
34+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
35+
storageBucket = "fir-kotlin-sdk.appspot.com",
36+
projectId = "fir-kotlin-sdk",
37+
gcmSenderId = "846484016111"
38+
)
3239
)
3340

3441
database = Firebase.database(app).apply {

firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package dev.gitlive.firebase.firestore
77
import dev.gitlive.firebase.Firebase
88
import dev.gitlive.firebase.FirebaseOptions
99
import dev.gitlive.firebase.apps
10-
import dev.gitlive.firebase.firebaseOptions
1110
import dev.gitlive.firebase.initialize
1211
import dev.gitlive.firebase.runBlockingTest
1312
import dev.gitlive.firebase.runTest
@@ -58,7 +57,14 @@ class FirebaseFirestoreTest {
5857
fun initializeFirebase() {
5958
val app = Firebase.apps(context).firstOrNull() ?:Firebase.initialize(
6059
context,
61-
firebaseOptions
60+
FirebaseOptions(
61+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
62+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
63+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
64+
storageBucket = "fir-kotlin-sdk.appspot.com",
65+
projectId = "fir-kotlin-sdk",
66+
gcmSenderId = "846484016111"
67+
)
6268
)
6369

6470
firestore = Firebase.firestore(app).apply {

firebase-perf/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package dev.gitlive.firebase.perf.metrics
33
import dev.gitlive.firebase.Firebase
44
import dev.gitlive.firebase.FirebaseOptions
55
import dev.gitlive.firebase.apps
6-
import dev.gitlive.firebase.firebaseOptions
76
import dev.gitlive.firebase.initialize
87
import dev.gitlive.firebase.perf.FirebasePerformance
98
import dev.gitlive.firebase.perf.context
@@ -15,7 +14,6 @@ import kotlin.test.AfterTest
1514
import kotlin.test.BeforeTest
1615
import kotlin.test.Test
1716
import kotlin.test.assertEquals
18-
import kotlin.time.Duration.Companion.milliseconds
1917
import kotlin.time.Duration.Companion.seconds
2018

2119
class AndroidTraceTest {
@@ -26,7 +24,14 @@ class AndroidTraceTest {
2624
fun initializeFirebase() {
2725
val app = Firebase.apps(context).firstOrNull() ?:Firebase.initialize(
2826
dev.gitlive.firebase.perf.context,
29-
firebaseOptions
27+
FirebaseOptions(
28+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
29+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
30+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
31+
storageBucket = "fir-kotlin-sdk.appspot.com",
32+
projectId = "fir-kotlin-sdk",
33+
gcmSenderId = "846484016111"
34+
)
3035
)
3136

3237
performance = Firebase.performance(app)

firebase-perf/src/commonTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package dev.gitlive.firebase.perf.metrics
22

33
import dev.gitlive.firebase.Firebase
4+
import dev.gitlive.firebase.FirebaseOptions
45
import dev.gitlive.firebase.apps
5-
import dev.gitlive.firebase.firebaseOptions
66
import dev.gitlive.firebase.initialize
77
import dev.gitlive.firebase.perf.FirebasePerformance
88
import dev.gitlive.firebase.perf.IgnoreForAndroidUnitTest
@@ -25,9 +25,17 @@ class TraceTest {
2525
@BeforeTest
2626
fun initializeFirebase() {
2727
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
28-
dev.gitlive.firebase.perf.context,
29-
firebaseOptions
30-
)
28+
dev.gitlive.firebase.perf.context,
29+
FirebaseOptions(
30+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
31+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
32+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
33+
storageBucket = "fir-kotlin-sdk.appspot.com",
34+
projectId = "fir-kotlin-sdk",
35+
gcmSenderId = "846484016111"
36+
)
37+
)
38+
3139
performance = Firebase.performance(app)
3240
}
3341

firebase-perf/src/commonTest/kotlin/dev/gitlive/firebase/perf/performance.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ package dev.gitlive.firebase.perf
77
import dev.gitlive.firebase.Firebase
88
import dev.gitlive.firebase.FirebaseOptions
99
import dev.gitlive.firebase.apps
10-
import dev.gitlive.firebase.firebaseOptions
1110
import dev.gitlive.firebase.initialize
1211
import dev.gitlive.firebase.runBlockingTest
1312
import dev.gitlive.firebase.runTest
14-
import kotlinx.coroutines.CoroutineScope
15-
import kotlinx.coroutines.test.TestResult
1613
import kotlin.test.*
1714

1815
expect val emulatorHost: String
@@ -27,9 +24,17 @@ class FirebasePerformanceTest {
2724
@BeforeTest
2825
fun initializeFirebase() {
2926
val app = Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
30-
context,
31-
firebaseOptions
32-
)
27+
context,
28+
FirebaseOptions(
29+
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
30+
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
31+
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
32+
storageBucket = "fir-kotlin-sdk.appspot.com",
33+
projectId = "fir-kotlin-sdk",
34+
gcmSenderId = "846484016111"
35+
)
36+
)
37+
3338
performance = Firebase.performance(app)
3439
}
3540

0 commit comments

Comments
 (0)