Skip to content

Commit 4b06b4d

Browse files
committed
test(ktor): Add Ktor 3.0 compatibility suite
Compile the production integration against the catalog Ktor version while compiling and running the existing tests against Ktor 3.0.0. Add the compatibility suite to check so inline API binary incompatibilities fail CI.
1 parent dbe9629 commit 4b06b4d

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎sentry-ktor-client/build.gradle.kts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@ dependencies {
4444
testImplementation(libs.okhttp.mockwebserver)
4545
}
4646

47+
testing {
48+
suites {
49+
register<JvmTestSuite>("testKtor300") {
50+
useJUnit()
51+
sources {
52+
java.setSrcDirs(listOf("src/test/java"))
53+
resources.setSrcDirs(listOf("src/test/resources"))
54+
}
55+
}
56+
}
57+
}
58+
59+
configurations.named("testKtor300Implementation") {
60+
extendsFrom(configurations.testImplementation.get())
61+
}
62+
63+
listOf("testKtor300CompileClasspath", "testKtor300RuntimeClasspath").forEach {
64+
configurations.named(it) {
65+
resolutionStrategy.eachDependency {
66+
if (requested.group == "io.ktor") {
67+
useVersion("3.0.0")
68+
}
69+
}
70+
}
71+
}
72+
73+
kotlin.target.compilations.named("testKtor300") {
74+
associateWith(kotlin.target.compilations.getByName("main"))
75+
}
76+
77+
tasks.check { dependsOn(testing.suites.named("testKtor300")) }
78+
4779
buildConfig {
4880
useJavaOutput()
4981
packageName("io.sentry.ktorClient")

0 commit comments

Comments
 (0)