Skip to content

Filter stack trace in error output #189

@bwbecker

Description

@bwbecker

Here are some example stack traces in utest output:

X example.HelloSpec.test3 0ms 
  java.lang.IndexOutOfBoundsException: 10
    scala.collection.LinearSeqOptimized.apply(LinearSeqOptimized.scala:63)
    scala.collection.LinearSeqOptimized.apply$(LinearSeqOptimized.scala:61)
    scala.collection.immutable.List.apply(List.scala:85)
    example.HelloSpec$.$anonfun$tests$4(HelloSpec.scala:29)
X example.HelloSpec.test4 3ms 
  java.lang.AssertionError: assertion failed: ==> assertion failed: 1 != 2
    scala.Predef$.assert(Predef.scala:219)
    utest.asserts.Asserts$ArrowAssert.$eq$eq$greater(Asserts.scala:193)
    example.HelloSpec$.$anonfun$tests$5(HelloSpec.scala:33)

I think most of the time the part of the trace from utest itself (utest.asserts.Assert) and the scala library (scala.*) aren't useful.

Would the project maintainers welcome a pull request that added a feature where the user could provide a function to filter the stack trace? It would probably be modelled on exceptionStackFrameHighlighter with exceptionIncludeStackTraceElement(s:StackTraceElement):Boolean = true as the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions