Cake.Coverlet icon indicating copy to clipboard operation
Cake.Coverlet copied to clipboard

Bug: If only output directory defined, the resulting file name contain directory name.

Open WebDucer opened this issue 3 years ago • 1 comments

I have the following behavior, if I set only the CoverletOutputDirectory without filename. The resulting files are written to the parent directory with combined filename of directory+format.

Example for configuration:

var covSettings = new CoverletSettings {
  CoverletOutputDirectory = Directory("./Output/TestResults"),
  CoverletOutputFormat = CoverletOutputFormat.opencover | CoverletOutputFormat. cobertura,
  CollectCoverage = true
}

I get the following dorectory / file structure:

  • Output
    • TestResults.opencoder.xml
    • TestResults.cobertura.xml

instead of the expected structure:

  • Output
    • TestResults
      • results.opencover.xml
      • results.cobertura.xml

As I see in commandl ine, the path is send without ending /, so coverlet treat this as a file.

As described here (https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/MSBuildIntegration.md) coverlet treat the CoverletOutput parameter as directory, if this ends with /, as file in other cases.

WebDucer avatar May 05 '21 18:05 WebDucer

Hi there,

Thaks for the report, i'll look at the fixing this shortly and pushing a new build.

Romanx avatar May 06 '21 08:05 Romanx