Why does ScalaTest commandline repeat the tests?

Hello all. I'm looking for some pointers on how the ScalaTest commandline is constructed, because I seem to have a problem with it, and it's driving me mad. I'd be grateful for any help...

The setup:

I have a Java + Scala application, with tests only for the Scala code, which are written in ScalaTest. IntelliJ IDEA 10.5.2, Scala 2.8.0, ScalaTest 1.2. Actions are run with Ant. An example ScalaTest class looks like this:

class DeliciousNetworkHandlerTest extends Spec with ShouldMatchers {
  describe("DeliciousNetworkHandler") {
    it("Should return a list of bookmarks") {
      ...
    }
    // More its...
  }
}


The problem:

When I clean out my class files (ant target called "clean-all"), recompile, and run the ScalaTest tests all 62 tests (the "it"s above) execute fine. When I make a change (don't do a clean), recompile and rerun the tests a full 124 tests run: each of the tests is run twice. To clarify: my test run fine after a clean-all, but the tests are executed twice if I don't do a clean-all before the compilation.

I run my tests via an IntelliJ ScalaTest Run/Debug configuration. Some examination reveals that this executes the following after a clean-all and recompile:

[java executable] [-D options] -classpath [long classpath] com.intellij.rt.execution.application.AppMain org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s [ScalaTest classes] -r org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter

But after a recompile (without a clean-all) the following gets executed:

[java executable] [-D options] -classpath [long classpath] com.intellij.rt.execution.application.AppMain org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s [ScalaTest classes] [ScalaTest classes] -r org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter

In other words, exactly the same commandline is executed, except this time the test classes (after the -s) are listed twice. This explains why the tests are each run twice. But why on earth are they listed twice? Where does that come from?

FYI, the full commandlines are below.

Many thanks in advance for any guidance.
Nik


-- after clean

"C:\Program Files\Java\jdk1.6.0_20\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 10.5.2\bin" -Dfile.encoding=windows-1252 -classpath "C:\Documents and Settings\Nik\.IntelliJIdea10\config\plugins\Scala\lib\scala-plugin-runners.jar;C:\Program Files\Scala\scala-2.8.0\lib\jline.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-compiler.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-dbc.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-library.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-swing.jar;C:\Program Files\Scala\scala-2.8.0\lib\scalap.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-swing.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-core-1.1.5.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/charsets.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-jsp_2.1_spec-1.0.1.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/javaws.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-jsr107cache-1.3.5.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/build/scalatest-1.2.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/build/servlet.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-appengine-1.0.7.final.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/management-agent.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/localedata.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/jdo2-api-2.3-eb.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/deploy.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/plugin.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-el_1.0_spec-1.0.1.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/geronimo-jpa_3.0_spec-1.1.1.jar;C:/Program Files/Java/servletapi2_1_1/servlet.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-servlet_2.5_spec-1.2.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/geronimo-jta_1.1_spec-1.1.1.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/out.unenhanced;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/runtime/tagsoup-1.2.jar;C:/Program Files/Scala/scala-2.8.0/lib/scalap.jar;C:/Program Files/Scala/scala-2.8.0/lib/jline.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/jsr107cache-1.1.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunpkcs11.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/jsse.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/alt-rt.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/resources.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-jpa-1.1.5.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-library.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/runtime/twitter4j-core-2.1.3.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunmscapi.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-api-labs-1.3.5.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/jce.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/rt.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunjce_provider.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-api-1.0-sdk-1.3.5.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/appengine-local-runtime-shared.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-dbc.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-compiler.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/dnsns.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 10.5.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s org.pigsaw.wharfinger.DeliciousNetworkHandlerTest org.pigsaw.wharfinger.DocumentMakerTest org.pigsaw.wharfinger.HtmlNodeTest org.pigsaw.wharfinger.HtmlTest org.pigsaw.wharfinger.InstapaperHandlerTest org.pigsaw.wharfinger.TwitterTimesNetworkHandlerTest org.pigsaw.wharfinger.TwitterTimesBookmarkTest org.pigsaw.wharfinger.URLStringTest -r org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter


--- without a clean

"C:\Program Files\Java\jdk1.6.0_20\bin\java" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 10.5.2\bin" -Dfile.encoding=windows-1252 -classpath "C:\Documents and Settings\Nik\.IntelliJIdea10\config\plugins\Scala\lib\scala-plugin-runners.jar;C:\Program Files\Scala\scala-2.8.0\lib\jline.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-compiler.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-dbc.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-library.jar;C:\Program Files\Scala\scala-2.8.0\lib\scala-swing.jar;C:\Program Files\Scala\scala-2.8.0\lib\scalap.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-swing.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-core-1.1.5.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/charsets.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-jsp_2.1_spec-1.0.1.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/javaws.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-jsr107cache-1.3.5.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/build/scalatest-1.2.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/build/servlet.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-appengine-1.0.7.final.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/management-agent.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/localedata.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/jdo2-api-2.3-eb.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/deploy.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/plugin.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-el_1.0_spec-1.0.1.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/geronimo-jpa_3.0_spec-1.1.1.jar;C:/Program Files/Java/servletapi2_1_1/servlet.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/geronimo-servlet_2.5_spec-1.2.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/geronimo-jta_1.1_spec-1.1.1.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/out.unenhanced;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/runtime/tagsoup-1.2.jar;C:/Program Files/Scala/scala-2.8.0/lib/scalap.jar;C:/Program Files/Scala/scala-2.8.0/lib/jline.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/jsr107cache-1.1.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunpkcs11.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/jsse.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/alt-rt.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/resources.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/orm/datanucleus-jpa-1.1.5.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-library.jar;C:/Documents and Settings/Nik/IdeaProjects/Wharfinger Courier/lib/runtime/twitter4j-core-2.1.3.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunmscapi.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-api-labs-1.3.5.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/jce.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/rt.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/sunjce_provider.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/user/appengine-api-1.0-sdk-1.3.5.jar;C:/Program Files/Google/appengine-java-sdk-1.3.5/lib/shared/appengine-local-runtime-shared.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-dbc.jar;C:/Program Files/Scala/scala-2.8.0/lib/scala-compiler.jar;C:/Program Files/Java/jdk1.6.0_20/jre/lib/ext/dnsns.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 10.5.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s org.pigsaw.wharfinger.DeliciousNetworkHandlerTest org.pigsaw.wharfinger.DocumentMakerTest org.pigsaw.wharfinger.HtmlNodeTest org.pigsaw.wharfinger.HtmlTest org.pigsaw.wharfinger.InstapaperHandlerTest org.pigsaw.wharfinger.TwitterTimesNetworkHandlerTest org.pigsaw.wharfinger.TwitterTimesBookmarkTest org.pigsaw.wharfinger.URLStringTest org.pigsaw.wharfinger.TwitterTimesNetworkHandlerTest org.pigsaw.wharfinger.HtmlNodeTest org.pigsaw.wharfinger.DeliciousNetworkHandlerTest org.pigsaw.wharfinger.DocumentMakerTest org.pigsaw.wharfinger.TwitterTimesBookmarkTest org.pigsaw.wharfinger.InstapaperHandlerTest org.pigsaw.wharfinger.HtmlTest org.pigsaw.wharfinger.URLStringTest -r org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter

-- ends

2 comments
Comment actions Permalink

Thank you for the report. I'll check this strange behaviour as soon as possible. You can watch/vote on progress http://youtrack.jetbrains.net/issue/SCL-3687

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Should be fixed now.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.