I think I will stop using testBalloon and switch b...
# testballoon
n
I think I will stop using testBalloon and switch back to Kotest, since I am only testing JVM code without coroutines, and testBalloon has lots of issues with my tests: aborting long-running tests, but also logging coroutines dumps for longer-running tests
o
kotlinx.coroutines will do coroutines dumps if `TestScope` is enabled (the default in TestBalloon) and the
kotlinx-coroutines-debug
dependency is present: > On the JVM, if DebugProbes from the kotlinx-coroutines-debug module are installed, the current dump of the coroutines' stack is printed to the console on timeout before the test body is cancelled. It seems like what would have helped is just turning off
TestScope
globally. To do so, a custom test session for a test module can be configured like so:
Copy code
class ModuleSession : TestSession(testConfig = DefaultConfiguration.testScope(false))
n
Interesting. Can you show a concrete example where to configure that? My test code currently uses
Copy code
val Quest11Test by testSuite {
    test("one") {
         ....
    }
}
o
Just put that line in any source file of your test module. I'd put it in its own file like
ModuleSession.kt
. It's documented here.
n
oh. I used the following code in another repo where I used testBallon:
Copy code
class ModuleTestSession : TestSession(testConfig = DefaultConfiguration.timingReport())

private val name = Regex("""↘(.+)»""")

private fun TestElement.Path.name() = name.find(toString())!!.groupValues[1]

fun TestConfig.timingReport(): TestConfig {
    return aroundEachTest { elementAction ->
        val duration = measureTime { elementAction() }
        println("${testElementPath.name()}: $duration")
    }
}
So could I combine this timingReport with the
testScope(false))
?
o
Absolutely. Its a decorator chain, so
Copy code
DefaultConfiguration.timingReport().testScope(false)
would do the job.
n
Great! So I will try to continue using TestBalloon. Added the config to my current playground repo https://github.com/nkiesel/EverybodyCodes_2025
o
Cool. Out of curiosity: What was your main reason to switch from Kotest to TestBalloon?
n
Pure interest to try new test frameworks. I last year switched my AdventOfCode_2025 from Junit to Kotest, and then read about TestBalloon and wanted to explore it.
👍 1
Another very personal reason: I'm working in the San Francisco Bay area the last 25+ years, but grew up in Germany, so was also curious about a tool developed in Germany.
😆 1
119 Views