opencover icon indicating copy to clipboard operation
opencover copied to clipboard

OpenCover has no attribute to force exiting with error on execution of a failing tests.

Open GrimSmiler opened this issue 8 years ago • 1 comments

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
  • [ ] .NET 4.5
  • [ ] .NET 4.6
  • [ ] .NET 4.6.1
  • [ ] .NET 4.6.2
  • [ ] .NET Core 1.0.0
  • [X] Something else .NET Core 2.0

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
  • [X] feature request

Expected Behavior

  1. Specify (to be implemented) "-failOnError parameter
  2. Execute failing tests with OpenCover. Result: Coverage saved, exit code of open cover is not 0 due to failing Test Runner result

Actual Behavior

  1. Execute failing tests with OpenCover. Result: Coverage saved, exit code of open cover is 0 even though Test Runner returned a non-zero exit code

Steps to reproduce the problem:

Run a failing xunit test in .NET core 2.0 with OpenCover

OpenCover.Console.exe -register:user -target:"$dotnetexe" -targetargs:$targetargs -oldstyle -output:$reportFileLocation -coverbytest:$coverbytest -filter:$filter -mergebyhash -mergeoutput

GrimSmiler avatar Feb 26 '18 11:02 GrimSmiler

from the wiki

-returntargetcode[:<opencoverreturncodeoffset>] - Return the target process return code instead of the OpenCover console return code. Use the offset to return the OpenCover console at a value outside the range returned by the target process.

sawilde avatar Mar 06 '18 23:03 sawilde