Open dmitrimedvedev opened 9 years ago
+1
In my case just using the plain Junit Parametrized.class runner
@RunWith(Parameterized.class) public class MyTest extends BaseTest { // code here }
My parametrized test ran (6 of them) but in the SBT console I see contradictory results:
[info] Test run finished: 6 failed, 0 ignored, 6 total, 70.937s [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
My dependencies: "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test -> default"
I think I've encountered this bug in my play project which seems to use this project (if I interpret https://github.com/playframework/playframework/blob/3c530e93603d4005211d466923fff486338faf00/framework/project/Dependencies.scala correctly).
As you can see in the linked issue from the play bugtracker the tests are run (and output to the console) yet they are not counted as either passed, failed or errors.
I have the same problem, when use @RunWith, I get zero value test report. [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
@RunWith(SpringJUnit4ClassRunner.class) works for me (in "IntegrationTest"). Have you tried the latest sbt version 0.13.8?
I've also seen the same problem (using org.scalatest.junit.JUnitRunner
with the ScalaTest
framework disabled), but it's only when the test extends from a class that has the RunWith
annotation. When it's on the class directly, it works.
Having the same issue. Having a class annotated with @RunWith(MockitoJUnitRunner.class), and sbt test
doesn't run anything. Even if i comment it out, still won't run my JUnit 4 tests. I'm searching for the problem.
managed to have it run by adding crossPaths := false
in build.sbt
.
This test is not picked up:
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:test-context.xml"}) public class MyTest {
but if @RunWith is commented out the test is picked up (but obviously does not work correctly)
//@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:test-context.xml"}) public class MyTest {
This is using 0.11 of junit-interface library libraryDependencies += "com.novocode" % "junit-interface" % "0.+" % "test" ... Resolving com.novocode#junit-interface;0.11-RC1