shanbin / sbt-clover

SBT Clover Plugin
Apache License 2.0
1 stars 4 forks source link

[Play framework] No coverage recordings found. #1

Open ivankennethwang opened 8 years ago

ivankennethwang commented 8 years ago
[info] Generating Clover XML and HTML reports
WARN: No coverage recordings found. No report will be generated.
WARN: No coverage recordings found. No report will be generated.

Hi, I use your plugin using sbt clover:clover, but reports are not being generated?

shanbin commented 8 years ago

Can I have a minimal test case to reproduce that?

I'm guessing there might be other plugins tweaking some SBT settings while this clover plugin cannot reliably handle yet.

ivankennethwang commented 8 years ago

If it helps, I'm using a play 2.5.1 project.

plugins.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

resolvers += Resolver.url("Plugins",
  url("http://dl.bintray.com/shanbin/sbt-plugins/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.github.shanbin" %% "sbt-clover" % "0.0.1")

build.sbt

name := "fleet"

version := "1.0"

lazy val root = (project in file(".")).enablePlugins(PlayJava, CloverSbtPlugin)

scalaVersion := "2.11.7"

name := "fleet"

version := "1.0"

lazy val root = (project in file(".")).enablePlugins(PlayJava, CloverSbtPlugin)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  "org.mockito" % "mockito-all" % "1.10.19",
  "org.powermock" % "powermock-api-mockito" % "1.6.4",
  "org.powermock" % "powermock-module-junit4" % "1.6.4",
  "org.assertj" % "assertj-core" % "3.4.0"
)

unmanagedResourceDirectories in Compile <+= baseDirectory(_ / "conf")

unmanagedResourceDirectories in Test <+= baseDirectory(_ / "test" / "resources")

cloverLicensePath in CloverSbtPlugin.cloverConfig := baseDirectory.value.absolutePath + "/.clover/clover.license"

cloverVersion in CloverSbtPlugin.cloverConfig := "4.1.1"

javaSource in Compile in CloverSbtPlugin.cloverConfig := baseDirectory.value / "app"

javaSource in Test in CloverSbtPlugin.cloverConfig := baseDirectory.value / "test"
ivankennethwang commented 8 years ago

@shanbin

Found a partial fix:

Must remove / java because play's structure is different from usual scala projects.

val source = (sourceDirectory in Compile).value
val sourceT = (sourceDirectory in Test).value

Now I am getting some instrumented files and packages.

Processing files at 1.8 source level. Clover all over. Instrumented 20 files (8 packages).

manikuramboyina commented 8 years ago

@shanbin Any update on this issue?

ivankennethwang commented 8 years ago

I think clover:test runs tests coming from original test directory and not from target/scala-2.11/clover/test

shanbin commented 8 years ago

I'll provide a version for Play only as a short term fix.