Skip to content

Commit a3c11be

Browse files
authored
Move our internal testing stuff to an unpublished module (#6449)
* move our internal stuff to a repo that is not published * update apiDump * typo * remove workaround * remove uneeded dependency
1 parent 317e520 commit a3c11be

File tree

74 files changed

+171
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+171
-473
lines changed

benchmark/microbenchmark/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies {
4242
androidTestImplementation(libs.benchmark.junit4)
4343
androidTestImplementation(libs.androidx.test.core)
4444
androidTestImplementation(libs.apollo.mockserver)
45-
androidTestImplementation(libs.apollo.testingsupport)
45+
androidTestImplementation(libs.apollo.testingsupport.internal)
4646
}
4747

4848
java {

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ configure<kotlinx.validation.ApiValidationExtension> {
139139
)
140140

141141
ignoredProjects.add("intellij-plugin")
142+
ignoredProjects.add("apollo-testing-support-internal")
142143
}
143144

144145
tasks.register("rmbuild") {

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ org.jetbrains.dokka.gradle.enableLogHtmlPublicationLink=false
2929
ksp.useKSP2=true
3030
org.jetbrains.dokka.experimental.tryK2=true
3131
org.jetbrains.dokka.experimental.tryK2.nowarn=true
32+
# https://youtrack.jetbrains.com/issue/KT-75605/Dependency-resolution-fails-in-commonTest-nativeTest-source-sets-for-KMP-module-when-depending-on-another-project-due-to-missing#focus=Comments-27-11699378.0-0
33+
kotlin.kmp.isolated-projects.support=auto

gradle/libraries.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ apollo-runtime-published = { group = "com.apollographql.apollo", name = "apollo-
8282
apollo-annotations = { group = "com.apollographql.apollo", name = "apollo-annotations", version.ref = "apollo" }
8383
apollo-engine-ktor = { group = "com.apollographql.apollo", name = "apollo-engine-ktor", version.ref = "apollo" }
8484
apollo-testingsupport = { group = "com.apollographql.apollo", name = "apollo-testing-support", version.ref = "apollo" }
85+
apollo-testingsupport-internal = { group = "com.apollographql.apollo", name = "apollo-testing-support-internal", version.ref = "apollo" }
8586
apollo-tooling = { group = "com.apollographql.apollo", name = "apollo-tooling", version.ref = "apollo" }
8687
assertj = { group = "org.assertj", name = "assertj-core", version = "3.24.2" }
8788
atomicfu-library = { group = "org.jetbrains.kotlinx", name = "atomicfu", version.ref = "atomicfu" }

libraries/apollo-engine-tests/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ kotlin {
1818
}
1919
findByName("commonTest")?.apply {
2020
dependencies {
21-
implementation(project(":apollo-testing-support"))
21+
implementation(project(":apollo-testing-support-internal"))
2222
}
2323
}
2424
findByName("jvmTest")?.apply {

libraries/apollo-engine-tests/src/commonTest/kotlin/AllTests.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ import com.apollographql.apollo.engine.tests.platform
33
import com.apollographql.apollo.engine.tests.runAllTests
44
import com.apollographql.apollo.network.http.DefaultHttpEngine
55
import com.apollographql.apollo.network.ws.DefaultWebSocketEngine
6-
import com.apollographql.apollo.testing.internal.runTest
6+
import kotlinx.coroutines.Dispatchers
7+
import kotlinx.coroutines.test.runTest
8+
import kotlinx.coroutines.withContext
79
import kotlin.test.Test
810

911
class AllTests {
1012

1113
@Test
1214
fun runAllTest() = runTest {
13-
runAllTests(
14-
engine = { DefaultHttpEngine(it) },
15-
webSocketEngine = { DefaultWebSocketEngine() },
16-
platform() != Platform.Native
17-
)
15+
withContext(Dispatchers.Default.limitedParallelism(1)) {
16+
runAllTests(
17+
engine = { DefaultHttpEngine(it) },
18+
webSocketEngine = { DefaultWebSocketEngine() },
19+
platform() != Platform.Native
20+
)
21+
}
1822
}
1923
}

libraries/apollo-normalized-cache-sqlite/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ kotlin {
6666

6767
findByName("commonTest")?.apply {
6868
dependencies {
69-
implementation(project(":apollo-testing-support"))
69+
implementation(project(":apollo-testing-support-internal"))
7070
}
7171
}
7272
}

libraries/apollo-runtime/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ kotlin {
2727
fun KotlinDependencyHandler.commonTestDependencies() {
2828
implementation(libs.apollo.mockserver)
2929
implementation(libs.turbine)
30-
implementation(project(":apollo-testing-support")) {
30+
implementation(project(":apollo-testing-support-internal")) {
3131
because("runTest")
3232
// We have a circular dependency here that creates a warning in JS
3333
// w: duplicate library name: com.apollographql.apollo:apollo-mockserver

libraries/apollo-runtime/src/appleTest/kotlin/com/apollographql/apollo/network/http/DefaultHttpEngineTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.apollographql.apollo.network.http
22

33
import com.apollographql.apollo.api.http.HttpMethod
44
import com.apollographql.apollo.api.http.HttpRequest
5+
import com.apollographql.apollo.testing.internal.runTest
56
import com.apollographql.mockserver.MockServer
67
import com.apollographql.mockserver.enqueueString
7-
import com.apollographql.apollo.testing.internal.runTest
88
import platform.Foundation.NSURLSessionConfiguration
99
import kotlin.test.Test
1010
import kotlin.test.assertEquals

libraries/apollo-runtime/src/commonTest/kotlin/test/network/NetworkMonitorTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ import com.apollographql.mockserver.assertNoRequest
1414
import com.apollographql.mockserver.enqueueString
1515
import com.apollographql.apollo.network.NetworkMonitor
1616
import com.apollographql.apollo.network.waitForNetwork
17-
import test.FooQuery
1817
import com.apollographql.apollo.testing.internal.runTest
18+
import test.FooQuery
1919
import kotlinx.coroutines.CoroutineScope
2020
import kotlinx.coroutines.flow.Flow
2121
import kotlinx.coroutines.flow.MutableStateFlow
2222
import kotlinx.coroutines.flow.StateFlow
2323
import kotlinx.coroutines.flow.asStateFlow
24-
import kotlinx.coroutines.flow.collect
2524
import kotlinx.coroutines.flow.emitAll
26-
import kotlinx.coroutines.flow.first
2725
import kotlinx.coroutines.flow.flow
28-
import kotlinx.coroutines.flow.mapNotNull
29-
import kotlinx.coroutines.flow.takeWhile
3026
import kotlinx.coroutines.test.TestResult
3127
import okio.use
3228
import kotlin.test.Test
@@ -115,7 +111,7 @@ class MockServerTest(val mockServer: MockServer, val apolloClient: ApolloClient,
115111
fun mockServerTest(
116112
clientBuilder: ApolloClient.Builder.() -> Unit = {},
117113
block: suspend MockServerTest.() -> Unit
118-
) = runTest() {
114+
) = runTest {
119115
MockServer().use { mockServer ->
120116
ApolloClient.Builder()
121117
.serverUrl(mockServer.url())

0 commit comments

Comments
 (0)