Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect output format property generation in Fake.DotNet.Testing.Coverlet #2426

Closed
SteveGilham opened this issue Nov 5, 2019 · 0 comments · Fixed by #2427
Closed

Incorrect output format property generation in Fake.DotNet.Testing.Coverlet #2426

SteveGilham opened this issue Nov 5, 2019 · 0 comments · Fixed by #2427

Comments

@SteveGilham
Copy link
Contributor

SteveGilham commented Nov 5, 2019

Description

It generates /p:OutputFormat=opencover when it should be /p:CoverletOutputFormat=opencover -- see documentation

Repro steps

Use

let coverletOptions (o : Coverlet.CoverletParams) = 
  { o with OutputFormat = Coverlet.OutputFormat.OpenCover }
...
Coverlet.withDotNetTestOptions coverletOptions

in

Expected behavior

Command line for dotnet test includes

 /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./

and the call generates an XML report coverage.opencover,xml

Actual behavior

Command line for dotnet test includes

 /p:CollectCoverage=true /p:OutputFormat=opencover /p:CoverletOutput=./

and the call generates a JSON report coverage.json

Known workarounds

Compose that part of the command line manually like

let coverlet5_18_3fixup (o : DotNet.TestOptions) =      
  if o.MSBuildParams.Properties |> List.exists (fun (p,_) -> p = "CoverletOutput")
  then { o with MSBuildParams = { o.MSBuildParams with Properties = o.MSBuildParams.Properties 
                                                                    |> List.map (fun (p,v) -> if p = "OutputFormat"
                                                                                              then ("CoverletOutputFormat", v)
                                                                                              else (p,v))}}
  else o       

Coverlet.withDotNetTestOptions coverletOptions
|> coverlet5_18_3fixup

Related information

Fake 5.18.3

@SteveGilham SteveGilham changed the title Incorrect outpur format property generation in Fake.DotNet.Testing.Coverlet Incorrect output format property generation in Fake.DotNet.Testing.Coverlet Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant