Skip to content

Commit 034ce2a

Browse files
eclipse-apoapsis-botsschuberth
authored andcommitted
deps: update kotest to v6
Note that the module `kotest-framework-api` does not exist anymore, see [1], and the the module `kotest-framework-datatest` has been merged into `kotest-framework-engine`. But some functions of `kotest-framework-datatest` have been moved to `kotest-assertions-table`. Also `withEnvironment` was removed, see [2], so it is being copied over from Kotest 5.9.1. Finally, Kotest 6 removes class path scanning completely [3], so all related properties from `kotest.properties` can be removed. [1]: kotest/kotest#4562 [2]: kotest/kotest#5033 [3]: https://kotest.io/docs/release6/#removed-classpath-scanning
1 parent 353330a commit 034ce2a

File tree

49 files changed

+228
-93
lines changed

Some content is hidden

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

49 files changed

+228
-93
lines changed

.detekt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
comments:
2323
AbsentOrWrongFileLicense:
2424
active: true
25-
excludes: ['**/build/generated/**']
25+
excludes: ['**/build/generated/**', '**/utils/test/src/jvmMain/kotlin/SystemEnvironmentExtensions.kt']
2626
licenseTemplateFile: '.detekt.license.template'
2727
licenseTemplateIsRegex: true
2828

