mtkopone / scct Goto Github PK
View Code? Open in Web Editor NEWScala Code Coverage Tool
Home Page: http://mtkopone.github.com/scct/
License: Apache License 2.0
Scala Code Coverage Tool
Home Page: http://mtkopone.github.com/scct/
License: Apache License 2.0
Scct cannot find source files when running as a part of a multi-module maven build.
When maven does the compilation, the current working directory is project root. However when tests are run the current working directory is module root. As a result source files cannot be found during report generation.
The location of source files stored in coverage.dat is relative to the current working directory. This also causes problems if maven build is invoked from another directory e.g. mvn -f somefolder/pom.xml. Ideally location should be relative to the module root. I am not sure if there is a way to identify module root though.
I have got a fix where during reporting phase relative paths are adjusted to be relative to the module root. However this would not fix an issue when the build is run from a different directory altogether. Perhaps a better approach could be storing absolute paths in coverage.dat. Pull request to follow.
Hi,
scct is a great work. It's pretty useful. But I would like to ask you an important favor.
By default, "reaktor" %% "scct" is in Compile implicitly. But library authors don't except the behavior. This dependency will make library users confusing.
Is it possible to change the default scope to provided
or test
? Now I'm specifying scct's scope explicitly as follows. But the default behavior is a pitfall for library authors.
"reaktor" %% "scct" % "0.2-SNAPSHOT" % "test"
Of course, it's best if I could send a pull request. But I've not figured out the implementation yet... I'm truly grateful for your consideration. Just writing about this issue on the usage document might be enough.
Best Regards,
-seratch
Hi, would it be possible to upload the artifact checksums to the maven repo ?
Code to be tested:
object Test {
def collect(x: String): String = x.collect {
case 'a' => 'a'
}
def collect(x: List[String]): List[String] = x.collect {
case "a" => "a"
}
def collectFirst(x: String): Option[Char] = x.collectFirst {
case 'a' => 'a'
}
def collect12(x: List[Int]): List[Int] = x.collect {
case 1 => 0
case 2 => 0
}
def collectFruits(x: List[Symbol]): List[String] = x.collect {
case 'apple => "apple"
case 'banana => "banana"
}
def collectInt(x: List[Any]): List[Int] = x.collect {
case i: Int => i
}
def collectSome(x: List[Option[String]]): List[String] = x.collect {
case Some(s: String) => s
}
}
Specs2 tests:
class TestSpec extends org.specs2.mutable.Specification {
"collect 'a' characters" in {
Test.collect("abcadef") must_== "aa"
}
"collect \"a\" strings" in {
Test.collect(List("a", "b", "c", "a", "d", "e", "f")) must_== List("a", "a")
}
"collect first 'a' character" in {
Test.collectFirst("xyzabca") must_== Some('a')
}
"collect integers 1 and 2" in {
Test.collect12(List(1, 5, 34, 2, 7, 80, 0, -12, 1, 6, 1)) must_== List(0, 0, 0, 0)
}
"collect fruits" in {
Test.collectFruits(List('cat, 'apple, 'banana, 'monkey, 'apple)) must_== List("apple", "banana", "apple")
}
"collect integers" in {
Test.collectInt(List("foo", "bar", 123, 12.3, None, "xyz", 64)) must_== List(123, 64)
}
"collect defined strings" in {
Test.collectSome(List(None, Some("foo"), None, None, Some("bar"))) must_== List("foo", "bar")
}
}
Tests are successful so all cases are expected to be covered:
test> scct:test
[info] Compiling 1 Scala source to /Users/balagez/Sites/test/target/scala-2.9.1/scct-classes...
[info] Compiling 1 Scala source to /Users/balagez/Sites/test/target/scala-2.9.1/classes...
scct: [test] Saving coverage data.
[info] Compiling 1 Scala source to /Users/balagez/Sites/test/target/scala-2.9.1/scct-test-classes...
[info] TestSpec
[info]
[info] + collect 'a' characters
[info] + collect "a" strings
[info] + collect first 'a' character
[info] + collect integers 1 and 2
[info] + collect fruits
[info] + collect integers
[info] + collect defined strings
[info]
[info] Total for specification TestSpec
[info] Finished in 203 ms
[info] 7 examples, 0 failure, 0 error
[info]
[info] Passed: : Total 7, Failed 0, Errors 0, Passed 7, Skipped 0
scct: [test] Generating coverage report.
Still, in coverage report, lines where literals were used do define the domain of the partial functions are red:
http://cl.ly/image/0a0H272v0846
Environment:
Thanks!
Not tested method firstServeAvgPct() for the code below.
package dk.atp.api
import AtpWorldTourApi._
/**
* API interface for atpworldtour.com tennis statistics.
*
*/
object AtpWorldTourApi {
object PointWonFactEnum extends Enumeration {
type PointWonFactEnum = Value
val FIRST_SERVE_POINTS_WON = Value("2")
val SECOND_SERVE_POINTS_WON = Value("3")
val FIRST_SERVE_RETURN_POINTS_WON = Value("6")
val SECOND_SERVE_RETURN_POINTS_WON = Value("7")
override def toString() = PointWonFactEnum.values.mkString("MatchfactEnum [", ", ", "]")
}
object SurfaceEnum extends Enumeration {
type SurfaceEnum = Value
val CLAY = Value(1)
val GRASS = Value(2)
val HARD = Value(3)
override def toString() = SurfaceEnum.values.mkString("SurfaceEnum [", ", ", "]")
}
/**
* @param rank
* @param fullName
* @param pctWon Percentage of first serve won
* @param matches Total number of matches
*
*/
case class FirstServeFact(rank:Int,fullName: String, pctWon: Double, matches: Int)
case class FirstServeFacts(playerFacts: List[FirstServeFact]) {
def firstServeAvgPct() = playerFacts.foldLeft(0d)((sum,fact) => sum + fact.pctWon) / playerFacts.size
}
/**
* @param fullName
* @param pointsWon Number of points won
* @param totalPoints Total number of points
* @param pctWon Percentage of matches won
* @param matches Total number of matches
*/
case class PointWonFact(fullName: String, pointsWon: Int, totalPoints: Int, pctWon: Double, matches: Int)
case class PointWonFacts(playerFacts: List[PointWonFact])
}
import AtpWorldTourApi.PointWonFactEnum._
import AtpWorldTourApi.SurfaceEnum._
trait AtpWorldTourApi {
/**Match facts statistics http://www.atpworldtour.com/Matchfacts/Matchfacts-Landing.aspx*/
def firstServeFacts(surface: SurfaceEnum, year: Int): FirstServeFacts
/**Match facts statistics http://www.atpworldtour.com/Matchfacts/Matchfacts-Landing.aspx*/
def pointWonFacts(pointWonFact: PointWonFactEnum, surface: SurfaceEnum, year: Int): PointWonFacts
}
pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- Project information -->
<modelVersion>4.0.0</modelVersion>
<groupId>dk.atp</groupId>
<artifactId>atpworldtour-api</artifactId>
<name>atpworldtour-api</name>
<version>0.1-SNAPSHOT</version>
<inceptionYear>2011</inceptionYear>
<url>https://github.com/danielkorzekwa/atpworldtour-api</url>
<!-- Properties -->
<properties>
<scala.version>2.9.1</scala.version>
<junit.version>4.4</junit.version>
</properties>
<!-- Repositories -->
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/scala</directory>
<includes>
<include>**/*.scala</include>
</includes>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/scala</directory>
<includes>
<include>**/*.scala</include>
</includes>
</testResource>
<testResource>
<filtering>false</filtering>
<directory>src/test/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<buildcommands>
<buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
</buildcommands>
<additionalProjectnatures>
<projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
</additionalProjectnatures>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
<classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
</classpathContainers>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.13.1</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>coverage</id>
<repositories>
<repository>
<id>scct repository</id>
<url>http://mtkopone.github.com/scct/maven-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>reaktor</groupId>
<artifactId>scct_2.9.1</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<systemPropertyVariables>
<scct.project.name>${project.name}</scct.project.name>
<scct.coverage.file>${project.build.outputDirectory}/coverage.data</scct.coverage.file>
<scct.report.dir>${project.build.directory}/coverage-report</scct.report.dir>
<scct.source.dir>${project.build.sourceDirectory}</scct.source.dir>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<configuration>
<compilerPlugins>
<compilerPlugin>
<groupId>reaktor</groupId>
<artifactId>scct_2.9.1</artifactId>
<version>0.1-SNAPSHOT</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- Dependency management -->
<dependencies>
<!-- External dependencies -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.6.1</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
A Gradle plugin would be a great addition to the Maven and SBT ones currently available. It would be nice if it was native, but as Gradle can run Ant tasks easily that would be fine instead. I think that the amount of effort is relatively low when I looked at the complexity of the Maven plugin.
In the screen shot, some lines in the initializer for the object and some are not. This can't be possible, right?
I think it would be nice if there was a way to run the tool in a multi-module project so that the coverage was computed for all the tests in all the modules instead of a per module basis. This would allow one to check the test coverage including integration tests, which is also useful.
Any idea what is causing this? Or am I simply not using maven plug-ins correctly?
Source file src\main\scala\Sum.scala that contains:
object Sum { def main(args: Array[String]) { try { val elems = args map Integer.parseInt println("The sum of my arguments is: " + elems.foldRight(0) (_ + _)) } catch { case e: NumberFormatException => println("Usage: scala Sum ... ") } } }
Test file src\test\scala\SumTest.scala with empty test:
import org.junit.Test import org.scalatest.FunSuite import org.scalatest.matchers.ShouldMatchers import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class SumTest extends FunSuite with ShouldMatchers { test("Nothing") { } }
And the pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>coverage</groupId> <artifactId>coverage</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <encoding>UTF-8</encoding> <scala.version>2.9.0-1</scala.version> </properties> <repositories> <repository> <id>scala-tools.org</id> <name>Scala-Tools Maven2 Repository</name> <url>http://scala-tools.org/repo-releases</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>scala-tools.org</id> <name>Scala-Tools Maven2 Repository</name> <url>http://scala-tools.org/repo-releases</url> </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.scalatest</groupId> <artifactId>scalatest_2.9.0</artifactId> <version>1.6.1</version> <scope>test</scope> </dependency> </dependencies> <build> <sourceDirectory>src/main/scala</sourceDirectory> <testSourceDirectory>src/test/scala</testSourceDirectory> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version> <executions> <execution> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.9</version> <configuration> <useFile>false</useFile> <disableXmlReport>true</disableXmlReport> <includes> <include>**/*Test.*</include> <include>**/*Suite.*</include> </includes> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>scct</id> <repositories> <repository> <id>scct repository</id> <url>http://mtkopone.github.com/scct/maven-repo</url> </repository> </repositories> <dependencies> <dependency> <groupId>reaktor</groupId> <artifactId>scct_${scala.version}</artifactId> <version>0.1-SNAPSHOT</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.14.2</version> <inherited>true</inherited> <configuration> <compilerPlugins> <compilerPlugin> <groupId>reaktor</groupId> <artifactId>scct_${scala.version}</artifactId> <version>0.1-SNAPSHOT</version> </compilerPlugin> </compilerPlugins> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.9</version> <inherited>true</inherited> <configuration> <systemPropertyVariables> <scct.project.name>${project.name}</scct.project.name> <scct.coverage.file>${project.build.outputDirectory}/coverage.data</scct.coverage.file> <scct.report.dir>${project.build.directory}/coverage-report</scct.report.dir> <scct.source.dir>${project.build.sourceDirectory}</scct.source.dir> </systemPropertyVariables> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>
Hi Mikko,
I am using scct with sbt 0.10.1 + https://github.com/dvc94ch/sbt-scct and getting following warnings in coverage:compile, what could be the cause?
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/se.scalablesolutions.akka/akka-actor/jars/akka-actor-1.1.3.jar
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/se.scalablesolutions.akka/akka-http/jars/akka-http-1.1.3.jar
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.4.jar
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/javax.ws.rs/jsr311-api/jars/jsr311-api-1.1.jar
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/javax.annotation/jsr250-api/jars/jsr250-api-1.0.jar
Warning: could not load descriptor for plugin /home/jestan/.ivy2/cache/se.scalablesolutions.akka/akka-testkit/jars/akka-testkit-1.1.3.jar
scct: Saving coverage data.
When trying to generate the coverage for my new (unreleased) specs2 library, the process hangs. Then when I ctrl-C the process, it generates all the files at the root of the project with partial totals for the coverage.
You can access a snapshot of the library here: http://specs.googlecode.com/svn/docs/specs2.zip
I have a class that looks like this:
package object pimps {
implicit class AtomicReferencePimps[T](val ar: AtomicReference[T]) {
def transform(f: T => T) {
var oldV: Option[T] = None
var newV: Option[T] = None
do {
oldV = Some(ar.get)
newV = Some(f(oldV.get))
} while(!ar.compareAndSet(oldV.get, newV.get))
}
}
}
However, even though I use the class in one of the tests, scct still reports no coverage on the contructor ((val ar: AtomicReference[T])
). Making it a regular class (removing the AnyVal
subclassing) fixes this issue.
after the commits on october 4th, my project will no longer build at the top level from maven. The build fails when coverage is being recorded in a sub-module that is exercising classes from another module that has been built with scct. In other words, I have a maven project with two modules, A and B. B depends on A. I run a maven build for the entire project, first A builds, then B builds. A's coverage reporting works fine. B's coverage reporting fails when B is using a class in A. It appears to be trying to track coverage in A while exercising B, which would be fine but the indexing into the counters array is now off. Prior to October 4th, the multi-project build worked fine.
java.lang.ArrayIndexOutOfBoundsException: 1202
at reaktor.scct.Coverage$.invoked(Coverage.scala:25)
Now I use scct 0.2-SNAPSHOT with Scala 2.9.1. Of course, I understand it is snapshot version and
its risk. Recently, you changed scalaVersion to "2.10.0.-RC3" in build.sbt.
Since Scala doesn't have binary compatibility between major version, if you publish scct without changing its version and with updating scalaVersion in build.sbt, it confuses and breaks my build (probably, other users). If you put tag before updating scalaVersion, it's not problematic.
Then, if you don't mind, please put tag (e.g. 0.2-M1) before updateing scalaVersion. If tagging is painful for you, I woule like to contribute since I think scct is useful and now use it.
When using sbt 0.7.5 and starting up sbt, I get this:
[info] Recompiling plugin...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[error] /Users/leo/Documents/workspace/foursquare.web/project/plugins/src_managed/sbt-scct-for-2.8-0.1-SNAPSHOT/reaktor/scct/ScctProject.scala:41: overloaded method value apply with alternatives ((java.lang.ClassLoader) => Option[String])ScctProject.this.TestSetup (() => Option[String])ScctProject.this.TestSetup cannot be applied to (object None)
[error] testOptions ++ Seq(TestSetup(setProps), TestCleanup(reportNow))
[error] ^
[error] /Users/leo/Documents/workspace/foursquare.web/project/plugins/src_managed/sbt-scct-for-2.8-0.1-SNAPSHOT/reaktor/scct/ScctProject.scala:41: overloaded method value apply with alternatives ((java.lang.ClassLoader) => Option[String])ScctProject.this.TestCleanup (() => Option[String])ScctProject.this.TestCleanup cannot be applied to (object None)
[error] testOptions ++ Seq(TestSetup(setProps), TestCleanup(reportNow))
[error] ^
[error] two errors found
Compilation failed
There's a simple fix to get this working again. Will attach a patch.
If dependencies managed using externalPom()
, the plugin does not work:
last common/scct:scalac-options
java.util.NoSuchElementException: next on empty iterator
at scala.collection.Iterator$$anon$3.next(Iterator.scala:27)
at scala.collection.Iterator$$anon$3.next(Iterator.scala:25)
at scala.collection.IndexedSeqLike$Elements.next(IndexedSeqLike.scala:63)
at scala.collection.IterableLike$class.head(IterableLike.scala:90)
at scala.collection.mutable.ArraySeq.scala$collection$IndexedSeqOptimized$$super$head(ArraySeq.scala:45)
at scala.collection.IndexedSeqOptimized$class.head(IndexedSeqOptimized.scala:121)
at scala.collection.mutable.ArraySeq.head(ArraySeq.scala:45)
at ScctPlugin$$anonfun$instrumentSettings$4.apply(ScctPlugin.scala:30)
at ScctPlugin$$anonfun$instrumentSettings$4.apply(ScctPlugin.scala:27)
at sbt.Scoped$$anonfun$hf3$1.apply(Structure.scala:579)
at sbt.Scoped$$anonfun$hf3$1.apply(Structure.scala:579)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
When I use scct
lazy val scctPlugin = "reaktor" % "sbt-scct-for-2.8" % "0.1-SNAPSHOT"
with sbt 0.7.5 with a Scala 2.9.0.RC1 project, it hangs waiting for report completion. The trace is
test-coverage
Setting props for kiama
Generating report for kiama
Wait for report completion.
With the same project and same sbt version selecting Scala 2.8.1 the report is produced very quickly. With 2.9.0.RC1 it appears to be deadlocked. (I've waiting hours, just in case...)
jstack reports the stack of the relevant thread to be:
"Thread-68" prio=5 tid=112c26000 nid=0x10f3c6000 waiting on condition [10f3c5000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at reaktor.scct.ScctProject$class.reportNow(ScctProject.scala:55)
at KiamaProject.reportNow(KiamaProject.scala:30)
at reaktor.scct.ScctProject$$anonfun$instrumentedTestOptions$2.apply(ScctProject.scala:41)
at reaktor.scct.ScctProject$$anonfun$instrumentedTestOptions$2.apply(ScctProject.scala:41)
at sbt.ScalaProject$TestCleanup$$anonfun$apply$7.apply(ScalaProject.scala:78)
at sbt.ScalaProject$TestCleanup$$anonfun$apply$7.apply(ScalaProject.scala:78)
at sbt.TestFramework$$anonfun$createTasks$1$$anonfun$apply$9.apply(TestFramework.scala:166)
at sbt.TestFramework$$anonfun$createTasks$1$$anonfun$apply$9.apply(TestFramework.scala:166)
at sbt.NamedTestTask.run(TestFramework.scala:92)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:193)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:193)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
Hi,
I have an sbt(0.12) project with scala 2.10.1
SCCT generates reports perfectly with this. But it generates these reports in the root of my project, and not in the target/scala-2.10.1/coverage-report folder.
Tried setting cross target and possibly everything i could think of.
Is there something I am missing?
When we run tests for Scala 2.9.3, it fails because scct_2.9.3
has not been deployed.
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: reaktor#scct_2.9.3;0.2-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Please deploy scct for 2.9.3 too.
I'm seeing the following in my coverage report:
11 def interpolate(sep: String)(list: List[Array[Byte]]): List[Array[Byte]] = list match {
*12* case Nil => List*()*
13 case List(x) => List(x)
14 case h :: t => h :: sep.getBytes() :: interpolate(sep)(t)
15 }
Line 12 has the parens in red (I guess because the function is never called with an empty list). Of course every call to this function involves this line, because it's the base case of the recursion.
I'd normally submit a patch but can't do so easily from where I am right now, so for now I'll just report the bug.
In https://github.com/mtkopone/scct/blob/master/src/main/scala/reaktor/scct/ScctInstrumentPlugin.scala#L238, you call .source on the position. It looks like for some reason, someone decided in the scala compiler that using Option on source was too much bother (without updating the comment), so converted .source to return a value or throw an exception by default. The contract now appears to check that .isDefined is true on the position before calling .source on it. I have no clue why someone would drop compiler-guaranteed safety in favor of behavior like this that developers might miss (especially when the documentation is wrong) as indeed happened in scct.
Anyway, a simple replacement would be just to check .isDefined before calling .source, and emit "" if the source isn't defined.
If I were to guess, the reason I encountered this is due to another compiler plugin I'm using that is inserting code programmatically. Presumably, when scct traverses the generated code, it encounters the autogenerated code that has no corresponding file position, and I get a nice NotImplementedException during compilation.
For reference, the scalac commit in question is scala/scala@db045cb#L35L26
Naturally SBT cannot find a build for Scala 2.10. Tried using:
addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT" from "http://mtkopone.github.com/scct/maven-repo/reaktor/sbt-scct_2.9.2_0.12/0.2-SNAPSHOT")
This seems to work but including the settings doesn't.
error: not found: value ScctPlugin seq(ScctPlugin.instrumentSettings : _*)
Any help would be appreciated.
Until recently, I was resolving scct without problems, but this has stopped working. I see that you recently removed Scala 2.9 build options, but not sure whether this would have propagated to the repo.
Using sbt 0.12.0
I have the following in my project/build.sbt:
resolvers += Classpaths.typesafeResolver
resolvers += "scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"
addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")
Build ends up failing:
[info] Resolving reaktor#scct_2.9.2;0.2-SNAPSHOT ...
[warn] module not found: reaktor#scct_2.9.2;0.2-SNAPSHOT
[warn] ==== local: tried
[warn] /Users/jamie/.ivy2/local/reaktor/scct_2.9.2/0.2-SNAPSHOT/ivys/ivy.xml
[warn] ==== scct-repository: tried
[warn] file:///Users/mtkopone/dev/scct-root/gh-pages/maven-repo/reaktor/scct_2.9.2/0.2-SNAPSHOT/scct_2.9.2-0.2-SNAPSHOT.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/reaktor/scct_2.9.2/0.2-SNAPSHOT/scct_2.9.2-0.2-SNAPSHOT.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: reaktor#scct_2.9.2;0.2-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: reaktor#scct_2.9.2;0.2-SNAPSHOT: not found
...
When you declare something as "final val" without type, such as "final val x = 5", then the compiler will inline those as constants. However, getters are still generated, and SCCT marks them as not tested.
I am using scct with sbt-scct plugin(https://github.com/dvc94ch/sbt-scct, sbt 0.11.2 scala 2.9.1) and getting compile errors in 'sbt coverage:compile' for use of classes inside a package object , but 'sbt compile' completes without any compile errors.
Below sample code explains what I am trying to do.
//in file com/xyz/x1/common.scala
package com.xyz.x1
package object common {
case class Person()
}
//somewhere in the code base
import com.xyz.x1.common._
object myRequestVar extends RequestVar[Person](Person())
//sbt coverage:compile error output
[error] found : com.xyz.x1.package.com.xyz.x1.Person
[error] required: com.xyz.x1.package.(some other)com.xyz.x1.Person
[error] object myRequestVar extends RequestVar[Person](Person())
is it something to do with scct compiler plugin or in sbt 0.11.2 ?
same result with https://github.com/quelgar/sbt-scct/
Classes, traits and objects without concrete methods show up with 0% code coverage. I don't think that's mathematically correct (!code.exists(!.covered) == code.forall(.covered)), but, much worse than that, it distracts while looking over what's covered.
Subject line changed from : A line is green even though not all branches covered
Hi,
Given this code:
Object User {
def f = Full[Int](1) openOr 0
}
and this test:
class blah extends FunSpec {
describe("my test") {
it("blah") {
assert(User.f === 1)
}
}
The scct report gives a green line for f
even though the openOr
branch hasn't been covered.
Is that intended behaviour?
When using (x : @unchecked) match { ... } the default Scala compiler properly ignores any missing matches it can infer. However, when running scct:test the unchecked warning is shown again.
Based on sbt 0.12.0 and scala 2.9.2.
I tried to produce report covering tests for Apache ESME project: http://esme.apache.org/. It is built with Scala 2.8.1 and SBT 0.7.4. The problem is that after clean and test-coverage commands have been run (it has taken relativly long time for me btw) file ./target/scala_2.8.0/coverage-report/index.html isn't produced it all (while artifacts in other coverage-* folders were generated). How do you think, what the reason of this problem is? Do you need some example to see results?
When I turn coverage on for my Maven module, when the Surefire phase kicks off, all of the tests fail with this error:
java.lang.NoClassDefFoundError: Could not initialize class reaktor.scct.Coverage$
which occurs in the constructor of each test class. I've tried putting the reaktor.scct_2.8.0 dependency onto the compile time scope, but this doesn't seem to help.
Is this a known issue?
Hello,
I'm using your library with Play 2.1.1 and finding it better than JaCoCo. Thank you for creating it. I have a couple of issues which I hope you can help me with.
val main = play.Project(appName, appVersion, appDependencies, settings = scctSettings).settings(
javaOptions in Test += "-Dconfig.file=conf/test.conf",
testOptions in Test := Nil
)
It works when I do "play test" or "play test-only" but it doesn't work when I do "scct:test". Is there any way to make it work?
Sorry if the the answers to these questions are a little obvious. I'm new to Scala. Play and SCCT :)
Thanks!
16:34:05,771 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:34:05,771 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:34:05,772 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logback.xml]
16:34:05,796 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2691d0cf - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logback.xml] is not of type file
16:34:06,552 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:06,554 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:06,577 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:06,633 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,168 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:07,168 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:07,170 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:07,173 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@2f23d9d1 - Registering current configuration as safe fallback point
16:34:07,322 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@5ab14084 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:07,322 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2b02c8a0 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:07,322 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@43c1966f - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:07,322 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@43c1966f - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:07,325 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:07,326 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:07,326 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:07,328 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:07,332 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,332 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:07,333 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:07,333 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:07,334 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:07,335 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:07,335 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:07,336 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:07,336 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:07,336 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5a7b7429 - Registering current configuration as safe fallback point
16:34:07,336 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:07,336 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:07,336 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:07,336 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:07,337 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,339 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:07,339 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:07,339 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:07,339 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,339 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:07,340 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:07,340 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:07,340 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:07,340 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:07,341 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:07,341 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:07,341 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:07,341 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:07,341 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:07,341 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:07,341 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:07,341 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:07,341 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5f075e27 - Registering current configuration as safe fallback point
16:34:07,341 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:07,342 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,344 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:07,344 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:07,344 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:07,344 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,345 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:07,345 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:07,345 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:07,346 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5cb6832e - Registering current configuration as safe fallback point
16:34:07,346 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,352 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:07,352 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:07,353 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:07,353 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:07,354 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:07,354 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:07,354 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@525e708f - Registering current configuration as safe fallback point
16:34:08,340 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@362fe688 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:08,343 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:08,343 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:08,343 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:08,343 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:08,344 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:08,345 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:08,345 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:08,345 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:08,345 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:08,346 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:08,346 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:08,346 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:08,347 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:08,347 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@2c80683 - Registering current configuration as safe fallback point
16:34:10,207 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@1a2383e2 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:10,207 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@11a777d6 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:10,210 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:10,210 |-WARN in Logger[com.jolbox.bonecp.BoneCPDataSource] - No appenders present in context [default] for logger [com.jolbox.bonecp.BoneCPDataSource].
16:34:10,210 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:10,210 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:10,210 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:10,210 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,211 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:10,211 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:10,211 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:10,211 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:10,212 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:10,212 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:10,212 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@9ac8ba8 - Registering current configuration as safe fallback point
16:34:10,212 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:10,212 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:10,212 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:10,213 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@1f04c78e - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:10,213 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,214 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:10,214 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:10,214 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:10,214 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,214 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:10,214 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:10,214 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:10,214 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:10,215 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:10,215 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@72c94b8a - Registering current configuration as safe fallback point
16:34:10,215 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:10,216 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:10,216 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:10,216 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:34:10,217 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,220 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/Users/user/development/workspaces/scala/my-app/./logs/application.log]
16:34:10,220 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:34:10,220 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:34:10,220 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:34:10,221 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@9c987d5 - There is no conversion class registered for conversion word [coloredLevel]
16:34:10,221 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@9c987d5 - [coloredLevel] is not a valid conversion word
16:34:10,221 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@df4b5f8 - URL [jar:file:/Users/user/javastuff/play/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar!/logger.xml] is not of type file
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [play] to INFO
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [application] to DEBUG
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebean.config.PropertyMapLoader] to OFF
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.core.XmlConfigLoader] to OFF
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.avaje.ebeaninternal.server.lib.BackgroundThread] to OFF
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.gargoylesoftware.htmlunit.javascript] to OFF
16:34:10,222 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:34:10,225 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:34:10,225 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:34:10,225 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:34:10,225 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:34:10,225 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word coloredLevel with class [play.api.Logger$ColoredLevel]
16:34:10,225 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
16:34:10,225 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@3cd6b3f0 - Registering current configuration as safe fallback point
16:34:10,225 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
There is a version mismatch between the pom file and the name of the jar that causes the jar not to be found. If modifications to the dependent pom are made to load the version specified in the maven repo, maven then throws and exception stating the metadata for the jar does not match the jar itself. There are also multiple files internal to the jar that state the version of the maven artifact as snapshot, but it is actually named "maven-scct-multiproject-report-0.2-20120802.142325-1.jar" in the maven repo.
Expected naming according to the pom "maven-scct-multiproject-report-0.2-SNAPSHOT.jar".
reaktor.scct
maven-scct-multiproject-report
0.2-SNAPSHOT
Do you plan to do a release for Scala 2.9.1? I image in that there shouldn't be too much change from the 2.9.0-1 version, but who knows?
thanks,
Tony
Any plans?
Thanks a lot
I'm trying to use scct to generate code coverage report for an application using Play framework v2 based on sbt 0.12.0. My tests are written in Java using a sbt testng plugin, and when I run "sbt test", the tests will be executed successfully.
But when I run "sbt scct:test", it compiles successfully, but doesn't generate any code coverage report with a message saying no tests found. Test classes are created under {app_dir}/target/scala-2.9.2/scct-test-classes/
Does scct support play v2 and tests written in java? If so, could you please point me to how to troubleshooting this issue? Thanks!
The new mechanism for tracking code coverage appears to be different for a multi-project build after the most recent changes in October. If project A contains some code that is only used by project B (i.e. not directly tested in project A), the test coverage report does not count code exercised by in A by B in the coverage report.
It's currently using /resources when it should be using the value in Compile. I was forced to add this to get it to work:
resourceDirectory in ScctPlugin.Scct <<= resourceDirectory in Compile
If I run test-coverage without running "clean" first, I usually get very incomplete test coverage reports.
We generate a number of classes in our code base and it would be useful to exclude packages or files from the final code coverage report.
Hi,
Our company are using your cool library everyday, we appreciate to you, thank you.
By the way, would you have any plan to publish it onto Maven Central Repository?
Your library is very useful, so everyone may be more happy, If you could publish it onto central.
Regards,
Takafumi Ikeda
I have a generated .scala file with ~4000 lines (of which ~600 lines are effective in 36 classes) which compiles successfully. HTML report is successfully generated (the resulting file is around 500k) but Cobertura report generation dies with a StackOverflowError:
Exception in thread "Thread-9" java.lang.StackOverflowError
at reaktor.scct.report.CoberturaReporter$$anonfun$2.<init>(CoberturaReporter.scala:48)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:48)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
at reaktor.scct.report.CoberturaReporter.line(CoberturaReporter.scala:55)
...
Environment:
scala 2.9.1
sbt 0.11.3
sbt-scct 0.2-SNAPSHOT
Scct enhances both main and test classes when run from maven. This results in incorect coverage report
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:363)
at reaktor.scct.Env$$anonfun$2.apply(Env.scala:56)
at reaktor.scct.Env$$anonfun$2.apply(Env.scala:56)
at scala.Option.getOrElse(Option.scala:108)
at reaktor.scct.Env.coverageFile(Env.scala:56)
at reaktor.scct.Coverage$.readMetadata(Coverage.scala:41)
at reaktor.scct.Coverage$.init(Coverage.scala:23)
at reaktor.scct.Coverage$.tryInit(Coverage.scala:14)
at reaktor.scct.Coverage$.invoked(Coverage.scala:34)
Apparently, coverage.data is looked for in the generated .jar (projectName-version-scct.jar!/coverage.data) and not in scct-classes directory.
I am using Scala 2.9.1 with sbt 0.11.3 and your own sbt plugin (https://github.com/mtkopone/sbt-scct) on a multi module project and I'm rendered clueless with what to do. I've tried other plugins, with absolutely same result.
Any advice?
Thanks!
OS X 10.8.2, Sbt 0.12, Scct 0.2-SNAPSHOT, Scala 2.10.0-RC5
P.S. scct is great!
When the tests do not cover any code (if tests are just place holders), the report is not generated. The message is this:
scct: Timed out waiting for coverage report.
I tried to start scct-sbt
with scala 2.9.2, sbt 0.12. I put
resolvers += Classpaths.typesafeResolver
resolvers += "scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"
addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")
Resolving was ok - sbt downloaded both scct
and scct-sbt
and they are added to classpath:
[debug] /Users/grrrl/projects/<...>/project/target/scala-2.9.2/sbt-0.12/classes:/Users/grrrl/.ivy2/cache/scala_2.9.2/sbt_0.12/reaktor/sbt-scct/jars/sbt-scct-0.2-SNAPSHOT.jar:/Users/grrrl/.ivy2/cache/reaktor/scct_2.9.2/jars/scct_2.9.2-0.2-SNAPSHOT.jar:
But loading Build.scala fails with "not found" error for class ScctPlugin:
[error] /Users/grrrl/projects/<...>/project/NavyBuild.scala:35: not found: value ScctPlugin
[error] .settings (ScctPlugin.instrumentSettings: _*)
[error] ^
I can't seem to figure out how the following line:
seq(ScctPlugin.instrumentSettings : _*)
Translates to a project that uses Build.scala instead of build.sbt. Do I have to import something?
Thanks
Diego
I have a mixture of ScalaTest unit tests and ScalaMeter performance benchmark tests in my project and I would like scct to only run the unit tests.
Without using scct I can run test-only com.github.theon.*
to run only the unit tests and test-only benchmarks.*
to run the performance benchmark tests. With scct, I can only run scct:test
to run both sets of tests. It would be great to be able to run something like scct:test-only com.github.theon.*
.
Chrome does not consider 2 files in the same directory to be the same site so attempting to load the packages.html and summary.html files fails. If you look at the scala docs they use iframes for this.
It works fine on safari and firefox though so for now I am using those browsers.
As an intermediate step you might want to add a check for the chrome browser and recommend using a different browser.
... instead of under target/scala-2.10
it's a bit of a pain to have to clean up afterwords, but at least I can see the summary.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.