Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

skippedDueTo="AutoImplementedProperty" Included in coverage output when -hideskipped:ALL is used #794

Closed
2 of 19 tasks
cjablonski76 opened this issue Feb 9, 2018 · 2 comments
Assignees

Comments

@cjablonski76
Copy link

Please provide the following information when submitting an issue.

Where appropriate replace the [ ] with a [X]

My Framework

  • .NET 2
  • .NET 3.5
  • .NET 4
  • [X ] .NET 4.5
  • .NET 4.6
  • .NET 4.6.1
  • .NET 4.6.2
  • .NET Core 1.0.0
  • Something else

My Environment

  • Windows 7 or below (not truly supported due to EOL)
  • Windows 8
  • Windows 8.1
  • [X ] Windows 10
  • Windows 10 IoT Core
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2016

I have already...

  • [X ] repeated the problem using the latest stable release of OpenCover.
  • [X ] reviewed the usage guide and usage document.
  • have looked at the opencover output xml file in an attempt to resolve the issue.
  • reviewed the current issues to check that the issue isn't already known.

My issue is related to (check only those which apply):

  • [] no coverage being recorded
  • 32 or 64 bit support
  • feature request

Expected Behavior

Class properties that are considered AutoImplementedProperty should be hidden from the code coverage output file if -hideskipped:ALL is passed.

Actual Behavior

When running code coverage with -hideskipped:ALL passed, the coverage report will is hiding other skipped types, but still listing skippedDueTo="AutoImplementedProperty" results.
i.e.
<Method skippedDueTo="AutoImplementedProperty" visited="false" cyclomaticComplexity="1" nPathComplexity="0" sequenceCoverage="0" branchCoverage="0" crapScore="0" isConstructor="false" isStatic="false" isGetter="false" isSetter="true"> <MetadataToken>12345</MetadataToken> <Name>System.Void Domain.Address::set_Address1(System.String)</Name> <FileRef uid="1" /> <SequencePoints /> <BranchPoints /> </Method>

Steps to reproduce the problem:

  1. run OpenCover from console

  2. use the -skipAutoProps and -hideskipped:ALL arguments

  3. example command:

OpenCover.Console.exe -target:"C:\code\git\DTR\buildscripts\tools\NUnit.ConsoleRunner\tools\nunit3-console.exe" -targetargs:"C:\code\git\Services.Tests\bin\Debug\Services.Tests.dll" -filter:"+[MyAssembly*]* -[Test]*" -register:user -hideskipped:All -skipautoprops -mergebyhash -output:C:\myOutput\projectCoverageReport.xml

@cjablonski76
Copy link
Author

I did dig around in the source quickly, and saw that in the BasePersistance class it has the following:

case SkippedMethod.AutoImplementedProperty:
                    RemoveSkippedMethods(SkippedMethod.Attribute);
                    RemoveEmptyClasses();
                    break;

I believe that the SkippedMethod.Attribute should be SkippedMethod.AutoImplementedProperty as the SkippedMethod.Attribute is already being covered in the case SkippedMethod.Attribute just above it.

I was unable to build the project locally, or I would have tried it out and contributed if it was the fix.

@sawilde sawilde added the bug label Mar 6, 2018
@sawilde
Copy link
Member

sawilde commented Mar 6, 2018

thanks - I'll have a look

@sawilde sawilde self-assigned this Mar 6, 2018
@sawilde sawilde added this to the Release (Q1 2019) milestone Jan 6, 2019
@sawilde sawilde added the medium label Jan 6, 2019
sawilde added a commit to sawilde/opencover that referenced this issue Jan 8, 2019
also addressed Delegate and FSharpInternal
sawilde added a commit that referenced this issue Jan 8, 2019
also addressed Delegate and FSharpInternal
@sawilde sawilde closed this as completed Jan 12, 2019
sawilde added a commit that referenced this issue Jan 20, 2019
also addressed Delegate and FSharpInternal
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants