Skip to content

Commit

Permalink
Add coverlet connector
Browse files Browse the repository at this point in the history
- Update VSTest to minimum supported version
- Use the coverlet connector

Due to known issues, the datacollector integration is suggested

See coverlet-coverage/coverlet#1278 (comment)
And https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md

<!-- Minimum version 16.5.0 -->
  • Loading branch information
andrei-epure-sonarsource committed Jul 22, 2022
1 parent 6e81102 commit c5764c1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<!-- Update this reference when new version is released -->
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
Expand Down
75 changes: 30 additions & 45 deletions analyzers/tests/SonarAnalyzer.UnitTest/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"version": 1,
"dependencies": {
".NETFramework,Version=v4.8": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, )",
"resolved": "3.1.2",
"contentHash": "wuLDIDKD5XMt0A7lE31JPenT7QQwZPFkP5rRpdJeblyXZ9MGLI8rYjvm5fvAKln+2/X+4IxxQDxBtwdrqKNLZw=="
},
"FluentAssertions": {
"type": "Direct",
"requested": "[5.10.3, )",
Expand Down Expand Up @@ -58,11 +64,11 @@
},
"Microsoft.NET.Test.Sdk": {
"type": "Direct",
"requested": "[16.4.0, )",
"resolved": "16.4.0",
"contentHash": "gjjqS3rCzg4DrSQq4YwJwUUvc49HtXpXrZkW9fu5VG+K4X+Ztn4+UzolyML7wPnl/EAIufk4hu628bJB4WtpFg==",
"requested": "[16.5.0, )",
"resolved": "16.5.0",
"contentHash": "yHZOhVSPuGqgHi+KhHiAZqNY08avkQraXKvgKgDU8c/ztmGzw7gmukkv49EaTq6T3xmp4XroWk3gAlbJHMxl8w==",
"dependencies": {
"Microsoft.CodeCoverage": "16.4.0"
"Microsoft.CodeCoverage": "16.5.0"
}
},
"Moq": {
Expand Down Expand Up @@ -185,8 +191,8 @@
},
"Microsoft.CodeCoverage": {
"type": "Transitive",
"resolved": "16.4.0",
"contentHash": "qb7PMVZMAY5iUCvB/kDUEt9xqazWKZoKY/sGpAJO4VtwgN5IcEgipCu3n0i1GPCwGbWVL6k4a8a9F+FqmADJng=="
"resolved": "16.5.0",
"contentHash": "PM5YLtyN45EyUGePJpaNogndlaQPrMgQQXHKMhMESC6KfSVvt+j7+dxBi8NYC6X6dZVysf7ngwhSW3wwvPJRSQ=="
},
"Newtonsoft.Json": {
"type": "Transitive",
Expand Down Expand Up @@ -419,17 +425,6 @@
"System.Text.RegularExpressions": "4.3.1"
}
},
"sonaranalyzer.ruledescriptorgenerator": {
"type": "Project"
},
"sonaranalyzer.utilities": {
"type": "Project",
"dependencies": {
"SonarAnalyzer": "1.0.0",
"SonarAnalyzer.CSharp": "1.0.0",
"SonarAnalyzer.VisualBasic": "1.0.0"
}
},
"sonaranalyzer.visualbasic": {
"type": "Project",
"dependencies": {
Expand All @@ -441,6 +436,12 @@
}
},
"net6.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, )",
"resolved": "3.1.2",
"contentHash": "wuLDIDKD5XMt0A7lE31JPenT7QQwZPFkP5rRpdJeblyXZ9MGLI8rYjvm5fvAKln+2/X+4IxxQDxBtwdrqKNLZw=="
},
"FluentAssertions": {
"type": "Direct",
"requested": "[5.10.3, )",
Expand Down Expand Up @@ -500,12 +501,12 @@
},
"Microsoft.NET.Test.Sdk": {
"type": "Direct",
"requested": "[16.4.0, )",
"resolved": "16.4.0",
"contentHash": "gjjqS3rCzg4DrSQq4YwJwUUvc49HtXpXrZkW9fu5VG+K4X+Ztn4+UzolyML7wPnl/EAIufk4hu628bJB4WtpFg==",
"requested": "[16.5.0, )",
"resolved": "16.5.0",
"contentHash": "yHZOhVSPuGqgHi+KhHiAZqNY08avkQraXKvgKgDU8c/ztmGzw7gmukkv49EaTq6T3xmp4XroWk3gAlbJHMxl8w==",
"dependencies": {
"Microsoft.CodeCoverage": "16.4.0",
"Microsoft.TestPlatform.TestHost": "16.4.0"
"Microsoft.CodeCoverage": "16.5.0",
"Microsoft.TestPlatform.TestHost": "16.5.0"
}
},
"Moq": {
Expand Down Expand Up @@ -676,8 +677,8 @@
},
"Microsoft.CodeCoverage": {
"type": "Transitive",
"resolved": "16.4.0",
"contentHash": "qb7PMVZMAY5iUCvB/kDUEt9xqazWKZoKY/sGpAJO4VtwgN5IcEgipCu3n0i1GPCwGbWVL6k4a8a9F+FqmADJng=="
"resolved": "16.5.0",
"contentHash": "PM5YLtyN45EyUGePJpaNogndlaQPrMgQQXHKMhMESC6KfSVvt+j7+dxBi8NYC6X6dZVysf7ngwhSW3wwvPJRSQ=="
},
"Microsoft.CSharp": {
"type": "Transitive",
Expand Down Expand Up @@ -714,18 +715,18 @@
},
"Microsoft.TestPlatform.ObjectModel": {
"type": "Transitive",
"resolved": "16.4.0",
"contentHash": "4geKywSUJHHrfBTr1wJXUVWP0Vx1X03oFQAdZdGa8jK8p5MSwsJ4Vd0/mqN0dB2YXaIXIhDT94ti5WQ1KZ4jdw==",
"resolved": "16.5.0",
"contentHash": "NnLFxmFBCAS6kye2JFszD5WKgj4Zve5KX/R0mhYwh6BVnSeybI2unRnjEPtLyY3CAVhwrY4bh/8LNFtslAcGZg==",
"dependencies": {
"NuGet.Frameworks": "5.0.0"
}
},
"Microsoft.TestPlatform.TestHost": {
"type": "Transitive",
"resolved": "16.4.0",
"contentHash": "tMlz3uc7VUZSYYslyVOVXH40KexTptZMAi8gIE+5w+SIt8I0qLPObpqX6QVLWszPr7sxX4WAKTiFgqgBB1MxjA==",
"resolved": "16.5.0",
"contentHash": "ytGymboQIvjNX5pLC0yp/Bz9sGDHqSnLQgBRtd4VrqOUgKmmcfxMYZ6p0TBZgAT1oijdC6xqUZ7rl8mbaaXTJw==",
"dependencies": {
"Microsoft.TestPlatform.ObjectModel": "16.4.0",
"Microsoft.TestPlatform.ObjectModel": "16.5.0",
"Newtonsoft.Json": "9.0.1"
}
},
Expand Down Expand Up @@ -2021,22 +2022,6 @@
"System.Text.RegularExpressions": "4.3.1"
}
},
"sonaranalyzer.ruledescriptorgenerator": {
"type": "Project",
"dependencies": {
"SonarAnalyzer": "1.0.0",
"System.Collections.Immutable": "1.1.37",
"System.IO.FileSystem": "4.3.0"
}
},
"sonaranalyzer.utilities": {
"type": "Project",
"dependencies": {
"SonarAnalyzer": "1.0.0",
"SonarAnalyzer.CSharp": "1.0.0",
"SonarAnalyzer.VisualBasic": "1.0.0"
}
},
"sonaranalyzer.visualbasic": {
"type": "Project",
"dependencies": {
Expand Down

0 comments on commit c5764c1

Please sign in to comment.