Marek Kubiczek
02/05/2023, 4:13 PMEngine exception: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
when running kotest tests from Android Studio with the help of kotest idea plugin. The same running from command line using gradle works just fine.sam
02/05/2023, 7:03 PMCLOVIS
02/05/2023, 9:00 PM$ ./gradlew jvmTest jsBrowserTest
> Task :jvmTest
io.kotest.examples.mpp.UUIDJvmTest[jvm] > uuids should be in be type 4 format[jvm] PASSED
io.kotest.examples.mpp.data.DataDrivenTest[jvm] > PythagTriple(a=3, b=4, c=5)[jvm] PASSED
io.kotest.examples.mpp.data.DataDrivenTest[jvm] > PythagTriple(a=6, b=8, c=10)[jvm] PASSED
io.kotest.examples.mpp.uuid.UUIDTestCommon[jvm] > uuids should be somewhat unique![jvm] PASSED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Marcin Wisniowski
02/06/2023, 4:44 PMLidonis Calhau
02/07/2023, 4:14 PMBrent Beardsley
02/08/2023, 6:09 PM[4.128s][warning][gc,alloc] ClassGraph-worker-16: Retried waiting for GCLocker too often allocating 1026 words
UnknownClass.Kotest > UnknownClass.initializationError FAILED
org.junit.platform.commons.JUnitException at EngineExecutionOrchestrator.java:113
Caused by: io.kotest.engine.config.ConfigurationException at ConfigManager.kt:29
Caused by: io.github.classgraph.ClassGraphException at ClassGraph.java:1606
Caused by: java.lang.OutOfMemoryError at NestedJarHandler.java:654
UnknownClass.Kotest FAILED
If I keep re-running it eventually works. Is there a kotest leak? Or am I missing some kotest setting or is there something else I should be modifying? thxjulian
02/08/2023, 9:09 PMFailed to execute all tests:
:kotest-assertions:kotest-assertions-json:iosX64Test: java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148):kotest-assertions:kotest-assertions-json:watchosX64Test: java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148)
Piotr Krzemiński
02/09/2023, 12:21 PMDaniel Schröder
02/09/2023, 2:54 PMFAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':common-core:compileTestKotlinIosX64'.
> Could not resolve all files for configuration ':common-core:iosX64TestCompileKlibraries'.
> Could not find kotest-common.klib (io.kotest:kotest-common-iosx64:5.5.5).
Searched in the following locations:
<https://repo.maven.apache.org/maven2/io/kotest/kotest-common-iosx64/5.5.5/kotest-common-iosx64-5.5.5.klib>
julian
02/12/2023, 7:29 PMJacob K
02/15/2023, 10:11 AMJacob K
02/15/2023, 10:11 AMabendt
02/16/2023, 5:34 PMIoannis Mavroukakis
02/17/2023, 12:45 PMDavide Giuseppe Farella
02/18/2023, 7:15 AMprivate val appScope = TestScope()
private val sut = Sut(appScope)
@Test
fun `some test`() = appScope.runTest { ... }
Now, with Kotest, I did this:
class MyTest : BehaviorSpec({
Given("abc") {
val sut = Sut(testScope)
It worked, till I needed to call advanceUntilIdle()
(after this code) so, to achieve that, I had to add coroutineTestScope = true
and it became
class MyTest : BehaviorSpec({
coroutineTestScope = true
Given("abc") {
val sut = Sut(testScope)
But this doesn’t seem to work correctly, as the Flow internal to my SUT never emits.
I’ll drop my SUT in the 🧵julian
02/18/2023, 6:33 PM5.6.0
might be released?James Eschner
02/21/2023, 3:21 AMdata class Foo(val x: Boolean)
val fooArb: Arb<Foo> = arbitrary {
Foo(x = false)
}
val stuck = fooArb.filter { it.x }.next()
Now, obviously this won't work. This is a simple example but in my case, the arb is much more complex (and transient) so the situation wasn't immediately obviously. What I would have hoped would happen is that the program would eventually time out or throw trying to generate the "next" arb, but what I am witnessing is the kotest test hangs seemingly indefinitely, making it very hard to debug.
What I am wonder is if there is a way to better detect this situation? Can I set a timeout? Force an error? Etc...
** Not a contributionhuehnerlady
02/22/2023, 11:34 AMfun config(
enabled: Boolean? = null,
enabledIf: EnabledIf? = null,
enabledOrReasonIf: EnabledOrReasonIf? = null,
tags: Set<Tag>? = null,
timeout: Duration? = null,
failfast: Boolean? = null,
blockingTest: Boolean? = null,
coroutineTestScope: Boolean? = null,
test: suspend T.() -> Unit
)
When I try to do that at the root level overriding the defaultTestCaseConfig
function as described here, I see that this method is now deprecated, but I do not understand how else to do that.
Maybe someone can help me?Davide Giuseppe Farella
02/22/2023, 3:50 PMMockAppExtension
(previously MockAppRule
) that sets up Koin with Ktor’s `MockEngine`s and in-memory SqlDelight database.
I have 3 test classes with 17 tests in total. If I run a single class, all of them pass with no problem, but if I run tests for the whole module, 2 out of 17 fail with io.ktor.serialization.JsonConvertException: Illegal input
on a network request
I wonder what could make the difference 🤔 I tried with different `IsolationMode`sxenomachina
02/25/2023, 5:21 AMWe can configure this feature by setting the configuration fieldWhere is “the configuration field concurrencyMode”? Even searching the codebase, the only place I can find “concurrencyMode” is in the docs.or the system propertyconcurrencyMode
.kotest.framework.concurrency.mode
Davio
02/27/2023, 12:56 PMpackage com.example.demo
import io.kotest.core.spec.style.ShouldSpec
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.fail
@Tag("IntegrationTests")
class IntegrationIT : ShouldSpec({
should("fail") {
fail { "fail" }
}
})
This test will always be run by failsafe, even if I specify the groups/tags to run to be something elseAlexandre Brown
02/27/2023, 3:44 PMStringSpec
a bit like we an use InnerClass with JUnit5?
What I have :
"myMethod does ABC when 123" {
}
"myMethod does XYZ when 666" {
}
What I want :
"myMethod" {
"does ABC when 123" {
}
"does XYZ when 666" {
}
}
Franklin
02/27/2023, 9:16 PMRerun Failed Tests
button which is also useful, but I'm not sure how the failed test names are fed in so I can filter the tests being run.
Thanks.
Edit: I just realized I've been using a for loop over my input and just calling test
multiple times. I tried withData
and it's the same.xenomachina
02/28/2023, 8:01 PMInstancePerTest
or InstancePerLeaf
, does autoClose(x)
close x when the spec class is finished (ie: all of the tests in the spec have completed) or when the specific spec instance is finished?abendt
03/02/2023, 9:00 AMMoritz Post
03/03/2023, 8:36 AMengine
. I don't want to change the isolation mode as i would like to do some other data loading once upfront (to feed the engine).
class EngineTest : ShouldSpec({
val engineInput = loadExpensiveInput()
// does not work and lateinit is not available
var engine: Engine
beforeEach {
engine = Engine(engineInput)
}
should("be ready") {
engine.ready shouldBe true
}
}
Moritz Post
03/03/2023, 8:41 AMval engine by beforeEach { Engine(engineInput) }
Michael Vandendriessche
03/03/2023, 10:41 AMKirill Zhukov
03/03/2023, 9:57 PMjvmTest
runs commonTest
targeting JVM and runs tests
• iosSimulatorArm64Test
doesn’t seem to compile/run commonTest
targets iOS target 🤔
I have framework-engine
dependency added to commonTest
, anything I might be missing?Kirill Zhukov
03/04/2023, 1:55 AMKirill Zhukov
03/04/2023, 1:55 AM