rules_scala
rules_scala copied to clipboard
Unreadable test result
Test result from scalatest in buildbuddy is quite unreadable sometimes.
Screenshots
Test log: build_logs.txt
test.xml from buildbuddy: test.xml.zip
If some more info is needed, tell me please.
Here is a hint on how to fix it: https://github.com/buildbuddy-io/buildbuddy/issues/6453#issuecomment-2112632388
The problematic part from the snippet that Son showed is this part:
<failure message="Unexpected not mocked invocation getLatestResult(car_info {&#010; mark: "note that the message is quite verbose and contains entities like
&#010;etc.I don't have a ton of experience with these XML files and hoping other folks can chime in if they have more experience with this, but from reading the XML schema documentation here I think that in normal usage, the
messageattribute (assert message) is intended for a short summary of the error (a few words), while the text content inside the<failure>tag should contain more details such as the stack trace. It appears that in the XML doc you provided, the same full error message is included in both themessageattribute and the text of the tag.A quick fix that I could think of is to patch rules_scala so that the
messageattribute will only include the first line offailure.message. That will give you a much more readable error with Junit XML and Bazel (and BuildBuddy).I think it's from rules_scala with https://github.com/bazelbuild/rules_scala/blob/e2fe29c3b51647ecd07a562917c2c09fb48f9c0a/scala/support/JUnitXmlReporter.scala#L412-L437
could you please open an issue on rules_scala to report this? I think rules_scala maintainers would have more context on how
scalatestrunner created these events, as well as best practices from other Scala build tools to replicate over.