You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've become accustomed to running my ScalaTest unit tests via idea. Then I added the scoverage plugin and ran the tests via sbt from shell and got coverage reports as documented.
Then when I went back to idea to run a single test I got the discussed java.lang.NoClassDefFoundError: scoverage/Invoker$
I tried adding libraryDependencies += "org.scoverage" %% "scalac-scoverage-runtime" % "1.5.1" as suggested in #115 but it didn't work.
I'm putting my relatively clean and simple build.sbt below.
Why does idea need to use this invoker when running a single test via the UI?
Unfortunately Idea runs test on instrumented classes left in target/scala-2.11/classes directory after you run tests with Scoverage. SBT process was properly configured (by coverage task) to run tests with scalac-scoverage-runtime dependency added to classpath.
Idea is not configured and you should not add scalac-scoverage-runtime dependency to the build manually.
To get Scoverage reports, I would call:
sbt coverage test coverageReport coverageOff compile
After recompilation with Scoverage disabled you end up with uninstrumented classes on disk which have no scalac-scoverage-runtime dependency.
Ahh ok. I will try now as suggested. But I thought I tried sbt clean after and still getting the java.lang.NoClassDefFoundError: scoverage/Invoker$ error. Anyhow thanks for the quick response.
I'm not sure how many other people are doing things similar to me, but maybe add this to the readme if it's a common pattern?
I've become accustomed to running my ScalaTest unit tests via idea. Then I added the scoverage plugin and ran the tests via sbt from shell and got coverage reports as documented.
Then when I went back to idea to run a single test I got the discussed java.
lang.NoClassDefFoundError: scoverage/Invoker$
I tried adding
libraryDependencies += "org.scoverage" %% "scalac-scoverage-runtime" % "1.5.1"
as suggested in #115 but it didn't work.I'm putting my relatively clean and simple build.sbt below.
Why does idea need to use this invoker when running a single test via the UI?
The text was updated successfully, but these errors were encountered: