https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotest
  • b

    bbaldino

    11/04/2020, 7:26 PM
    how hard is it to install an old version of the kotest plugin? i accidentally updated it and now i can't run any tests (since my kotest lib version is too old)
    • 1
    • 1
  • s

    savrov

    11/08/2020, 8:02 PM
    Hi, can i use kotest in common module of Kotlin MPP? I’m specially interested in its styles and data-driven testing
    s
    • 2
    • 2
  • p

    phil-t

    11/09/2020, 11:27 AM
    I've set
    globalAssertSoftly
    to true for my tests but have found a situation where I don't want to use this - is there a way to not use soft assertions for an individual test, or to stop the test after a specific assertion? I've tried
    exitProcess(0)
    but this leads to the test being terminated without any information about the assertion.
    s
    • 2
    • 4
  • c

    christophsturm

    11/11/2020, 12:11 PM
    if i have the same context in multiple test classes these contexts are grouped in the test runner. is that a feature?
    class Functional1Test : FunSpec({
        context("ctx") { 
    
    different file: 
    class Functional2Test : FunSpec({
        context("ctx") {
    s
    • 2
    • 13
  • t

    tieskedh

    11/11/2020, 1:15 PM
    Great work on Kotest! I have a little question:
    data class Person(
        val name : String,
        val age : Int
    )
    
    fun Arb.persons() = bind(
        string(), int()
    ) { name, age -> Person(name, age) }
    
    @Test
    fun test() = forAll(
        config = PropTestConfig(
            shrinkingMode = ShrinkingMode.Bounded(10)
        ), 
        Arb.persons()
    ){ it.age > 18 }
    How can I use//create a shrinker for Person?
    s
    • 2
    • 4
  • c

    christophsturm

    11/12/2020, 10:45 AM
    Idea now complains about one of my test classes, but it compiles and runs fine.
    d
    s
    • 3
    • 6
  • a

    atara

    11/14/2020, 10:03 PM
    Hello! After upgrading the Kotest version to 4.3.1 (from 4.2.2) I have noticed that it takes double the time to run the tests. I am heavily using the property based tests and I see that now there are much more edge cases. I was told that using a
    filter
    can be the cause of slowing down. Do you also think that using
    bind
    is the problem? Maybe I should try to avoid both and use
    arbitrary
    instead of
    bind
    ?
    s
    • 2
    • 44
  • s

    simon.vergauwen

    11/16/2020, 4:29 PM
    Hey everyone, Does anyone know if there is an easy way to profile how long tests take to run? I ran Gradle
    --profile
    , but that only shows the length of the whole suite. I'd like to generate a small report to see which tests take excessively long.
    s
    s
    • 3
    • 5
  • b

    Big Chungus

    11/16/2020, 5:13 PM
    Does anyone know what artifact to use for MPP JVM + JS setup?
    s
    • 2
    • 17
  • b

    Big Chungus

    11/16/2020, 5:22 PM
    Also getting this on kotest-framework-engine@4.3.1:
    Cannot access 'kotlinx.coroutines.CoroutineScope' which is a supertype of 'io.kotest.core.spec.style.scopes.GivenScope'. Check your module classpath for missing or conflicting dependencies
    Anyone knows a workaround?
    s
    • 2
    • 11
  • k

    kopper

    11/18/2020, 8:59 PM
    What is the compatibility matrix for Kotest vs Kotlin? Is latest Kotest 4.3.1 expected to work with any Kotlin? When I use Kotest 4.3.1 + Kotlin 1.3.72 using inspectors, e.g. forOne fails with java.lang.NoClassDefFoundError: kotlin/KotlinNothingValueException. I am not sure if this is a bug or I am using wrong combination of versions.
    s
    • 2
    • 3
  • t

    tieskedh

    11/24/2020, 10:11 AM
    Sorry for bothering... The test in ShrinkingTest fails for me. (I'm getting one line with the original cause, but no shrinking-steps.) My question is: is this a know bug? The reason I'm asking is that I couldn't find an issue about shrinking not working.
    s
    • 2
    • 28
  • d

    DosExe

    11/24/2020, 4:46 PM
    Hello, i have a problem with migration from swagger to openapi with spring-boot app. The app after migration works fine, but kotest not working at all after it. I am using spring-boot 2.3.4 and kotest 4.2.2. There is no errors spawned when i run tests in idea, just
    Test framework quit unexpectedly
    . When i run mvn test i get
    java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: Provider io.kotest.runner.junit.platform.KotestJunitPlatformTestEngine could not be instantiated
    .
    • 1
    • 1
  • c

    Cicero

    11/24/2020, 7:17 PM
    Any examples of kotest working with KMM? Specifically I wanna test my common/shared code but I didn't succeed into adding kotest dependencies into my project.
    a
    • 2
    • 1
  • a

    Animesh Sahu

    12/01/2020, 10:01 AM
    Does kotest-property supports Kotlin/Multiplatform? The docs says yes but no artifact found when adding the dependency...
    s
    • 2
    • 3
  • k

    Krystian Rybarczyk

    12/01/2020, 4:22 PM
    Hey guys 👋 Does anyone know if it’s possible to have kotest and junit5 tests coexist? I have a project with kotest setup and I wanted to give junit5 a go in Kotlin, but when I added
    testImplementation(platform("org.junit:junit-bom:5.7.0"))
        testImplementation("org.junit.jupiter:junit-jupiter")
    tests are not picked up by Gradle. Do Jupiter and Kotest not like one another?
    s
    • 2
    • 19
  • t

    tieskedh

    12/01/2020, 6:51 PM
    Hi all, If this is not the place, you can tell and I will remove my question. In the past I saw a video about testing, where they isolated the path that only the failing test touched. By isolating that path, it should be easier to view which code is incorrect. At this moment, I can't find any information about this. Does anyone have more information about this, such as a name, or even better, where I can find how to do this?
    s
    m
    • 3
    • 7
  • s

    simon.vergauwen

    12/01/2020, 7:57 PM
    Is there a way to build a combination of
    Arb
    with frequencies like `Arb.choose` which takes into account all the edgecases of all provided
    Arb
    ? I just encountered a bug that was happening on an edgecase value but it only arises when I raise iterations to 100K or so, using the following Arb.
    s
    l
    m
    • 4
    • 12
  • d

    dave08

    12/03/2020, 5:07 PM
    If I'm making an abstract base class for tests that need a testcontainers db connection (in Micronaut Test), is there some kind of generic test type I can use, and then just use whichever of the styles in the actual tests inherited from it?
    s
    t
    • 3
    • 5
  • p

    Peter

    12/03/2020, 6:32 PM
    hi, suddenly i’m unable to run individual tests/suites in IntelliJ any longer, it says:
    Test events were not received
    , I believe this started happening after update to latest IJ yesterday (for code with me)
    s
    s
    • 3
    • 16
  • t

    taer

    12/03/2020, 8:02 PM
    Or, better question, how do I get a "ContainerScope" inside a StringSpec?
    s
    c
    • 3
    • 25
  • p

    Paul Woitaschek

    12/04/2020, 9:55 AM
    I'm playing with kotest but it seems to be missing watchosarm32? https://repo.maven.apache.org/maven2/io/kotest/
    b
    s
    • 3
    • 5
  • d

    dave08

    12/06/2020, 2:55 PM
    Is there only supposed to be one
    context
    as root in a
    ShouldSpec
    when using
    beforeEach
    ? It seems like when I put the
    beforeEach
    in the
    init
    block along with two
    contexts
    , it only gets run once...
    s
    r
    • 3
    • 16
  • d

    dave08

    12/06/2020, 3:06 PM
    Ok...
    beforeTest
    and
    afterTest
    works... but what's the difference? It sounds from the docs that
    beforeEach
    should be called before each test case with the type
    Test
    ,
    should
    isn't a
    Test
    ?
    w
    • 2
    • 6
  • l

    LeoColman

    12/09/2020, 3:51 AM
    When testing things I'm for sure are flaky, like dynamoDB
    a
    • 2
    • 6
  • t

    tieskedh

    12/10/2020, 1:14 PM
    I don't know if it's possible, but it would be great to somehow attach an execution when shrinking completed, such that an additional run can be made, but where all the loggers are enabled.
    s
    • 2
    • 1
  • b

    bbaldino

    12/11/2020, 10:25 PM
    One thing I miss about the now-deprecated
    shouldBeInstanceOf
    that took a block was that I ended up doing things like this:
    someList.first().shouldBeInstanceOf<Foo> {
      // 'it' is cast to 'Foo'
      it.someMethodOnFoo() shouldBe ...
    }
    whereas now I end up doing something like
    with (someList.first()) {
        shouldBeInstanceOf<Foo>()
        someMethodOnFoo() shouldBe ...
    }
    and I prefer the first style, but perhaps just a personal preference.
    s
    j
    • 3
    • 6
  • c

    christophsturm

    12/12/2020, 12:22 PM
    i was thinking why tests are defined in classes instead of just in top level, and i guess the main reason is discovery. but why are they classes and not objects?
    j
    s
    • 3
    • 79
  • c

    christophsturm

    12/12/2020, 3:43 PM
    if i create a new project and add only
    testImplementation("io.kotest:kotest-framework-engine-jvm:$kotestVersion")
    as dependency (and the kotest gradle plugin), i get this compiler error:
    > Task :compileTestKotlin FAILED
    e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
        class io.kotest.core.spec.style.scopes.ContainerScope, unresolved supertypes: kotlinx.coroutines.CoroutineScope
        class io.kotest.core.test.TestContext, unresolved supertypes: kotlinx.coroutines.CoroutineScope
    s
    • 2
    • 2
  • s

    sam

    12/12/2020, 4:40 PM
    Would welcome some feedback on: https://github.com/kotest/kotest/issues/1899
    j
    t
    • 3
    • 6
Powered by Linen
Title
s

sam

12/12/2020, 4:40 PM
Would welcome some feedback on: https://github.com/kotest/kotest/issues/1899
j

Javier

12/12/2020, 8:26 PM
Gradle supports running tests on kts?
s

sam

12/12/2020, 8:26 PM
No
Would require some other work
t

thanksforallthefish

12/14/2020, 8:13 AM
what would the new syntax gain? and how much more complex the code in the plugin and framework itself would get to support both (class and top level) style would get?
if the gain is minimal or none compared to the increase complexity I would think it is not worth
s

sam

12/14/2020, 10:26 PM
@thanksforallthefish fair point. The actual complexity / risk is low because it goes through a separate code point. As for gain, it depends whether you think writing tests outside of a class is a useful feature or not - which is really what I'm asking in this issue.
View count: 5