clients/keycloak/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies {
4343
testImplementation(libs.kotestExtensionsTestContainer)
4444
testImplementation(libs.kotestRunnerJunit5)
4545

46-
testFixturesApi(libs.kotestFrameworkApi)
46+
testFixturesApi(libs.kotestFrameworkEngine)
4747
testFixturesApi(libs.testContainersKeycloak)
4848

4949
testFixturesImplementation(libs.kotlinxSerializationJson)

clients/keycloak/src/testFixtures/kotlin/KeycloakTestExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import io.kotest.core.listeners.AfterSpecListener
2727
import io.kotest.core.listeners.BeforeEachListener
2828
import io.kotest.core.spec.Spec
2929
import io.kotest.core.test.TestCase
30-
import io.kotest.core.test.TestResult
30+
import io.kotest.engine.test.TestResult
3131

3232
import kotlinx.coroutines.Dispatchers
3333
import kotlinx.coroutines.withContext

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ dependencies {
140140
testImplementation(ktorLibs.utils)
141141
testImplementation(libs.kotestAssertionsCore)
142142
testImplementation(libs.kotestAssertionsKtor)
143+
testImplementation(libs.kotestAssertionsTable)
143144
testImplementation(libs.kotestRunnerJunit5)
144145
testImplementation(libs.mockk)
145146
testImplementation(ortLibs.utils.common)

core/src/test/kotlin/api/RunsRouteIntegrationTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package org.eclipse.apoapsis.ortserver.core.api
2121

2222
import com.typesafe.config.ConfigFactory
2323

24-
import io.kotest.assertions.fail
24+
import io.kotest.assertions.AssertionErrorBuilder
2525
import io.kotest.assertions.ktor.client.haveHeader
2626
import io.kotest.assertions.ktor.client.shouldHaveStatus
2727
import io.kotest.engine.spec.tempdir
@@ -252,7 +252,7 @@ class RunsRouteIntegrationTest : AbstractIntegrationTest({
252252
*/
253253
suspend fun checkLogFileResponse(response: HttpResponse): ByteReadChannel {
254254
if (!response.status.isSuccess()) {
255-
fail("Request failed: ${response.status} - ${response.body<ErrorResponse>()}")
255+
AssertionErrorBuilder.fail("Request failed: ${response.status} - ${response.body<ErrorResponse>()}")
256256
}
257257

258258
return response.bodyAsChannel()
@@ -2305,7 +2305,7 @@ private fun checkLogArchive(archiveFile: File, sources: Set<LogSource>) {
23052305
}
23062306
} catch (e: IOException) {
23072307
val content = archiveFile.readText()
2308-
fail("Could not unpack log archive: ${e.message}.\nFile content is:\n$content")
2308+
AssertionErrorBuilder.fail("Could not unpack log archive: ${e.message}.\nFile content is:\n$content")
23092309
}
23102310
}
23112311

dao/src/testFixtures/kotlin/DatabaseMigrationTestExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.eclipse.apoapsis.ortserver.dao.test
2121

22-
import io.kotest.common.runBlocking
2322
import io.kotest.core.test.TestCase
23+
import io.kotest.engine.runBlocking
2424

2525
import org.eclipse.apoapsis.ortserver.dao.connect
2626

dao/src/testFixtures/kotlin/DatabaseTestExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import io.kotest.core.listeners.BeforeEachListener
2626
import io.kotest.core.listeners.BeforeSpecListener
2727
import io.kotest.core.spec.Spec
2828
import io.kotest.core.test.TestCase
29-
import io.kotest.core.test.TestResult
29+
import io.kotest.engine.test.TestResult
3030
import io.kotest.extensions.testcontainers.JdbcDatabaseContainerExtension
3131
import io.kotest.extensions.testcontainers.toDataSource
3232

gradle/libs.versions.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ kaml = "0.93.0"
5353
keycloakTestcontainerVersion = "3.8.0"
5454
koin = "4.1.0"
5555
konform = "0.11.1"
56-
kotest = "5.9.1"
56+
kotest = "6.0.1"
5757
kotestAssertionsKotlinxDatetime = "1.1.0"
5858
kotestAssertionsKtor = "2.0.0"
5959
kotestExtensionTestContainers = "2.0.2"
@@ -117,8 +117,10 @@ konform = { module = "io.konform:konform", version.ref = "konform" }
117117
kotestAssertionsCore = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
118118
kotestAssertionsKotlinxDatetime = { module = "io.kotest.extensions:kotest-assertions-kotlinx-datetime", version.ref = "kotestAssertionsKotlinxDatetime" }
119119
kotestAssertionsKtor = { module = "io.kotest.extensions:kotest-assertions-ktor", version.ref = "kotestAssertionsKtor" }
120+
kotestAssertionsTable = { module = "io.kotest:kotest-assertions-table", version.ref = "kotest" }
121+
kotestExtensions = { module = "io.kotest:kotest-extensions", version.ref = "kotest" }
120122
kotestExtensionsTestContainer = { module = "io.kotest.extensions:kotest-extensions-testcontainers", version.ref = "kotestExtensionTestContainers" }
121-
kotestFrameworkApi = { module = "io.kotest:kotest-framework-api", version.ref = "kotest" }
123+
kotestFrameworkEngine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
122124
kotestRunnerJunit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
123125
kotlinResult = { module = "com.michael-bull.kotlin-result:kotlin-result", version.ref = "kotlinResult" }
124126
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }

logaccess/loki/src/test/kotlin/LokiLogFileProviderTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import com.github.tomakehurst.wiremock.core.WireMockConfiguration
3131

3232
import com.typesafe.config.ConfigFactory
3333

34-
import io.kotest.assertions.fail
34+
import io.kotest.assertions.AssertionErrorBuilder
3535
import io.kotest.assertions.throwables.shouldThrow
3636
import io.kotest.core.spec.Spec
3737
import io.kotest.core.spec.style.StringSpec
@@ -368,7 +368,7 @@ private fun WireMockServer.stubLogRequest(
368368
*/
369369
private fun readResponseTemplate(name: String = DEFAULT_RESPONSE_TEMPLATE): String =
370370
LokiLogFileProviderTest::class.java.getResource("/$name")?.readText()
371-
?: fail("Could not load response template '$name'.")
371+
?: AssertionErrorBuilder.fail("Could not load response template '$name'.")
372372

373373
/**
374374
* Generate a log line for the given [timestamp].

orchestrator/src/test/kotlin/OrchestratorEndpointTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ package org.eclipse.apoapsis.ortserver.orchestrator
2121

2222
import io.kotest.core.spec.style.StringSpec
2323
import io.kotest.core.test.TestCase
24-
import io.kotest.core.test.TestResult
25-
import io.kotest.extensions.system.withEnvironment
24+
import io.kotest.engine.test.TestResult
2625

2726
import io.mockk.every
2827
import io.mockk.just
@@ -58,6 +57,7 @@ import org.eclipse.apoapsis.ortserver.transport.MessageHeader
5857
import org.eclipse.apoapsis.ortserver.transport.OrchestratorEndpoint
5958
import org.eclipse.apoapsis.ortserver.transport.testing.MessageReceiverFactoryForTesting
6059
import org.eclipse.apoapsis.ortserver.transport.testing.TEST_TRANSPORT_NAME
60+
import org.eclipse.apoapsis.ortserver.utils.test.withEnvironment
6161

6262
import org.jetbrains.exposed.sql.Database
6363

0 commit comments

Comments
 (0)