sam
02/17/2020, 11:54 AMSourabh Rawat
02/20/2020, 6:41 AMDias
02/20/2020, 11:06 AMAngelina
02/22/2020, 10:20 PMgradlew test
it freezes 🙄 anyone else experienced this issue? I have default config (1 thread). I tried to add custom config but kotest did not pick it up 🤷♀️elect
03/03/2020, 9:11 AMAhmed Ibrahim
03/04/2020, 3:24 PMjava.lang.NoClassDefFoundError: kotlin/time/MonoClock
when running kotest with Kotlin 1.3.70?akowal
03/09/2020, 2:51 PMStringSpec
), all the mocks I need are declared as local variables inside same lambda and not re-initialized for each test case (like in vanilla JUnit). Essentially it means that the 2nd test can see mock invocations from the 1st one, messing up all verifications. How can I avoid that?wasyl
03/09/2020, 3:17 PMInstancePerTest
isolation mode? The way we’re using kotest right now is with DescribeSpec
, so we have bunch of describe
and context
blocks which set up tests for the it
blocks which contain the assertions.
Iiuc, InstancePerLeaf
will create new instance of the test for each it
block, and execute everything that leads to it. InstancePerTest
would create new instance not only for it
block, but also for describe
and context
, is that correct?akowal
03/09/2020, 3:27 PMAshish Kumar Joy
03/10/2020, 10:20 AMCody Engel
03/14/2020, 6:25 PMExtensions
step, when I stop the execution it ends saying Test events were not received
. This is the sample test I’m trying to run…
class SimpleTest : FunSpec({
test("just a simple test") {
1 + 1 shouldBe 2
}
})
thanksforallthefish
03/16/2020, 7:32 AMclass SampleTest : ExpectSpec() {
init {
context("test") {
expect("sum") {
1 + 1 shouldBe 3
}
expect("sum right") {
1 + 1 shouldBe 2
}
}
}
}
expect("sum right')
is ignored? I am trying to better understand isolation modes, tests and leaves and was a bit surprised by this case, also because changing isolation mode does not affect the result. kotest 3.4.2Ashish Kumar Joy
03/17/2020, 8:46 AMSteve RB
03/21/2020, 10:37 AMAngelina
03/26/2020, 11:34 AMtasks.withType<Test> {
useJUnitPlatform()
}
In multimodule app this code ⬆️ should be in each module or can be in Project level build gradle file?Angelina
03/26/2020, 11:50 AMobject ProjectConfig : AbstractProjectConfig {
object ProjectConfig : AbstractProjectConfig() {
https://github.com/kotest/kotest/blob/master/doc/project_config.mdLeoColman
03/26/2020, 4:48 PMSteve RB
03/27/2020, 9:48 AMT C
03/27/2020, 10:39 AMdependencies {
...
testImplementation 'io.kotest:kotest-runner-junit5:4.0.1'
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.0.1'
testImplementation "io.mockk:mockk:1.9.3"
testImplementation 'junit:junit:4.12'
}
as well as
android.testOptions {
unitTests.all {
useJUnitPlatform()
}
}
when trying to mimic examples from the docs I cannot seem to be able to extend any of the Spec classes (just getting unresolved reference) nor use keywords like shouldBe
. The only package I seem to be able to `import`is io.kotest.matchers
. Any idea what I am missing? Thanks!sam
03/27/2020, 1:03 PMChristian Nedregaard
03/29/2020, 11:14 AMafterTest {
println("afterTest called for '${it.a.name}'")
}
..i get
beforeTest called for 'when container when' of type: Container
afterTest called for 'when container when'
beforeTest called for 'should container should' of type: Container
beforeTest called for 'the tests' of type: Test
testing
afterTest called for 'the tests'
afterTest called for 'should container should'
So it seems like the When
is completed before (or independently of) its children while the should
is completing its children before completing itself.
Is this an explicit approach or should I just not make to many assumptions regarding the ordering of completions?
2:
Do you have a recommended approach for doing setup/teardown scoped on When
for resources that are to be available for all the Whens children? Not for every When
in the spec but for a single instance.
I'm moving over from Spek 1 where this could be achieved with `beforeGroup`/`afterGroup`.
The only approach I have found so far is to factor these cases out into separate specs.
Leaf isolation mode would not be optimal since it would recreate the resource for each TEST not for each When.
I suspect I need to adjust my expectation as to the contract Kotest offers reg. the relationship between nested containers/tests.julian
03/31/2020, 10:52 PMException in thread "main" java.lang.NoClassDefFoundError: io/kotlintest/runner/jvm/TestEngineListener
Trejon House
03/31/2020, 10:57 PMandroidTestImplementation('io.kotest:kotest-runner-junit5-jvm:4.1.0.197-SNAPSHOT')
in my build.gradle, but Android Studio is giving me the following error:
org.junit.runners.model.InvalidTestClassError: Invalid test class 'com.bytonomy.tech.nyteout.architecture.test.utilities.ApplicationSettingsSpec':
1. No runnable methods
at org.junit.runners.ParentRunner.validate(ParentRunner.java:525)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:92)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:74)
Is this a known issue with this version?taer
04/02/2020, 8:34 PMsam
04/02/2020, 10:34 PMwasyl
04/03/2020, 4:06 PM@Test fun someTest = testScope.runBlockingTest { }
. Is there some well-established pattern for running specs in a test scope? For example, do you wrap topmost test block, or maybe each smaller scope separately?
Would it make sense if Kotest facilitated (or maybe it does?) running tests with coroutines in a test scope, by allowing injecting it or providing. I don’t think there’s any configuration regarding that though, is there?sam
04/04/2020, 12:20 AMSerVB
04/07/2020, 12:37 PMclass MyTest : FreeSpec({
// ...
})
it will be possible to write like
class MyTest : FreeSpec {
// ...
}
Attila Domokos
04/07/2020, 8:23 PMkotlintest
to kotest
. However, we have a grpc project, where Kotest is having some issues. Has anybody seen this? Would you have suggestions on how to fix it?
* What went wrong:
Execution failed for task ':integration-grpc-server:extractIncludeTestProto'.
> Could not resolve all files for configuration ':integration-grpc-server:testCompileProtoPath'.
> Could not resolve io.kotest:kotest-runner-junit5-jvm:4.0.2.
Required by:
project :integration-grpc-server
> Cannot choose between the following variants of io.kotest:kotest-runner-junit5-jvm:4.0.2:
- jvm-api
- jvm-runtime
- metadata-api
All of them match the consumer attributes:
- Variant 'jvm-api' capability io.kotest:kotest-runner-junit5-jvm:4.0.2:
- Unmatched attributes:
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'java-api' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
- Compatible attribute:
- Required org.gradle.libraryelements 'resources' and found compatible value 'jar'.
- Variant 'jvm-runtime' capability io.kotest:kotest-runner-junit5-jvm:4.0.2:
- Unmatched attributes:
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'java-runtime' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
- Compatible attribute:
- Required org.gradle.libraryelements 'resources' and found compatible value 'jar'.
- Variant 'metadata-api' capability io.kotest:kotest-runner-junit5-jvm:4.0.2:
- Unmatched attributes:
- Required org.gradle.libraryelements 'resources' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'kotlin-api' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'common' but wasn't required.
Jvm version: Using java version 13.0.2.hs-adpt
This worked fine with the latest version of kotlintest
.Attila Domokos
04/08/2020, 2:53 PMkotest
is using shouldThrow
in our tests. We are getting an error with the message: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
.
I got around to it by specifying the highest jvm version we could go with in `build.gradle.kts`:
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "12"
}
However, I did not have to specify this in kotlintest
and I wish we could keep it that way.
What is the root cause of seeing this error? How kotest
changed that triggered it? - This is for my own educational purpose.
Also (this might be a #gradle question), is it possible to specify this constraint for tests only in gradle?Attila Domokos
04/08/2020, 2:53 PMkotest
is using shouldThrow
in our tests. We are getting an error with the message: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
.
I got around to it by specifying the highest jvm version we could go with in `build.gradle.kts`:
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "12"
}
However, I did not have to specify this in kotlintest
and I wish we could keep it that way.
What is the root cause of seeing this error? How kotest
changed that triggered it? - This is for my own educational purpose.
Also (this might be a #gradle question), is it possible to specify this constraint for tests only in gradle?tasks {
withType<Test> {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "12"
}
}
}