From 4b06b4dd51276cdf34c6873e1f4d85df59c5269f Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 9 Nov 2026 14:45:24 +0100 Subject: [PATCH] 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. --- sentry-ktor-client/build.gradle.kts | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sentry-ktor-client/build.gradle.kts b/sentry-ktor-client/build.gradle.kts index a28c11eab8d..37759634036 100644 --- a/sentry-ktor-client/build.gradle.kts +++ b/sentry-ktor-client/build.gradle.kts @@ -44,6 +44,38 @@ dependencies { testImplementation(libs.okhttp.mockwebserver) } +testing { + suites { + register("testKtor300") { + useJUnit() + sources { + java.setSrcDirs(listOf("src/test/java")) + resources.setSrcDirs(listOf("src/test/resources")) + } + } + } +} + +configurations.named("testKtor300Implementation") { + extendsFrom(configurations.testImplementation.get()) +} + +listOf("testKtor300CompileClasspath", "testKtor300RuntimeClasspath").forEach { + configurations.named(it) { + resolutionStrategy.eachDependency { + if (requested.group == "io.ktor") { + useVersion("3.0.0") + } + } + } +} + +kotlin.target.compilations.named("testKtor300") { + associateWith(kotlin.target.compilations.getByName("main")) +} + +tasks.check { dependsOn(testing.suites.named("testKtor300")) } + buildConfig { useJavaOutput() packageName("io.sentry.ktorClient")