8000 JUnit: populate `sbt.testing.Event.throwable` and `duration`. by dubinsky · Pull Request #4320 · scala-native/scala-native · GitHub
[go: up one dir, main page]

Skip to content

JUnit: populate sbt.testing.Event.throwable and duration. #4320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

dubinsky
Copy link
Contributor
@dubinsky dubinsky commented May 6, 2025

If a Throwable associated with the test event is available, bubble it up through the SBT's test interface using the slot dedicated to just such information: sbt.testing.Event.throwable.

If duration associated with the test event is available, bubble it up through the SBT's test interface using the slot dedicated to just such information: sbt.testing.Event.duration; if duration is not available, populate the slot with 0.

It seems a shame to throw away information that is literally in our hands; also, this change:

  • simplifies integration with runners that assume that test failure is always accompanied by a Throwable (e.g., Gradle) and
  • avoids weird-looking negative duration values in test reports.

FYI: this issue was ported to Scala Native from Scala.js, as it was to MUnit; it has been fixed in both: scala-js/scala-js#5132, scala-js/scala-js#5134, scalameta/munit#918.

…duration`.

If a Throwable associated with the test event is available, bubble it up through the SBT's test interface using the slot dedicated to just such information: `sbt.testing.Event.throwable`.

If duration associated with the test event is available, bubble it up through the SBT's test interface using the slot dedicated to just such information: sbt.testing.Event.duration;
if duration is not available, populate the slot with `0`.

It seems a shame to throw away information that is literally in our hands; also, this change:
- simplifies integration with runners that assume that test failure is always accompanied by a `Throwable` (e.g., Gradle) and
- avoids weird-looking negative duration values in test reports.
@ekrich
Copy link
Member
ekrich commented May 6, 2025

@dubinsky Thanks for this work. I followed your work in Scala.js and was hoping you would make it this way :-)

@dubinsky
Copy link
Contributor Author
dubinsky commented May 6, 2025

@dubinsky Thanks for this work. I followed your work in Scala.js and was hoping you would make it this way :-)

Thank you for the encouragement, @ekrich ! I appreciate it a lot!

What do I need to do for this to get merged? My Gradle Plugin now supports building and testing Scala Native code, and it would be nice to be able to drop work-arounds for the JUnit4 for Scala Native ;)

Thank you!

@ekrich
Copy link
Member
ekrich commented May 6, 2025

@WojciechMazur Is super good about reviewing and merging - he is planning to make a release later this week or early next week so I am pretty sure this can get merged especially since this has already went through the Scala.js process.

@dubinsky
Copy link
Contributor Author
dubinsky commented May 6, 2025

@WojciechMazur Is super good about reviewing and merging - he is planning to make a release later this week or early next week so I am pretty sure this can get merged especially since this has already went through the Scala.js process.

Fantastic, thank you!

@WojciechMazur WojciechMazur merged commit 013c4de into scala-native:main May 10, 2025
34 checks passed
@LeeTibbert
Copy link
Contributor

dubinsky

As an individual contributor I thank you for all the recent typo fixes, in many files.

@dubinsky
Copy link
Contributor Author

As an individual contributor I thank you for all the recent typo fixes, in many files.

Thank you for your kind words!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0