Skip to content

Commit

Permalink
Exclude test cases from code analysis (#7763)
Browse files Browse the repository at this point in the history
  • Loading branch information
costin-zaharia-sonarsource authored Aug 9, 2023
1 parent 44ab53b commit bb7d235
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ variables:
value: 'analyzers\tests\SonarAnalyzer.UnitTest\'
- name: UnitTestResultsPath
value: '$(UnitTestProjectPath)\TestResults'
- name: UnitTestExclusionsPattern
value: 'analyzers/tests/SonarAnalyzer.UnitTest/TestCases/**/*'
- name: isReleaseBranch
value: ${{ or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/branch-')) }}
- name: vsVersion
Expand Down Expand Up @@ -226,6 +228,7 @@ stages:
sonar.verbose=true
sonar.cs.opencover.reportsPaths="$(Build.SourcesDirectory)/coverage/**.xml"
sonar.cs.vstest.reportsPaths="$(Build.SourcesDirectory)/TestResults/*.trx"
sonar.test.exclusions="$(UnitTestExclusionsPattern)"
sonar.analysis.buildNumber=$(Build.BuildId)
sonar.analysis.pipeline=$(Build.BuildId)
sonar.analysis.sha1=$(System.PullRequest.SourceCommitId)
Expand All @@ -246,6 +249,7 @@ stages:
sonar.verbose=true
sonar.cs.opencover.reportsPaths="$(Build.SourcesDirectory)/coverage/**.xml"
sonar.cs.vstest.reportsPaths="$(Build.SourcesDirectory)/TestResults/*.trx"
sonar.test.exclusions="$(UnitTestExclusionsPattern)"
sonar.analysis.buildNumber=$(Build.BuildId)
sonar.analysis.pipeline=$(Build.BuildId)
sonar.analysis.sha1=$(Build.SourceVersion)
Expand Down

0 comments on commit bb7d235

Please sign in to comment.