@@ -35,9 +35,9 @@ variables:
35
35
- name : UnitTestProjectPath
36
36
value : ' analyzers\tests\SonarAnalyzer.Test\'
37
37
- name : UnitTestResultsPath
38
- value : ' $(Agent.TempDirectory )\TestResults'
38
+ value : ' $(Build.SourcesDirectory )\TestResults'
39
39
- name : CoveragePath
40
- value : ' $(Agent.TempDirectory )\coverage'
40
+ value : ' $(Build.SourcesDirectory )\coverage'
41
41
- name : UnitTestExclusionsPattern
42
42
value : ' analyzers/tests/SonarAnalyzer.Test/TestCases/**/*'
43
43
- name : isReleaseBranch
@@ -222,25 +222,25 @@ stages:
222
222
strategy :
223
223
matrix :
224
224
Net48 :
225
- FrameworkMoniker : ' net48'
226
- CoverageArtifactName : ' DotnetCoverageNet48'
227
- TestResultsArtifactName : ' DotnetTestResultsNet48'
225
+ CoverageArtifactName : ' DotNetCoverageNet48'
226
+ TestResultsArtifactName : ' DotNetTestResultsNet48'
228
227
ProjectFilePath : ' tests\SonarAnalyzer.Test\SonarAnalyzer.Test.csproj'
228
+ FrameworkMoniker : ' net48'
229
229
Net70 :
230
- FrameworkMoniker : ' net7.0-windows'
231
- CoverageArtifactName : ' DotnetCoverageNet7'
232
- TestResultsArtifactName : ' DotnetTestResultsNet7'
230
+ CoverageArtifactName : ' DotNetCoverageNet7'
231
+ TestResultsArtifactName : ' DotNetTestResultsNet7'
233
232
ProjectFilePath : ' tests\SonarAnalyzer.Test\SonarAnalyzer.Test.csproj'
233
+ FrameworkMoniker : ' net7.0-windows'
234
234
Net80 :
235
- FrameworkMoniker : ' net8.0-windows'
236
- CoverageArtifactName : ' DotnetCoverageNet8'
237
- TestResultsArtifactName : ' DotnetTestResultsNet8'
235
+ CoverageArtifactName : ' DotNetCoverageNet8'
236
+ TestResultsArtifactName : ' DotNetTestResultsNet8'
238
237
ProjectFilePath : ' tests\SonarAnalyzer.Net8.Test\SonarAnalyzer.Net8.Test.csproj'
238
+ FrameworkMoniker : ' net8.0-windows'
239
239
TestFramework :
240
- FrameworkMoniker : ' net7.0-windows'
241
- CoverageArtifactName : ' DotnetCoverageTestFramework'
242
- TestResultsArtifactName : ' DotnetTestResultsTestFramework'
240
+ CoverageArtifactName : ' DotNetCoverageTestFramework'
241
+ TestResultsArtifactName : ' DotNetTestResultsTestFramework'
243
242
ProjectFilePath : ' tests\SonarAnalyzer.TestFramework.Test\SonarAnalyzer.TestFramework.Test.csproj'
243
+ FrameworkMoniker : ' net7.0-windows'
244
244
245
245
steps :
246
246
- task : DownloadPipelineArtifact@2
@@ -251,7 +251,7 @@ stages:
251
251
252
252
- powershell : |
253
253
cd analyzers
254
- & 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
254
+ & 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"
255
255
displayName: '.Net UTs'
256
256
257
257
- task : PublishPipelineArtifact@1
@@ -302,8 +302,8 @@ stages:
302
302
projectVersion : ' $(SONAR_PROJECT_VERSION)'
303
303
extraProperties : |
304
304
sonar.verbose=true
305
- sonar.cs.opencover.reportsPaths="$(Build.SourcesDirectory)/coverage/* *.xml"
306
- sonar.cs.vstest.reportsPaths="$(Build.SourcesDirectory)/TestResults /*.trx"
305
+ sonar.cs.opencover.reportsPaths="$(CoveragePath)/ *.xml"
306
+ sonar.cs.vstest.reportsPaths="$(UnitTestResultsPath) /*.trx"
307
307
sonar.test.exclusions="$(UnitTestExclusionsPattern)"
308
308
sonar.analysis.buildNumber=$(Build.BuildId)
309
309
sonar.analysis.pipeline=$(Build.BuildId)
@@ -323,8 +323,8 @@ stages:
323
323
projectVersion : ' $(SONAR_PROJECT_VERSION)'
324
324
extraProperties : |
325
325
sonar.verbose=true
326
- sonar.cs.opencover.reportsPaths="$(Build.SourcesDirectory)/coverage/* *.xml"
327
- sonar.cs.vstest.reportsPaths="$(Build.SourcesDirectory)/TestResults /*.trx"
326
+ sonar.cs.opencover.reportsPaths="$(CoveragePath)/ *.xml"
327
+ sonar.cs.vstest.reportsPaths="$(UnitTestResultsPath) /*.trx"
328
328
sonar.test.exclusions="$(UnitTestExclusionsPattern)"
329
329
sonar.analysis.buildNumber=$(Build.BuildId)
330
330
sonar.analysis.pipeline=$(Build.BuildId)
@@ -356,49 +356,49 @@ stages:
356
356
- task : DownloadPipelineArtifact@2
357
357
displayName : ' Download coverage reports'
358
358
inputs :
359
- artifact : DotnetCoverageNet48
359
+ artifact : DotNetCoverageNet48
360
360
targetPath : ' coverage'
361
361
362
362
- task : DownloadPipelineArtifact@2
363
363
displayName : ' Download coverage reports'
364
364
inputs :
365
- artifact : DotnetCoverageNet7
365
+ artifact : DotNetCoverageNet7
366
366
targetPath : ' coverage'
367
367
368
368
- task : DownloadPipelineArtifact@2
369
369
displayName : ' Download coverage reports'
370
370
inputs :
371
- artifact : DotnetCoverageNet8
371
+ artifact : DotNetCoverageNet8
372
372
targetPath : ' coverage'
373
373
374
374
- task : DownloadPipelineArtifact@2
375
375
displayName : ' Download coverage reports'
376
376
inputs :
377
- artifact : DotnetCoverageTestFramework
377
+ artifact : DotNetCoverageTestFramework
378
378
targetPath : ' coverage'
379
379
380
380
- task : DownloadPipelineArtifact@2
381
381
displayName : ' Download test results'
382
382
inputs :
383
- artifact : DotnetTestResultsNet48
383
+ artifact : DotNetTestResultsNet48
384
384
targetPath : ' TestResults'
385
385
386
386
- task : DownloadPipelineArtifact@2
387
387
displayName : ' Download test results'
388
388
inputs :
389
- artifact : DotnetTestResultsNet7
389
+ artifact : DotNetTestResultsNet7
390
390
targetPath : ' TestResults'
391
391
392
392
- task : DownloadPipelineArtifact@2
393
393
displayName : ' Download test results'
394
394
inputs :
395
- artifact : DotnetTestResultsNet8
395
+ artifact : DotNetTestResultsNet8
396
396
targetPath : ' TestResults'
397
397
398
398
- task : DownloadPipelineArtifact@2
399
399
displayName : ' Download test results'
400
400
inputs :
401
- artifact : DotnetTestResultsTestFramework
401
+ artifact : DotNetTestResultsTestFramework
402
402
targetPath : ' TestResults'
403
403
404
404
- powershell : |
0 commit comments