-
Notifications
You must be signed in to change notification settings - Fork 928
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
Exception thrown by forked test framework swallowed #2722
Comments
Thanks for the repro project. Probably a duplicate of #2442 |
I've been unable to come up with a workaround. How could I assert that >0 tests were executed? |
According to #2442 (comment) it's a bug in sbt. sbt/main/actions/src/main/scala/sbt/ForkTests.scala Lines 23 to 26 in 16a6906
|
This can be used to fail the test execution if there is no events. I don't know if this test will give false positives, though. executeTests in Test := {
val result = (executeTests in Test).value
if (result.events.isEmpty) {
(streams.value.log.error("No test events found"))
result.copy(overall = TestResult.Error)
}
else result
}
|
Discussion: sbt/sbt#2722 This commit checks that some test events exist in the test log for `test/it:test` before trusting the result of `Success`.
Discussion: sbt/sbt#2722 This commit checks that some test events exist in the test log for `test/it:test` before trusting the result of `Success`.
@retronym Thanks for the hint. Here's my fix - #2723
|
Fail when the forked test harness fails using NonFatal Fixes sbt#2442/sbt#2722 Add another fork-uncaught scripted test Originally from https://github.com/retronym/sbt-test-fork-swallows-error
steps
Clone https://github.com/retronym/sbt-test-fork-swallows-error and follow instructions in the README.
problem
The exception thrown by the
tasks
method of theRunner
is logged to console, shipped over the wire to the host SBT process, logged again, but the task result is stillsuccess
.expectation
The
test
task should fail.notes
Discovered in the scala/scala SBT build which uses the partest implementation of the SBT test interface.
The text was updated successfully, but these errors were encountered: