-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestFramework: Fix coverage #8581
TestFramework: Fix coverage #8581
Conversation
50a45df
to
73e1284
Compare
d104ba3
to
66123c8
Compare
@@ -35,9 +35,9 @@ variables: | |||
- name: UnitTestProjectPath | |||
value: 'analyzers\tests\SonarAnalyzer.Test\' | |||
- name: UnitTestResultsPath | |||
value: '$(Agent.TempDirectory)\TestResults' | |||
value: '$(Build.SourcesDirectory)\TestResults' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated deconfusion, to use the same directory before and after the artifact is restored
FrameworkMoniker: 'net48' | ||
CoverageArtifactName: 'DotnetCoverageNet48' | ||
TestResultsArtifactName: 'DotnetTestResultsNet48' | ||
CoverageArtifactName: 'DotNetCoverageNet48' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reordered by priority
@@ -251,7 +251,7 @@ stages: | |||
|
|||
- powershell: | | |||
cd analyzers | |||
& dotnet test $(ProjectFilePath) -f $(FrameworkMoniker) -c $(BuildConfiguration) -l trx --results-directory $(UnitTestResultsPath) /p:AltCover=true,AltCoverForce=true,AltCoverVisibleBranches=true,AltCoverAssemblyFilter='Moq|Humanizer|AltCover|Microsoft.VisualStudio.TestPlatform.*|.*Test',AltCoverPathFilter='SonarAnalyzer\.CFG\\ShimLayer|SonarAnalyzer\.ShimLayer\.CodeGeneration',AltCoverAttributeFilter='ExcludeFromCodeCoverage',AltCoverReport=$(CoveragePath)/coverage.$(FrameworkMoniker).xml | |||
& dotnet test $(ProjectFilePath) -f $(FrameworkMoniker) -c $(BuildConfiguration) -l trx --results-directory $(UnitTestResultsPath) /p:AltCover=true,AltCoverForce=true,AltCoverVisibleBranches=true,AltCoverAssemblyFilter="Moq|Humanizer|AltCover|Microsoft.VisualStudio.TestPlatform.*|\.Test^",AltCoverPathFilter="SonarAnalyzer\.CFG\\ShimLayer|SonarAnalyzer\.ShimLayer\.CodeGeneration",AltCoverAttributeFilter="ExcludeFromCodeCoverage",AltCoverReport="$(CoveragePath)/coverage.$(CoverageArtifactName).xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual fix, .*Test
was matching the .TestFramework
part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT
66123c8
to
c077fcb
Compare
|
|
Part of #8542
Only the last commit
TestFramework: Fix coverage
needs a review. The rest is here to prove that covered is not 0% anymore