getting code coverage of compiled java code with scala tests

268 views
Skip to first unread message

J Knurek

unread,
Jan 7, 2015, 7:15:51 PM1/7/15
to scalate...@googlegroups.com

I've been trying to figure out how to get code coverage of the unit & integration tests. The tests are mostly written in Scala (there's a few java unit tests) and the application is written mostly in Java (there's a few Scala files).

I tried Clover, but (at this time) it doesn't support scala.

I tried Jacoco. First I ran into problems getting any results due to the mutli-module configuration of  the project, but now using Sonar I've got the java coverage shown (thanks to http://www.aheritier.net/maven-failsafe-sonar-and-jacoco-are-in-a-boat/). I used timezra (http://timezra.blogspot.com/2013/10/jacoco-and-scala.html) with jacoco, but that only analyzed the small bit of source code that is in Scala.

I tried Scoverage, but that also has the same problem as timezra (it analyzes scala-to-scala, but not the mix that I have). 

J Knurek

unread,
Jan 16, 2015, 2:26:22 PM1/16/15
to scalate...@googlegroups.com
To answer my own question:
Jacoco does analyze coverage for Scala tests and Java code. I haven't seen anything that does the opposite (but I don't have any Java tests for Scala code, so that didn't matter).
Reply all
Reply to author
Forward
0 new messages