Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Enable code coverage for System.Diagnostics.Process#1069

Merged
stephentoub merged 1 commit intodotnet:masterfrom
stephentoub:fix_process_cc
Mar 4, 2015
Merged

Enable code coverage for System.Diagnostics.Process#1069
stephentoub merged 1 commit intodotnet:masterfrom
stephentoub:fix_process_cc

Conversation

@stephentoub
Copy link
Copy Markdown
Member

Code coverage for System.Diagnostics.Process was previously disabled due to tests hanging when coverage was enabled. The issue appears to stem from the processes launched by the process tests also having profiling enabled, which currently causes problems for the code coverage tool. This commit works around the problem by removing the relevant environment variables from the launched processes so that profiling isn't enabled for them.

Fixes #655

Opened OpenCover/opencover#274 for the tooling issue.

@weshaggard
Copy link
Copy Markdown
Member

cc @pallavit
The change looks good to me but it does kind of suck that we need to hard code those special environment variables.

@stephentoub
Copy link
Copy Markdown
Member Author

@weshaggard, yeah. I view it as a workaround until the tooling around it can be fixed. The other alternative would be to simply clear all environment variables; I tested that as well and, at least with our current tests, that works fine. I was just concerned that doing so could lead to unforeseen problems.

@stephentoub
Copy link
Copy Markdown
Member Author

(I'm going to hold off on merging this until @sawilde has had a chance to review the problem, per the discussion in OpenCover/opencover#274.)

@sawilde
Copy link
Copy Markdown
Contributor

sawilde commented Mar 4, 2015

just to let you know the coverage is just shy of 50% - I have a RC that I am just testing locally and I will push with the update nuget package ref later today

@stephentoub
Copy link
Copy Markdown
Member Author

Terrific. Thanks, @sawilde!

@stephentoub
Copy link
Copy Markdown
Member Author

With @sawilde's update to OpenCover, I've changed my PR to just change the .csproj to enable code coverage for the project, as the other workaround I'd implemented is now unnecessary.

stephentoub added a commit that referenced this pull request Mar 4, 2015
Enable code coverage for System.Diagnostics.Process
@stephentoub stephentoub merged commit 1391df2 into dotnet:master Mar 4, 2015
@stephentoub stephentoub deleted the fix_process_cc branch March 4, 2015 13:08
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
madsiberian pushed a commit to madsiberian/corefx that referenced this pull request Dec 2, 2017
* Comment out calls to container.py and case.py as part of deprecate bootstrap.py

* Empty out netci.groovy file
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code coverage doesn't work for all assemblies

5 participants