sbt 0.13.1 and junit-interface 0.10 doesn't run JUnit tests #35

Open
applitect opened this Issue Dec 27, 2013 · 5 comments

Comments

Projects
None yet
6 participants

I have a project where we have lots of unit tests written. We've recently upgraded to sbt 0.13 and now our unit tests don't run. If I add the following to my build.sbt:

crossPaths := false

then it picks up the tests and runs successfully.

I built my own version of the plug-in and put in some debugging statements and then turned on global debugging within the build.sbt and it appears that the JUnitRunner is never even instantiated when crossPaths is defaulted to true.

mtomko commented Apr 14, 2014

Sorry, my observation seems to be a red herring. I'm having trouble reproducing things, which leads me to believe that my IDE and SBT are working at cross-purposes.

tzachz commented Feb 23, 2015

If it's of any value - this worked for me: I had a multi-module project with one pure java module (with only JUnit tests), and I couldn't get sbt to run this module's JUnit tests until I set crossPaths := false for this module.

kag0 commented Sep 17, 2015

Just chiming in - this also worked for me. Scala 2.11.7 SBT 0.13.8 java sources and java junit tests won't run without "crossPaths := false"

tloist commented Apr 8, 2016

Looks like I had the same problem, but running on sbt 0.13.8 but scala 2.10.4 and "com.novocode" % "junit-interface" % "0.11" and I had to disable crossPaths as well before the JUnit Tests were detected.

loadedTestFrameworks showed the JUnit Testrunner, but the test files themselves were not shown in definedTests.

Digged a bit deeper and the effect of switching the property crossPaths is that the compile task returns slightly different objects. In the sbt.inc.MAnalysis object the apis.internal HashMap contains tuples containing my test files, however in the case of crossPaths := true the value xsbti.api.Source contains nothing under api.definitions, which is what Tests.discover reduces all entries to.

cstub referenced this issue in RBMHTechnology/eventuate Jun 7, 2016

Closed

AbstractEventsourcedProcessorSpec failed #230

@cstub cstub added a commit to RBMHTechnology/eventuate that referenced this issue Jun 7, 2016

@cstub cstub AbstractEventsourcedProcessorSpec failed
- disabling of 'crossPath' in testSettings in order to enable junit-tests (see sbt/junit-interface#35)
7d9ba36

@cstub cstub added a commit to RBMHTechnology/eventuate that referenced this issue Jun 28, 2016

@cstub cstub AbstractEventsourcedProcessorSpec failed
- closes #230
- change of 'crossPath = false' in testSettings in order to enable junit-tests (see sbt/junit-interface#35)
bbb38d3

cstub referenced this issue in RBMHTechnology/eventuate Jun 28, 2016

Merged

Java-API tests are not executed #279

@cstub cstub added a commit to RBMHTechnology/eventuate that referenced this issue Jun 28, 2016

@cstub cstub AbstractEventsourcedProcessorSpec failed
- relates to #230
- change of 'crossPath = false' in testSettings in order to enable junit-tests (see sbt/junit-interface#35)
dbe56c5

@cstub cstub added a commit to RBMHTechnology/eventuate that referenced this issue Jun 28, 2016

@cstub cstub Java-API tests are not executed
- relates to #230
- change of 'crossPath = false' in testSettings in order to enable JUnit tests (see sbt/junit-interface#35)
d8fdf89

jrudolph referenced this issue in akka/akka-http Jun 13, 2017

Closed

Reenable JUnit test for PR validation #1191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment