coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

Examples Contain Side Effects

Open josephdrake-stahls opened this issue 3 years ago • 3 comments

My particular issue came from trying to resolve an issue with Fine Code Coverage not reporting any results in my repository. At first there were no results, so I created a new solution with a minimum viable product to get FCC working, no dice. I compared my settings against the Examples in this repo and had everything configured similarly and couldn't get a working example.

After those 2 failed attempts, I cloned this repo to run the Examples and to my surprise (specifically the VSTest/HelloWorld) reports coverage no problem. This is where things go a bit oblong.

This repository contains: Directory.Build.props Directory.Build.targets DeterministicBuild.targets

These files introduce side effects to the examples. Additionally I tried to find the specific properties that allowed the coverage to work, but it isn't an issue of msbuild configuration. Deleting these files and running the coverage will reproduce my issue, but if you keep the files and comment out all of the content inside the <Project /> elements, it works.

To further corroborate the issue, running the coverage from the command line produces the same results with and without the targets/props files.

I don't want this thread to turn into debugging my problems, but instead to bring attention to the examples being contaminated with side effects due to the Driectory.Build.props and Driectory.Build.targets at the top level of the repo since this has resulted in a significant amount of time lost due to the side effects. I will look into the other open/closed issues to resolve my specific issues surrounding the lack of coverage results.

josephdrake-stahls avatar May 27 '22 15:05 josephdrake-stahls

For anyone curious about my problem, I did figure it out. I had my own Directory.Build.props at a higher level. Since this repo also declares one, it was selected over mine. My Directory.Build.props had configured the <PathMap /> to remove local filesystem information due to some old process that is no longer relevant. Makes total sense how this could throw off the coverage. Maybe this could be added to some of the documentation somewhere?

josephdrake-stahls avatar May 27 '22 15:05 josephdrake-stahls

Thanks for reporting this, I'll take a look to isolate the samples from the repo.

MarcoRossignoli avatar May 29 '22 19:05 MarcoRossignoli

This issue is stale because it has been open for 3 months with no activity.

github-actions[bot] avatar Sep 04 '23 00:09 github-actions[bot]