diff --git a/cffu-core/src/test/java/io/foldright/test_utils/TestThreadPoolManager.kt b/cffu-core/src/test/java/io/foldright/test_utils/TestThreadPoolManager.kt index af3eb632..a2d0a5b2 100644 --- a/cffu-core/src/test/java/io/foldright/test_utils/TestThreadPoolManager.kt +++ b/cffu-core/src/test/java/io/foldright/test_utils/TestThreadPoolManager.kt @@ -3,7 +3,7 @@ package io.foldright.test_utils import io.foldright.cffu.CffuFactory -import io.kotest.core.annotation.AutoScan +import io.kotest.core.config.AbstractProjectConfig import io.kotest.core.listeners.AfterProjectListener import io.kotest.core.listeners.BeforeProjectListener import io.kotest.matchers.booleans.shouldBeFalse @@ -98,14 +98,9 @@ val testForkJoinPoolExecutor: ExecutorService = createThreadPool("CompletableFutureUseTest_ForkJoinPool", true) /** - * Introduction to Extensions of kotest - * https://kotest.io/docs/framework/extensions/extensions-introduction.html - * - * To run an extension for every spec in the entire project: - * mark the listener with @AutoScan + * https://kotest.io/docs/framework/project-config.html */ -@AutoScan -object InitTestThreadPoolsProjectListener : BeforeProjectListener, AfterProjectListener { +object CffuKotestProjectConfig : AbstractProjectConfig(), BeforeProjectListener, AfterProjectListener { override suspend fun beforeProject() { println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") println("Env Infos:") @@ -113,7 +108,7 @@ object InitTestThreadPoolsProjectListener : BeforeProjectListener, AfterProjectL println("Available Processors of Runtime: ${Runtime.getRuntime().availableProcessors()}") println("Java Home: ${System.getProperty("java.home")}") println("Java Version: ${System.getProperty("java.version")}") - println("CI env var: ${System.getenv("CI")} (${isCiEnv()})") + println("CI env var: ${System.getenv("CI")} (is ci env: ${isCiEnv()})") println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") warmupExecutorService(testThreadPoolExecutor, testForkJoinPoolExecutor) diff --git a/cffu-core/src/test/resources/kotest.properties b/cffu-core/src/test/resources/kotest.properties index 296c06a9..fcf0167b 100644 --- a/cffu-core/src/test/resources/kotest.properties +++ b/cffu-core/src/test/resources/kotest.properties @@ -1,4 +1,6 @@ # https://kotest.io/docs/intellij/intellij-properties.html kotest.framework.classpath.scanning.config.disable=true kotest.framework.classpath.scanning.autoscan.disable=true +# https://kotest.io/docs/framework/project-config.html#runtime-detection +kotest.framework.config.fqn=io.foldright.test_utils.CffuKotestProjectConfig