Skip to content

coverage resets a manually set scalaVersion #146

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

Closed
fthomas opened this issue Oct 15, 2015 · 7 comments
Closed

coverage resets a manually set scalaVersion #146

fthomas opened this issue Oct 15, 2015 · 7 comments

Comments

@fthomas
Copy link

fthomas commented Oct 15, 2015

With sbt-scoverage 1.3.3 this happens in my project:

> ++2.10.6
[info] Setting version to 2.10.6
[info] Reapplying settings...
[info] Set current project to refined (in build file:/home/frank/data/code/refined/)
> refinedJVM/scalaVersion
[info] 2.10.6
> coverage
[info] Set current project to refined (in build file:/home/frank/data/code/refined/)
> refinedJVM/scalaVersion
[info] 2.11.7

Calling coverage should not change scalaVersion. I first noticed this issue here fthomas/refined#72.

@rorygraves
Copy link
Contributor

Ouch thats nasty.
My sbt foo is a bit weak, the only client code executed is this

  private def toggleCoverage(status:Boolean): State => State = { state =>
    val extracted = Project.extract(state)
    val newSettings = extracted.structure.allProjectRefs map { proj =>
      coverageEnabled in proj := status
    }
    extracted.append(newSettings, state)
  }

Which is setting the coverageEnabled flag for each project to true. I'm guessing there is a misunderstanding of how/what this code is doing.

@fommil
Copy link

fommil commented Apr 8, 2016

I understand scala 2.10 support was dropped in scoverage.

@sksamuel
Copy link
Member

sksamuel commented Apr 8, 2016

Yes it was (was always patchy due to range position stuff).

On 8 April 2016 at 07:40, Sam Halliday notifications@github.com wrote:

I understand scala 2.10 support was dropped in scoverage.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#146 (comment)

@fthomas
Copy link
Author

fthomas commented Apr 9, 2016

This issue is unrelated to the dropped 2.10 support:

> ++2.11.7
[info] Setting version to 2.11.7
[info] Reapplying settings...
[info] Set current project to refined (in build file:/home/frank/data/code/refined/)
> coreJVM/scalaVersion
[info] 2.11.7
> coverage
[info] Set current project to refined (in build file:/home/frank/data/code/refined/)
> coreJVM/scalaVersion
[info] 2.11.8

Just tested this with version 1.3.5.

finaglehelper pushed a commit to twitter/util that referenced this issue Jun 7, 2016
Problem

This commit causes downstream projects to fail as the autoplugin
mechanism for the scoverage plugin is wreaking havoc when downstream
projects: ostrich, scrooge and finatra try to run their tests.
FileNotFoundExceptions are generated (the scoverage Invoker is getting
run during tests which fails due to no coverage data being available at
that time). An example failure:
https://s3.amazonaws.com/archive.travis-ci.org/jobs/135689956/log.txt

Additionally upgrading to scoverage plugin version 1.3.5 does not work
with TravisCI because of these issues:
scoverage/sbt-scoverage#161
scoverage/sbt-scoverage#146

Which caused us to back out of upgrading to scoverage 1.3.5 previously.

The odd thing is that util built fine with these changes, unfortunately
the downstream projects did not.

Solution

Revert commit, RB 837525 and update the .travis.yml.

Result

Downstream projects no longer fail to build.

RB_ID=839869
mtrampont pushed a commit to mtrampont/sbt-scoverage that referenced this issue Jul 12, 2016
rayrobdod added a commit to rayrobdod/json that referenced this issue Aug 19, 2016
See scoverage/sbt-scoverage#146
   (coverage resets a manually set scalaVersion)
@travisbrown
Copy link
Contributor

This is fixed in 1.4.0, right?

@gslowikowski
Copy link
Member

Right.

@gslowikowski
Copy link
Member

Fixed by #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants