sbt-jacoco
sbt-jacoco copied to clipboard
Conditional Merge of integration test set to false does not appear to be working
I'm having problems getting conditional merge on the intergration tests set to false - I would like to maintain two separate reports.
Our build.sbt looks something like this (a few app specifics removed):
import play.PlayImport._
import play.PlayScala
import de.johoop.jacoco4sbt._
import JacocoPlugin._
name := "my-awesome-app"
scalaVersion := "2.11.2"
unmanagedSourceDirectories in IntegrationTest <<= (baseDirectory in IntegrationTest)(base => Seq(base / "test-integration"))
lazy val root = (project in file(".")).enablePlugins(PlayScala).configs(IntegrationTest).settings(
Defaults.itSettings : _*
)
resolvers ++= Seq(
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/"
)
//----------------------------------------
// Setup Jacoco test coverage.
// Invocation: jacoco:cover
// Results: target/jacoco/html/index.html
// See: https://github.com/sbt/jacoco4sbt
// project/plugins.sbt
//----------------------------------------
jacoco.settings
parallelExecution in jacoco.Config := false
jacoco.outputDirectory in jacoco.Config := file("target/jacoco")
jacoco.reportFormats in jacoco.Config := Seq(XMLReport("utf-8"), ScalaHTMLReport(withBranchCoverage = true))
jacoco.includes in jacoco.Config := Seq("*controllers*", "*actors*", "*helpers*", "*model*")
jacoco.excludes in jacoco.Config := Seq("controllers*routes*", "controllers*Reverse*", "controllers*javascript*", "controllers*ref*")
//
// Integration tests once
//
itJacoco.settings
parallelExecution in itJacoco.Config := false
itJacoco.mergeReports in itJacoco.Config := false
itJacoco.outputDirectory in itJacoco.Config := file("target/it-jacoco")
itJacoco.reportFormats in itJacoco.Config := Seq(XMLReport("utf-8"), ScalaHTMLReport(withBranchCoverage = true))
itJacoco.includes in itJacoco.Config := Seq("*controllers*", "*actors*", "*helpers*", "*model*")
itJacoco.excludes in itJacoco.Config := Seq("controllers*routes*", "controllers*Reverse*", "controllers*javascript*", "controllers*ref*")
Note that I have the mergeReports of the itJacoco configuration turned off.
However, when I run a command such as this:
sbt clean-files clean compile jacoco:cover it-jacoco:cover
all the tests run, but in my output directory of the target/it-jacoco folder I have a jacoco.exec and a jacoco-merged.exec, and the report html files that are built are built from the merged results.
I am using:
- sbt 0.13.6
- jacoco4sbt 2.1.6
- core jacoco of 0.7.1.201405082137
@rmmeans sounds strange, but could you try to set false flag in next way: itJacoco.mergeReports := false, instead of itJacoco.mergeReports in itJacoco.Config := false
I no longer use jacoco, so unless this is of value to someone else, feel free to close.