sam
03/11/2024, 6:00 AMdave08
03/11/2024, 4:08 PMforAll
allows using suspend funs in it's lambda? It seems like not though... even though forAll itself is a suspend fun...CLOVIS
03/11/2024, 6:20 PM./gradlew jsBrowserRun --info --rerun
, and looking into the generated test report, but it's completely empty. Is that expected?
I'm seeing the same problem in one of my projects, where I cannot see any JS tests being executed, so I wanted to compare with one of the samples to see if it's on my side—but I don't see any tests being executed from the sample either.Adam S
03/12/2024, 7:34 PMgradle :kotest-tests:kotest-tests-js:jsTest
, and see screenshot).
How can I test if my changes have affected Wasm? When I run gradle wasmJsTest
it doesn't trigger anything...Ray Rahke
03/13/2024, 6:13 AM───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ repositories {
2 │ mavenCentral()
3 │ }
4 │ plugins {
5 │ kotlin("jvm") version "1.9.23"
6 │ }
7 │ dependencies {
8 │ testImplementation(kotlin("test"))
9 │ testImplementation 'io.kotest:kotest-runner-junit5:5.8'
10 │ }
11 │ sourceSets {
12 │ test {
13 │ kotlin.srcDirs("test")
14 │ }
15 │ }
16 │
17 │ tasks.withType<Test>().configureEach {
18 │ useJUnitPlatform()
19 │ }
Ray Rahke
03/13/2024, 6:13 AMmickeelm
03/13/2024, 9:36 AMExtension
and Listener
. Listener
is deprecated in favor of Extension
, but the documentation for Extension
promotes Listener
.
I also don't follow the @SoftDeprecated("Use beforeAny")
on the BeforeTestListener
. I mean, I follow/understand the same annotation on beforeTest
, but I don't get why it's on the interface itself.snowe
03/18/2024, 4:59 PMbenkuly
03/19/2024, 12:01 PMAlex Kuznetsov
03/19/2024, 6:34 PMelectrolobzik
03/21/2024, 5:24 PMCannot locate tasks that match ':compose-ui:compileJava' as task 'compileJava' is ambiguous in project ':compose-ui'. Candidates are: 'compileDebugAndroidTestJavaWithJavac', 'compileDebugJavaWithJavac', 'compileDebugUnitTestJavaWithJavac', 'compileReleaseJavaWithJavac', 'compileReleaseUnitTestJavaWithJavac'.
I am using Android Studio Iguana | 2023.2.1 RC 2. Is there any workaround to make it work?Davio
03/22/2024, 8:31 AMshouldBe
? It's all too easy to accidentally compare apples and oranges since shouldBe
just accepts any type as its argumentamazingustav
03/22/2024, 3:44 PMKoinApplication has not been started
when I try to use context
in a FunSpec test.
This works:
test("bar") {
withApp {
// code here
}
}
This doesn't:
context("foo") {
test("bar") {
withApp {
// code here
}
}
}
q1875486458
03/24/2024, 9:55 AMpackage cong.kdb.db.debug
import io.kotest.core.spec.style.FunSpec
import kotlin.test.Test
class TestA {
@Test
fun TestA() {
println("im A")
}
}
class TestB : FunSpec({
test("testB") {
println("im B")
}
})
run via ./gradlew linuxX64Test -i --rerun-tasks --tests 'cong.kdb.db.debug.*'
it seems only run TestA but not TestB
Task :app:linuxX64Test
Caching disabled for task ':app:linuxX64Test' because:
Build cache is disabled
Task ':app:linuxX64Test' is not up-to-date because:
Executed with '--rerun-tasks'.
Watching 82 directories to track changes
Watching 79 directories to track changes
Starting process 'command '/home/cong/sm/project/demo/kotlin/db/app/build/bin/linuxX64/debugTest/test.kexe''. Working directory: /home/cong/sm/project/demo/kotlin/db/app Command: /home/cong/sm/project/demo/kotlin/db/app/build/bin/linuxX64/debugTest/test.kexe --ktest_no_exit_code --ktest_logger=TEAMCITY --ktest_gradle_filter=cong.kdb.db.debug.*
Successfully started process 'command '/home/cong/sm/project/demo/kotlin/db/app/build/bin/linuxX64/debugTest/test.kexe''
cong.kdb.db.debug.TestA.TestA[linuxX64] STANDARD_OUT
im A
Finished generating test XML results (0.0 secs) into: /home/cong/sm/project/demo/kotlin/db/app/build/test-results/linuxX64Test
Generating HTML test report...
Finished generating test html results (0.096 secs) into: /home/cong/sm/project/demo/kotlin/db/app/build/reports/tests/linuxX64Test
Watching 80 directories to track changes
Watching 85 directories to track changes
Watching 86 directories to track changes
Kev
03/25/2024, 10:37 AMwhenever(it.foo(any()).thenReturn(null))
where foo’s parameter is a value class? I keep getting unbox-impl()
error’s when trying to do this. If I use an explicit value then it works as expected.Kirill Zhukov
03/27/2024, 6:00 PMcoroutineTestScope
in kotest over kotlin's runTest
directly? Is the main benefit that I can set coroutineTestScope = true
once on entire spec instead of having to call runTest
on each individual test? Anything else I'm missing?dawidhyzy
03/28/2024, 7:21 AMdatatest
is causing
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:domain:impl:testDebugUnitTest'.
> No tests found for given includes: [com.example.core.domain.impl.GetCanReplayUseCaseImplTest](--tests filter)
Adam S
04/06/2024, 12:33 PMMarc
04/10/2024, 9:16 AMtrue
or false
) is there a built in feature to set a property test for all the possible combinations of this 2 exhaustives?
• true true
• true false
• false true
• false false
thanks 🙏🏻Bartłomiej Kępa
04/15/2024, 10:20 PMclass KafkaContainerDrivenTest: AnnotationSpec() {
private val testNetwork = Network.newNetwork()
private val kafkaContainer = install(ContainerExtension(beforeStart = { println("before start")}, afterStart = { println("after start")}, container = KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:6.2.1")))) {
println("configuring")
withExposedPorts(9093)
withNetwork(testNetwork)
withNetworkAliases("kafka")
}
...
}
judging from ContainerExtension.mount()
function and std output (where I see that 'before start' and 'after start' hooks are running before 'configuring' block) how can I ensure that my Kafka container is properly configured before it gets started. Looks like container is started before its configuration lambda gets executed. I am expecting following output:
configuring
before start
after start
Please correct me if I'm wrong. I'm struggling with getting this properly configured and running in tests along with toxiproxy. I am on "io.kotest.extensions:kotest-extensions-testcontainers:2.0.2
and io.kotest:kotest-runner-junit5:5.8.1.
Yunchi
04/17/2024, 7:38 PMmaxParallelForks > 1
and there are test cases with when (someEnum)
. It seems like each test case with a when clause will cause all tests in the module to get run an extra time.Kashismails
04/18/2024, 6:37 PMRob Elliot
04/18/2024, 7:53 PMCaio Costa
04/21/2024, 5:01 PMsystem/path/ValueCastingTest has been compiled by a more recent version of the Java Runtime (class file version 64.0), this version of the Java Runtime only recognizes class file versions up to 61.0
When I run them all at once though, they pass.
I noticed that when they run individually, the jbr/bin/java runner is picked by default. Is there a way to tell Kotest to always choose the JDK_HOME environment variable?
My JDK Home points to JDK 20, so does my Gradle settings
I got the plugin installed and all dependencies up-to-date (5.8.1)
This is my test class:
internal class ValueCastingTest : FunSpec({
test("castTo should return a valid value") {
ValueCasting.castTo<List<Int>>(arrayListOf(defaultInteger()))
?.first()
.shouldBe(defaultInteger())
}
test("castToNonNullable should return a valid value") {
ValueCasting.castToNonNullable<List<Int>>(arrayListOf(defaultInteger()))
.first()
.shouldBe(defaultInteger())
}
})
Thank you so much 👍Alex Kuznetsov
04/22/2024, 12:55 PMKlitos Kyriacou
04/22/2024, 8:33 PMSiva Bharath Kalapatapu
04/23/2024, 4:10 AM5.8.0
and 5.8.1
in terms of eventually
block. I see that once I update to 5.8.1
eventually blocks are failing even after changing from io.kotest.assertions.timing
to io.kotest.assertions.nondeterministic
I changed from
eventually(5000.milliseconds(), 300.milliseconds())
to
eventuallyConfig {
duration = 5000.milliseconds()
interval = 300.milliseconds()
}
Do I need to add some other config as well?Lukasz Kalnik
04/23/2024, 8:58 AMio.kotest.engine.test.interceptors.TestTimeoutException: Test 'screen was just opened' did not complete within 2h 46m 40s
Jørund Amsen
04/24/2024, 12:15 PMNo matching tests found in any candidate test
error (even though all tests are ran and passed if I scroll up in the output). If I run only one test it doesn't ask me which runner, and automatically correctly picks kotest as runner configuration and runst the tests correctly. If I manually create a new run configuration from kotest and point to the spec class (with no one specific test) it correctly runs all tests in the class, with no complaining about not finding candidate tests.
Do I have something configured wrong? What could be the cause of this?nacyolsa
04/24/2024, 12:41 PMobject KotestRetryFlakyTestsExtension : TestCaseExtension {
override suspend fun intercept(testCase: TestCase, execute: suspend (TestCase) -> TestResult): TestResult {
execute(testCase)
execute(testCase)
execute(testCase)
execute(testCase)
return execute(testCase)
}
}
Unfortunately when I run test which fail there is some leak and tests execution is not finishing and hanging forever:
Any suggestions what I am doing wrong?