Code coverage broken recently #8880

Closed
hughbe opened this Issue May 26, 2016 · 8 comments

Projects

None yet

6 participants

@hughbe
Collaborator
hughbe commented May 26, 2016 edited

Code coverage doesn't seem to be working anymore (I think after dnxcore50 -> netcoreapp1.0).

Steps to reproduce

  • Clone the repo
  • Initialize build tools
  • Navigate to a test project (e.g. System.Collections.NonGeneric)
  • Run msbuild /T:BuildAndTest /P:Coverage=true

Expected

  • ~100% code coverage

Actual

  • 0% code coverage reported
    untitled

/cc @ericstj

@Priya91 Priya91 was assigned by joshfree May 26, 2016
@joshfree joshfree added this to the 1.1.0 milestone May 26, 2016
@stephentoub stephentoub modified the milestone: 1.0.0-rtm, 1.1.0 May 27, 2016
@stephentoub
Member

Note that this isn't just when building locally or when building an individual project. Our code coverage reports are all showing as 0% coverage. 😦

@stephentoub
Member

@sawilde, does OpenCover have a hard dependency on mscorlib.dll being named "mscorlib"? The core library has been renamed for .NET Core from "mscorlib" to "System.Private.Corelib", and I'm wondering if that change explains why OpenCover is reporting 0 hits on everything.

@joshfree joshfree modified the milestone: 1.1.0, 1.0.0-rtm Jun 2, 2016
@joshfree
Member
joshfree commented Jun 2, 2016

Moving this to 1.1.0. We can fix this in master and then look to port the changes back to 1.0.0, possibly during a servicing event or other related branch maintenance.

@sawilde
Contributor
sawilde commented Jun 2, 2016

@stephentoub - Alas yes - the cuckoos attach to System.CannotUnloadAppDomainException which it looks for when mscorlib is loaded.

I suspect the change is easy - see https://github.com/OpenCover/opencover/blob/0f406744660456ec67e4aa3a6d77d2e28a8788ee/main/OpenCover.Profiler/CodeCoverage_Cuckoo.cpp#L221 - but it depends where you keep that class in your new scheme.

You could try the -oldstyle switch - see Usage but you may have other issues especially around partial trust scenarios.

@sawilde sawilde referenced this issue in OpenCover/opencover Jun 3, 2016
Open

.net core support #595

@stephentoub
Member

Thanks, @sawilde. I'll give that a try.

@stephentoub
Member

Thanks, @sawilde. The -oldStyle workaround appears to have unblocked us.

@stephentoub stephentoub closed this Jun 3, 2016
@sawilde
Contributor
sawilde commented Jun 4, 2016

I am so glad I didn't delete that code 3 years ago :)

@stephentoub
Member

I am so glad I didn't delete that code 3 years ago :)

Hah :) Me, too.

@StephenCleary StephenCleary added a commit to StephenCleary/BuildTools that referenced this issue Jun 28, 2016
@StephenCleary StephenCleary Update for .NET Core RTM 599beba
@karelz karelz modified the milestone: 1.2.0, 1.1.0 Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment