-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.io.FileNotFoundException: .../build/service/target/scala-2.11/scoverage-data/scoverage.measurements.1 (No such file or directory) #228
Comments
|
finally found time to try this. worked great for me. Thanks! |
I have these two lines in the
I still do see this error, when I build the jar file with assembly. |
@naveencotha-zt provide a simple test project, please. |
@gslowikowski posted it here, with a very simple readme |
@naveencotha-zt don't run Proper calls: sbt clean coverage test coverageReport coverageOff assembly or sbt clean assembly coverage test coverageReport (BTW semicolons are not required when you specify tasks without quotation marks) |
Thanks for the clarification, so if I do something like
|
ad. 1 - your test project contains no tests :) |
Thanks, @gslowikowski, yeah you are right, I don't have any tests in the sample project, although I do have tests in my actual project. |
The `coverageEnabled := true` in `build.sbt` instruments the code unconditionally. The right way to enable coverage is to do `sbt clean coverageOn test coverageReport coverageAggregate` Also it is important to do `sbt clean` after doing the coverage, otherwise the code stay instrumented. The problems to figure out: 1. when instrumented code is included into jar this jar doesn't work on another machine 2. apparently the `sbt clean` is not sufficient and the `target` directories for each subproject need to be removed 3. setting `coverageEnabled := false` and trying to issue `sbt clean coverageOn ...` doesn't produce report files 4. when `sbt ... coverageOn test` is used junit xml test report is not generated 5. we should run eunit tests using coverage as well ``` sbt clean coverageOn make all-tests sbt coverageReport coverageAggregate ``` 6. we need to include mango tests into all-tests target See following - scoverage/sbt-scoverage#84 - scoverage/sbt-scoverage#228 - scoverage/sbt-scoverage#306 - https://github.com/viktortnk/kafka-storm-starter/blob/de6eac4ae635e0e54981a92555de05071c14518a/README.md?plain=1#L340C1-L342C58 - https://github.com/Facsimile/facsimile/blob/409dd67fd291161414401c97d128bf65c0fcc30f/Facsimile.sbt#L458
I am getting the following error when running an assembled jar:
In my build.sbt I do have:
coverageEnabled := true
however when assembling use the following:
sbt -no-colors coverageOff assembly
I am currently using version
1.5.0
:addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
with sbt:
0.13.15
The text was updated successfully, but these errors were encountered: