scoverage is a code coverage tool for scala that offers statement and branch coverage.
Questions tagged [scoverage]
80 questions
3
votes
0 answers
How to generate cobertura report using sbt scoverage
I've a scala app where I use sbt scoverage plugin to generate coverage report.
Now the problem is that I use Jenkins for CI and the generated HTML scoverage report cannot be visualized and this is a known issue.
Alternatively, how I can generate…

bachr
- 5,780
- 12
- 57
- 92
3
votes
1 answer
Can one impose a coverage minimum for combined unit and integration tests?
When I run unit tests for my sbt project (with sbt clean coverage test), I get code coverage of ~77%.
When I run integration tests (sbt clean coverage it:test), I get code coverage of ~10%.
When I run both (sbt clean coverage test it:test), I get…

Sean
- 29,130
- 4
- 80
- 105
3
votes
3 answers
SBT Coverage "exclude" used in Play application
I used the sbt-scoverage for our Play application.
I used the following config to exclude both Reverse and Routes generated file.
coverageExcludedPackages := ";Reverse.;Routes.;"
However this can only exclude generated Reverse scala files and…

ttt
- 3,934
- 8
- 46
- 85
3
votes
1 answer
NoClassDefFoundError running tests in SBT with scoverage plugin
I have an SBT project with structure like here: https://orrsella.com/2014/09/24/integration-and-end-to-end-test-configurations-in-sbt-for-scala-java-projects/. It includes standard main and test directories and additionally it and e2e. There is also…

marc
- 31
- 1
- 2
3
votes
0 answers
Define Travic CI test code coverage with coveralls (scala)
I successfully configured and used Travis CI with combination of Coveralls.io as you can see in the project. Since this is a open-source project I'd love to define 90% test code coverage threshold. Does anyone know how to define such a threshold in…

zmeda
- 2,909
- 9
- 36
- 56
2
votes
1 answer
Excluding tests from coverage report with sbt coverage
I have a test that is non-functional, so I do not want it to affect the coverage report. Other than putting it in a separate project, is there a way to exclude it from the report when running
sbt clean coverage test coverageReport
As it stands, it…

codevineyard
- 23
- 4
2
votes
2 answers
Scala unit-tests in IntelliJ fail with java.lang.NoClassDefFoundError scoverage/Invoker$
Tests run without any problem in sbt, but when you need them in IntelliJ, they fail.
A needed class was not found. This could be due to an error in your runpath.
Missing class: scoverage/Invoker$
java.lang.NoClassDefFoundError: scoverage/Invoker$
I…

Donald Duck
- 476
- 3
- 12
2
votes
1 answer
Compatibility Error When Using Scala SBT with Code Coverage
I have a project in Scala that I'm trying to upgrade the version from Scala 2.12.3 to 2.12.13, but the process fails in my CI pipeline with the following stacktrace:
[error] java.lang.NoSuchMethodError:…

joesan
- 13,963
- 27
- 95
- 232
2
votes
1 answer
How to chain SBT task with multi module project
I have configured one SBT multi-module project with scoverage plugin, which is working fine.
To generate test coverage, I am using > SBT clean coverage test coverageReport but is there any way to create a new task which chains internally coverage…

Kaushal
- 3,237
- 3
- 29
- 48
2
votes
2 answers
Scala/scoverage: Is it necessary to make a clean rebuild for releasing a jar for publishing?
I use scoverage for reporting coverage information for my scala code base. I am kind of new to the Java stack, but I have worked in environments, where a coverage build differed from the release build (by introducing additional information into the…

wirrbel
- 3,173
- 3
- 26
- 49
2
votes
2 answers
Scoverage: enforce 100% branch coverage on "formally infinite" `while(true)` loops
The following simple code snippet contains a while-loop that looks as if it could be infinite:
def findDivisor(n: Int): Int = {
require(n >= 2)
var i = 2
while (true) {
if (n % i == 0) {
return i
} else {
//…

Andrey Tyukin
- 43,673
- 4
- 57
- 93
2
votes
1 answer
Scoverage: contribute code coverage to multiple modules
I have a multimodule maven project on Scala. I want to write an integration test in module A that calls a method XXX of some class from this module. This method in its turn calls a method YYY from some class in another module B.
As a result of…

Boris Parnikel
- 863
- 1
- 7
- 15
2
votes
0 answers
Scala Scoverage - How to generate HTML report?
By default if you configure scoverage plugin into maven project, it generates an XML report.
However, is there any way how to specify that the generated report should be HTML ?
Thanks!
V.

axy3yz
- 131
- 2
- 8
2
votes
1 answer
How to exclude package from scoverage in maven
I am using scoverage-maven-plugin. What settings i need to provide in pom.xml to exclude package from scoverage.

Sangeeta
- 491
- 5
- 22
2
votes
0 answers
sbt-scoverage + specs2 not working; no tests discovered during analysis
I am unable to get sbt-scoverage to discover and analyze our tests. We should have pretty good test coverage (at least 80%); all tests run and pass fine. But the scoverage report shows nearly zero coverage (~ 3%).
The only thing I can think of, is…

Zaphod
- 1,387
- 2
- 17
- 33