Giorgio Vespucci
09/04/2023, 5:07 PMkotest-runner-junit5-jvm
5.7.1 and I realized I started experiencing A LOT of warnings on Warning: Kotest autoscan is enabled
.
But it also looks like it raises for every test - I can see a lot of them - and that it delays the build a lot. It's like the build is waiting seconds for every warning. 🧵Giorgio Vespucci
09/04/2023, 5:09 PMGiorgio Vespucci
09/04/2023, 5:09 PMChris Lee
09/04/2023, 5:21 PMkotest.properties
file:
kotest.framework.classpath.scanning.config.disable=true
kotest.framework.classpath.scanning.autoscan.disable=true
If you have extensions that need to be registered those can be done in a configuration class, referenced via:
kotest.framework.config.fqn=***.testing.KotestConfig
Giorgio Vespucci
09/05/2023, 6:45 AMkotest.properties
in the src/test/resources
folder.
But it seemed this stopped the discovery process at all; I mean, it found 0 tests.Giorgio Vespucci
09/05/2023, 6:47 AMGiorgio Vespucci
09/05/2023, 6:49 AM[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'kotest' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'kotest' failed to discover tests
Giorgio Vespucci
09/05/2023, 6:49 AMGiorgio Vespucci
09/05/2023, 7:33 AMGiorgio Vespucci
09/05/2023, 8:11 AMGiorgio Vespucci
09/05/2023, 8:14 AMmaven clean test
lasted less than 2:30m.
Starting from 5.7.0 - where the warning first appeared - it takes something like more than 10m.
Still I don't get why it's waiting so much time now that the warning appears. 😐Chris Lee
09/05/2023, 10:52 AMChris Lee
09/05/2023, 10:53 AMsam
09/05/2023, 2:32 PMGiorgio Vespucci
09/05/2023, 2:38 PMGiorgio Vespucci
09/05/2023, 2:42 PMsam
09/05/2023, 2:44 PMsam
09/05/2023, 2:44 PMsam
09/05/2023, 2:44 PMGiorgio Vespucci
09/05/2023, 2:45 PMChris Lee
09/05/2023, 2:45 PMGiorgio Vespucci
09/05/2023, 2:46 PMGiorgio Vespucci
09/05/2023, 2:49 PMtrue
as a default 🙂
https://github.com/kotest/kotest/blob/master/kotest-framework/kotest-framework-api/src/commonMain/kotlin/io/kotest/core/config/Defaults.kt#L14Chris Lee
09/05/2023, 2:50 PMGiorgio Vespucci
09/05/2023, 2:51 PMChris Lee
09/05/2023, 2:52 PMGiorgio Vespucci
09/05/2023, 2:52 PMGiorgio Vespucci
09/05/2023, 2:53 PMChris Lee
09/05/2023, 2:53 PMGiorgio Vespucci
09/05/2023, 2:54 PM<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jacoco.args}</argLine>
</configuration>
</plugin>
Chris Lee
09/05/2023, 2:55 PMforkCount
or similar?Giorgio Vespucci
09/05/2023, 2:56 PM<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<argLine>${surefire.jacoco.args}</argLine>
</configuration>
</execution>
</executions>
<configuration>
<argLine>${surefire.jacoco.args}</argLine>
</configuration>
</plugin>
Chris Lee
09/05/2023, 2:56 PMsurefire.jacoco.args
property?Giorgio Vespucci
09/05/2023, 2:59 PM[INFO] surefire.jacoco.args set to -javaagent:/Users/gvespucci/.m2/repository/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/Users/gvespucci/projects/<OBFUSCATED>/target/jacoco-output/jacoco-unit-tests.exec,excludes=<OBFUSCATED>/Application*.*:<OBFUSCATED>/infrastructure/**:<OBFUSCATED>/**/model/*
Giorgio Vespucci
09/05/2023, 3:00 PMChris Lee
09/05/2023, 3:00 PMGiorgio Vespucci
09/05/2023, 3:01 PMobject KotestProjectConfig : AbstractProjectConfig() {
override val parallelism = 10
override fun extensions() = listOf(SpringExtension)
OBFUSCATED
Giorgio Vespucci
09/05/2023, 3:01 PMChris Lee
09/05/2023, 3:04 PMkotest.framework.dump.config=true
#kotest.framework.classpath.scanning.config.disable=true
#kotest.framework.classpath.scanning.autoscan.disable=true
#kotest.framework.config.fqn=***.testing.KotestConfig
…grab the kotest config dump (this will be with autoscan). Note all the extensions added.
btw, that extension should likely be this:
override fun extensions(): List<Extension> {
return listOf(SpringAutowireConstructorExtension)
}
…unless you intend to apply SpringExtension
to all test specs (above matches what kotest auto-configures).Giorgio Vespucci
09/05/2023, 3:06 PMGiorgio Vespucci
09/05/2023, 3:09 PMChris Lee
09/05/2023, 3:09 PMGiorgio Vespucci
09/05/2023, 3:19 PM~~~ Kotest Configuration ~~~
-> Parallelization factor: 10
-> Concurrent specs: null
-> Global concurrent tests: 1
-> Dispatcher affinity: true
-> Coroutine debug probe: false
-> Spec execution order: Lexicographic
-> Default test execution order: Sequential
-> Default test timeout: nullms
-> Default test invocation timeout: nullms
-> Default isolation mode: SingleInstance
-> Global soft assertions: false
-> Write spec failure file: false
-> Fail on ignored tests: false
-> Fail on empty test suite: false
-> Duplicate test name mode: Warn
-> Remove test name whitespace: false
-> Append tags to test names: false
-> Extensions
- io.kotest.engine.extensions.SystemPropertyTagExtension
- io.kotest.extensions.spring.SpringAutowireConstructorExtension
- class io.kotest.engine.config.ApplyConfigFromAbstractProjectConfigKt$applyConfigFromProjectConfig$projectListener$1
- io.kotest.extensions.spring.SpringTestExtension
- io.kotest.runner.junit.platform.gradle.GradleClassMethodRegexTestFilter
-> Tags:
Giorgio Vespucci
09/05/2023, 3:19 PMparallelism
I think it's all default...Giorgio Vespucci
09/05/2023, 3:21 PM- io.kotest.runner.junit.platform.gradle.GradleClassMethodRegexTestFilter
sam
09/05/2023, 3:28 PMOliver.O
09/05/2023, 9:43 PMobject JvmTestConfiguration : CommonTestConfiguration() {
override val parallelism = Runtime.getRuntime().availableProcessors()
override var dispatcherAffinity: Boolean? = false
override val concurrentSpecs = Int.MAX_VALUE
override val concurrentTests = Int.MAX_VALUE
// ...
}
Giorgio Vespucci
09/06/2023, 7:21 AMkotest-runner-junit5-jvm
and Maven, then? 🤔Giorgio Vespucci
09/06/2023, 11:08 AMmaven-profiler
, just to give you an idea...Chris Lee
09/06/2023, 1:21 PMkotest-runner-junit5-jvm
. Start with a simple Maven project w/ kotest and a single test, see what happens.