Skip to content

Commit

Permalink
feat: fix code coverage not generated for phonenumber.test project an…
Browse files Browse the repository at this point in the history
…d remove old code coverage upload from appveyor (#246)
  • Loading branch information
wmundev authored Apr 20, 2024
1 parent 5225c01 commit 0d4ed96
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,6 @@ testgeocoding.zip

# Performance tests artifacts
csharp/PhoneNumbers.PerformanceTest/BenchmarkDotNet.Artifacts/

# Coverage reports
coverage/
5 changes: 1 addition & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ branches:
- main
before_build:
- dotnet restore csharp -s https://api.nuget.org/v3/index.json
- choco install opencover.portable
- choco install codecov
- ps: Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
- ps: Compress-Archive -Path "resources\test\geocoding\*" -DestinationPath "resources\test\testgeocoding.zip"
build_script:
- dotnet pack -c Release csharp\PhoneNumbers
- dotnet pack -c Release csharp\PhoneNumbers.Extensions
test_script:
- OpenCover.Console.exe -register:user -target:dotnet.exe -targetargs:"test csharp\PhoneNumbers.sln" -filter:"+[PhoneNumbers]* -[PhoneNumbers.Test]*" -excludebyattribute:*.CompilerGenerated*^ -oldStyle -returntargetcode
- codecov -f results.xml
- dotnet test csharp/PhoneNumbers.sln --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
artifacts:
- path: csharp\PhoneNumbers\bin\Release\libphonenumber-csharp.*
- path: csharp\PhoneNumbers.Extensions\bin\Release\libphonenumber-csharp.extensions.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 4 additions & 0 deletions csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 0d4ed96

Please sign in to comment.