-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Description
When showFullStackTraces is true, the plugin prints the whole stacktrace.
But I think that most lines of the stacktrace is useless since they come from test framework (e.g. Kotest).
So I request a feature that can filter lines of a stacktrace.
Additional information
Example
(See shwaka/gradle-test-logger-issue for the complete example.)
Consider the following simple code.
// main/kotlin/Foo.kt
class Foo {
fun method1(): Int {
return this.method2()
}
private fun method2(): Int {
return this.divideByZero()
}
private fun divideByZero(): Int {
return 1 / 0
}
}
// test/kotlin/FooTest.kt
class FooTest : StringSpec({
"failing test" {
val foo = Foo()
foo.method1() shouldBe 1
}
})This test fails since the method divideByZero() throws an error.
Using the plugin with showFullStackTraces = true, the output looks like as follows:
But all lines below the 7th line of the stacktrace have class names starting from io.kotest or kotlinx.coroutines, which are useless for debugging.
So I want to filter the stacktrace as follows:
Implementation
I have a fork shwaka/gradle-test-logger-plugin which implements the filtering feature.
Setting filterFullStackTraces = "io\\.kotest.*", the plugin will filter stacktrace as in the 2nd screenshot.
I'm willing to create a pull request if you like it.

