MiniScaffold icon indicating copy to clipboard operation
MiniScaffold copied to clipboard

Coverage information is blocked by itself

Open ImaginaryDevelopment opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. When I add new code to the project and then try to build

DotnetTest               00:00:04.1182971   (Exception of type 'Fake.DotNet.MSBuildException' was thrown.)
GenerateCoverageReport   00:00:00           (skipped)
C:\Users\foo\.nuget\packages\altcover\7.6.812\build\netstandard2.0\AltCover.targets(197,5): error : Statement coverage percentage achieved is 64% below the threshold of 80%. [D:\projects\ToMEHelper\tests\ToMEHelper.Tests\ToMEHelper.Tests.fsproj]
Collect: C:\Users\foo\.nuget\packages\altcover\7.6.812\build\netstandard2.0\AltCover.targets(197,5): error : StatementFinished (Failed) 'DotNet:test' in 00:00:04.1123981

so the default path is to only generate coverage information if the test target succeeds, but the test target fails if the coverage delta is too low, so then I don't get a coverage report to show what things need coverage

Describe the solution you'd like I'd like the coverage to be generated anyhow.

Describe alternatives you've considered I can run .\build.cmd generatecoveragereport -s but I'd think the default path should be to somehow determine when the testing target fails only because of coverage amount so that the coverage report can be generated and used to determine what things need testing.

Additional context repo if it is somehow useful at https://github.com/ImaginaryDevelopment/ToMEHelper

ImaginaryDevelopment avatar Dec 16 '21 00:12 ImaginaryDevelopment

Ahh yeah, it should try to generate the coverage report regardless of if it failed. We would probably have to merge the targets for DotnetTest and GenerateCoverageReport and detect whether the file that AltCover outputs is there and try running the code previously in GenerateCoverageReport.

TheAngryByrd avatar Dec 16 '21 13:12 TheAngryByrd