Powershell with /p:ExcludeByFile do not works
See original GitHub issuePowershell script
By adding command /p:ExcludeByFile=\"**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs\"
to
& dotnet test --configuration Release --no-build Build.Tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
I manage to break generation of the report file, if I removes /p:ExcludeByFile=\"...\"
everything works
I tried with no success:
/p:ExcludeByFile=\"**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs\"
/p:ExcludeByFile="**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs"
/p:ExcludeByFile=\"**\/MyFun*.cs,**\/*Test*.cs,**\/*Exception*.cs,**\/*Attribute*.cs\"
/p:ExcludeByFile=\"**\MyFun*.cs,**\*Test*.cs,**\*Exception*.cs,**\*Attribute*.cs\"
/p:ExcludeByFile="**\MyFun*.cs,**\*Test*.cs,**\*Exception*.cs,**\*Attribute*.cs"
/p:ExcludeByFile
just not works
https://ci.appveyor.com/project/hack2root/build/build/1.0.0.222-master https://ci.appveyor.com/project/hack2root/build/build/1.0.0.223-master
Why not to use SonarScanner format
/d:sonar.coverage.exclusions="**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs"
for /p:ExcludeByFile
, for example:
/p:ExcludeByFile="**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs"
My build script:
& packages/dotnet-sonarscanner begin /d:sonar.login="$env:SONARCLOUDTOKEN" /k:"build-core" /d:sonar.host.url="https://sonarcloud.io" /n:"build" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="Build.Tests/coverage.opencover.xml" /d:sonar.coverage.exclusions="**/MyFun*.cs,**/*Test*.cs,**/*Exception*.cs,**/*Attribute*.cs" /d:sonar.organization="hack2root-github" /d:sonar.sourceEncoding="UTF-8"
& dotnet build --configuration Release
& dotnet test --configuration Release --no-build Build.Tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
& packages/dotnet-sonarscanner end /d:sonar.login="$env:SONARCLOUDTOKEN"
& packages/csmacnz.Coveralls --opencover -i Build.Tests/coverage.opencover.xml
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:10 (2 by maintainers)
Top GitHub Comments
@tonerdo Files didn’t get excluded, tried various patterns for these.
Exclude doesn’t work also.still not working on .net 3.1.411