Romanx/Cake.Coverlet

Path containing spaces for CoverletOutput leads to error

Closed this issue · 1 comments

I've encountered an issue when using Cake.Coverlet on my Jenkins instance (which has the workspace at its default location in Program Files (x86) for this project https://github.com/taconaut/Sppd.TeamTuner.

When running the Target Run-Unit-Tests in Jenkins (failed job), following command is being generated:
Executing: "C:/Program Files/dotnet/dotnet.exe" test "C:/Program Files (x86)/Jenkins/jobs/Sppd.TeamTuner-Deploy-Codecov/workspace/Backend/Tests/Sppd.TeamTuner.Tests.Unit/Sppd.TeamTuner.Tests.Unit.csproj" --configuration Release --no-build --no-restore /property:CollectCoverage=True /property:CoverletOutputFormat=\"opencover\" /property:CoverletOutput=C:/Program Files (x86)/Jenkins/jobs/Sppd.TeamTuner-Deploy-Codecov/workspace/coverage-results/coverage-results-unit.opencover.xml /property:Include=\"[Sppd.TeamTuner.*]*\" /property:Exclude=\"[xunit*]*,[Sppd.TeamTuner.Tests.*]*\"

And fails with: MSBUILD : error MSB1008: Only one project can be specified.

If adding (unescaped) quotes around /property:CoverletOutput, it fixes this issue: /property:CoverletOutput="C:/Program Files (x86)/Jenkins/jobs/Sppd.TeamTuner-Deploy-Codecov/workspace/coverage-results/coverage-results-unit.opencover.xml"

This has now been released to Nuget. Thanks for your patience @taconaut