-
Notifications
You must be signed in to change notification settings - Fork 157
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
FileNotFoundException when using a library published with scoverage enabled #306
Comments
Same problem here unfortunately :( Going to disable scoverage now... |
Same problem. Even if I don't run tests, having |
This is actually expected. You shouldn't ever publish a jar that was created with |
Hey Chris, thanks for clarifying that. Do you know if this is intentional? If not, is there any hope to prevent it? It seems like the scope of coverage should strictly be testing. Having it affect published code is definitely an unexpected, undesireable side-effect for me. |
Yea, it's by design. In order to tell what parts of your code are hit, this sort of has to happen. Apart from putting the instrumented code in a place where it might not be packaged, I'm not sure there is a good way around this. That would require work in both the scalac plugin and also the sbt plugin.
So again, it sort of depends on what you mean by "published code". It doesn't affect published code, but rather affects your compiled code by compiling it with instrumentation. If you decide to publish that code, then sure it has unexpected results, but this shouldn't be done. Maybe we can try to make this clearer. |
Thanks Chris. I'll expand on what I'm trying to do to make this more concrete. The situation is workable, but maybe it'll give someone some ideas for improvement, or maybe someone will point out something obvious that I can improve in my workflow :). I have a custom command called The part I hit issues is after this That leaves room for two problems. The first problems is that if I have The second problem is that I also need to remember to |
Thanks for the explanation @alexklibisz. I get what you mean. I guess still the most important thing for people to know is that the |
Can this be closed? |
IMO, Yes. I think the conclusion is that we should avoid enabling coverage when building and publishing a JAR. |
I think I'm being affected by the same problem, but in my case it's not publishing coverage-enabled jars, but reusing binaries with sbt/zinc remote caching. To run tests in multiple instances, I have a setup where the compilation happens in one instance and the results are published using pushRemoteCache, then in other instances, pullRemoveCache is used to reuse the compilation results. You can even reproduce the issue in a single machine, by running the following commands one after another:
|
I built and published library X, using sbt-scoverage 1.6.1 and following settings:
Now, I'm trying to build library Y without scoverage enabled, but with dependency on X. Travis gives me the following exception:
I think the solution is to disable scoverage during X's publish (at least what I see in simlar #84 and #228), but I just wanted to raise this as a bug, because it feels very confusing that someone can enable a minor enhancement in their lib and crash other's people builds.
Thanks!
The text was updated successfully, but these errors were encountered: