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
  • l

    LeoColman

    04/08/2020, 3:14 PM
    I'm not sure if this is really related to Kotest. This piece of code I see in every kotlin project
    a
    m
    s
    • 4
    • 17
  • i

    Ihar S

    04/12/2020, 8:17 PM
    Hello guys, If I found inconsistency in idea code analysis for
    kotlin-test
    library, where should I put a ticket or at least check for the ticket? Thank you 🙂
    m
    s
    • 3
    • 8
  • s

    Slackbot

    04/14/2020, 12:42 PM
    This message was deleted.
    m
    t
    • 3
    • 4
  • s

    sam

    04/15/2020, 4:53 AM
    4.0.3 has been released
    👍 2
    s
    • 2
    • 23
  • s

    sam

    04/15/2020, 5:34 PM
    https://github.com/kotest/kotest/blob/master/CHANGELOG.md
    s
    • 2
    • 3
  • p

    Pierre Marais

    04/16/2020, 10:43 AM
    https://github.com/kotest/kotest/issues/1389
    👍🏻 1
    s
    • 2
    • 3
  • c

    Corey

    04/16/2020, 2:44 PM
    Hi. I just started using Kotest and have an odd use case. I'd like to be able to execute all tests in the same test class multiple times. I am using it for mobile automation with Appium. I need to run the same set of tests for multiple languages. There is a significant setup time starting the driver and connecting to the Appium server. I want to do that once for each language. Then I need to run all the tests. Is there a way to accomplish that with Kotest or a better way to structure my tests so that I can do what I need?
    s
    • 2
    • 3
  • s

    Sourabh Rawat

    04/16/2020, 4:13 PM
    Hey, I am not able to run individual tests on IDEA. It always runs all the test cases in the spec.
    s
    • 2
    • 3
  • l

    LeoColman

    04/16/2020, 10:22 PM
    https://dev.to/kerooker/writing-reusable-tests-with-kotest-s-test-factory-5gi
    ❤️ 7
    s
    • 2
    • 4
  • h

    HarryPulvirenti

    04/19/2020, 10:48 AM
    Hi I'm migrating from kotlintest to kotest but I found a strange issue: When I run the tests from the
    IDE
    every test is successful but when I try to run the test with
    gradlew
    I'm getting this error in an assertion:
    java.lang.NoClassDefFoundError: arrow/core/NonFatal
    the assertion is this
    shouldBeLeft()
    Someone can help me?
    a
    s
    s
    • 4
    • 14
  • w

    wasyl

    04/19/2020, 12:39 PM
    What’s the state of IntelliJ plugin for kotest 4.0? I see https://github.com/kotest/kotest-intellij-plugin/issues/42 and I’m not sure if it’s worth upgrading right now or I should wait a bit, if IJ (AS) support is important for me
    s
    • 2
    • 3
  • r

    reevn

    04/21/2020, 9:32 AM
    Hey 👋 I saw that experimental Robolectric support was added in September: https://github.com/kotest/kotest/issues/926. It's been a while, has anybody migrated to Kotest with lots of Roblectric tests? Are there any known caveats or is it basically good to go? Thanks! 🙂
    l
    • 2
    • 4
  • y

    Yuan Lin

    04/22/2020, 3:21 AM
    anyone having issue on performance ? I’m using kotlin-test 3.3.1 and it takes 3 minutes to compile my test project. and each time I change an individual test case it still take tens of seconds to compile
    s
    • 2
    • 1
  • s

    Steve RB

    04/22/2020, 10:48 AM
    Anyone got any tips for debugging kotest + dependency issues? I've got an existing project using kotest 4.0.3, but when I add the following line to my build.gradle, non of my tests are getting run (with ./gradlew clean test): • implementation 'com.github.thake.avro4k:avro4k-kafka-serializer:0.2.0' I'm assuming its pulling in a dep that breaks kotest in some way, but can't figure out what, any advice would be really useful!
    s
    m
    • 3
    • 37
  • d

    dr.dreigh

    04/26/2020, 9:05 PM
    yeah - it's very nully as it stands. Those are great ideas, thanks, I'll have a play tomorrow.
    👍🏻 1
    l
    s
    • 3
    • 5
  • s

    sam

    04/27/2020, 12:54 AM
    Intellij plugin 0.90.16 has been released. This is still beta, but if you want to have a go, here it is. Make sure you read the instructions here as this requires a snapshot build of kotest. https://github.com/kotest/kotest-intellij-plugin/blob/master/README.md
    kotest-plugin-intellij-0.90.16.zip
    👍 2
    m
    • 2
    • 2
  • k

    Kiryushin Andrey

    04/27/2020, 2:57 PM
    Anyone saw this error when trying to run property-based test using generic types?
    java.lang.ClassCastException: java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.base/java.lang.Class
    s
    • 2
    • 13
  • b

    Ben

    04/27/2020, 6:10 PM
    Is there an easy way to skip a whole test class based on an environment variable? I looked at SkipTestException but it doesn't seem to be available anymore (Docs might need to be updated).
    l
    s
    • 3
    • 6
  • m

    mattmoore

    04/29/2020, 1:30 AM
    Am I doing something wrong? I'm using kotest
    4.0.4
    with Arrow's
    Either
    type to compare two lefts:
    val expected = Left(
            <http://java.io|java.io>.FileNotFoundException(
                    "data/monkeywrench.txt (No such file or directory)"
            )
    )
    
    val result = loadShortCircuit(filePaths) // returns Arrow Left type in this example (see video)
    
    val left = Left(<http://java.io|java.io>.FileNotFoundException("data/monkeywrench.txt (No such file or directory)"))
    
    expected shouldBe left
    expected shouldBe left
    fails in this case. The equality fails.
    Screen Recording 2020-04-28 at 8.20.28 PM.mov
    m
    • 2
    • 1
  • t

    thanksforallthefish

    04/29/2020, 6:42 AM
    hello, did anyone notice failing tests being reported more than once?
    package xxx
    
    import io.kotest.core.spec.style.StringSpec
    import io.kotest.matchers.shouldBe
    
    class FailingTest : StringSpec() {
      init {
        "reported twice" {
          "a" shouldBe "b"
        }
      }
    }
    both intellij and gradle reports 2 failure. I scanned open issues and saw nothing, in case I can open one
    a
    • 2
    • 2
  • a

    akowal

    04/30/2020, 11:44 AM
    if I only want to use kotest assertions in a jvm project, which dependencies should I include?
    a
    l
    • 3
    • 18
  • a

    atara

    05/01/2020, 12:22 AM
    Is this familiar to anyone ?
    Cause: java.lang.UnsupportedOperationException
    	at java.base/java.util.Collections$1.remove(Collections.java:4714)
    	at java.base/java.util.AbstractSet.removeAll(AbstractSet.java:176)
    	at org.jetbrains.plugins.gradle.service.project.GradleProjectResolverUtil.doBuildDependencies(GradleProjectResolverUtil.
    a
    s
    • 3
    • 7
  • i

    Ignat Simonenko

    05/01/2020, 11:12 AM
    Hi I've decided to take a deep dive into kotest property-testing and stuck a little bit. I want to write a simple property test for Two Sum problem, so I need to generate random
    IntArray
    and
    Int
    that will be sum of two random elements of the generated array. I had no problems with the first Arb:
    Arb.list(<http://Arb.int|Arb.int>()).map { it.toIntArray() }
    but couldn't find a solution for the second one. Could someone advise something or I choose the wrong direction?
    s
    • 2
    • 4
  • s

    sam

    05/05/2020, 2:36 AM
    You mean it calls it MyClassKtTest ?
    g
    • 2
    • 4
  • g

    Gopal S Akshintala

    05/07/2020, 3:38 AM
    Another observation, when I wish to run only a specific test (say in StringSpec) and when the test-runner is set as Gradle in intellij, it runs all the tests in the file, as the gradle command that triggers is
    gradle test --tests "com.package.testClassName"'
    . Is this expected?
    s
    • 2
    • 3
  • s

    simon.vergauwen

    05/07/2020, 8:25 AM
    Is the kotest plugin already use-able? I was trying it out today, I’ve been using kotest in a new project. I shared my gradle config, I also tried with
    test { useJUnitPlatform() }
    but that didn’t change anything. I have plugin version
    3.3.0.11
    which I installed from the link on the github page of the plugin. The plugin is also still named
    KotlinTest
    in my editor, it was called Kotest on the plugin website. Any ideas? Shall I open a ticket on the plugin page? IntelliJ IDEA 2020.1 (Community Edition) Build #IC-201.6668.121, built on April 8, 2020 Runtime version: 11.0.6+8-b765.25 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.15.4 GC: ParNew, ConcurrentMarkSweep Memory: 4012M Cores: 12 Registry: ide.balloon.shadow.size=0 Non-Bundled Plugins: org.intellij.scala, org.jetbrains.kotlin, kotlintest-plugin-intellij
    Untitled
    g
    s
    • 3
    • 12
  • s

    simon.vergauwen

    05/09/2020, 3:16 PM
    I remember suspending forAll was available in kotest. Any chance I am looking in the wrong modules or packages?
    s
    s
    • 3
    • 20
  • p

    Pierre Marais

    05/13/2020, 2:57 PM
    Hi, is there any reason why an application cannot startup if it does an
    implementation
    instead of
    testImplementation
    of the kotlintest dependency? I.e. when I do
    testImplementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")
    I have no issues, however when I do
    implementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")
    I get this error when running my bundled jar:
    Error: Could not find or load main class package.ApplicationKt
    Caused by: java.lang.ClassNotFoundException: package.ApplicationKt
    s
    • 2
    • 6
  • s

    simon.vergauwen

    05/15/2020, 4:27 PM
    Damn,
    choose
    constrains to
    Any
    😄
    s
    • 2
    • 6
  • c

    Chris

    05/18/2020, 8:21 AM
    Hello all... kotest newbie here! So, I would like to have the tests output formatted something like RSpec style:
    ....F.....*.....
    a
    s
    • 3
    • 3
Powered by Linen
Title
c

Chris

05/18/2020, 8:21 AM
Hello all... kotest newbie here! So, I would like to have the tests output formatted something like RSpec style:
....F.....*.....
a

Attila Domokos

05/18/2020, 1:41 PM
I use this Gradle plugin: https://github.com/radarsh/gradle-test-logger-plugin Works OK, it does not provide the short, compressed logging you're after, and error counts are reported incorrectly with kotest. I have not had a chance to look into why and send a PR.
s

sam

05/18/2020, 4:38 PM
The reason error counts are reported wrong is because gradle doesn't understand nested tests properly. If you do this:
test("outer test") {
   test("inner test") { 
   }
}
Then gradle sees that as 2 tests
View count: 5