@@ -119,7 +119,6 @@ stages:
119119 testResultsFormat : ' NUnit'
120120 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
121121 testRunTitle : ' HQRM'
122-
123122 - job : Test_Unit
124123 displayName : ' Unit'
125124 pool :
@@ -156,7 +155,6 @@ stages:
156155 targetPath : ' $(buildFolderName)/$(testResultFolderName)/'
157156 artifactName : $(testArtifactName)
158157 parallel : true
159-
160158 - job : Code_Coverage
161159 displayName : ' Publish Code Coverage'
162160 dependsOn : Test_Unit
@@ -193,9 +191,9 @@ stages:
193191 bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" -F unit
194192 displayName: 'Publish Code Coverage to Codecov.io'
195193
196- - stage : Integration_Test_Commands
197- displayName : ' Integration Test Commands'
198- dependsOn : Build
194+ - stage : Integration_Test_Commands_SqlServer
195+ displayName : ' Integration Test Commands - SQL Server '
196+ dependsOn : Quality_Test_and_Unit_Test
199197 jobs :
200198 - job : Test_Integration
201199 displayName : ' Commands'
@@ -269,9 +267,139 @@ stages:
269267 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
270268 testRunTitle : ' Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
271269
272- - stage : Integration_Test_Resources
273- displayName : ' Integration Test Resources'
274- dependsOn : Build
270+ - stage : Integration_Test_Commands_ReportingServices
271+ displayName : ' Integration Test Commands - Reporting Services'
272+ dependsOn : Integration_Test_Commands_SqlServer
273+ jobs :
274+ - job : Test_Integration
275+ displayName : ' Commands'
276+ strategy :
277+ matrix :
278+ SQL2017_WIN2019 :
279+ JOB_VMIMAGE : ' windows-2019'
280+ TEST_CONFIGURATION : ' Integration_SQL2017'
281+ SQL2017_WIN2022 :
282+ JOB_VMIMAGE : ' windows-2022'
283+ TEST_CONFIGURATION : ' Integration_SQL2017'
284+ SQL2019_WIN2019 :
285+ JOB_VMIMAGE : ' windows-2019'
286+ TEST_CONFIGURATION : ' Integration_SQL2019'
287+ SQL2019_WIN2022 :
288+ JOB_VMIMAGE : ' windows-2022'
289+ TEST_CONFIGURATION : ' Integration_SQL2019'
290+ SQL2022_WIN2019 :
291+ JOB_VMIMAGE : ' windows-2019'
292+ TEST_CONFIGURATION : ' Integration_SQL2022'
293+ SQL2022_WIN2022 :
294+ JOB_VMIMAGE : ' windows-2022'
295+ TEST_CONFIGURATION : ' Integration_SQL2022'
296+ pool :
297+ vmImage : $(JOB_VMIMAGE)
298+ timeoutInMinutes : 0
299+ steps :
300+ - task : DownloadPipelineArtifact@2
301+ displayName : ' Download Build Artifact'
302+ inputs :
303+ buildType : ' current'
304+ artifactName : $(buildArtifactName)
305+ targetPath : ' $(Build.SourcesDirectory)/$(buildFolderName)'
306+ - task : PowerShell@2
307+ name : configureWinRM
308+ displayName : ' Configure WinRM'
309+ inputs :
310+ targetType : ' inline'
311+ script : ' winrm quickconfig -quiet'
312+ pwsh : false
313+ - powershell : |
314+ Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
315+ Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
316+ Remove-Module -Name CommonTestHelper
317+ name: cleanCIWorker
318+ displayName: 'Clean CI worker'
319+ - powershell : |
320+ ./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
321+ # Run the integration tests in a specific group order.
322+ # Group 0
323+ 'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
324+ # Group 1
325+ 'tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1'
326+ # Group 8
327+ 'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
328+ # Group 9
329+ 'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
330+ )
331+ name: test
332+ displayName: 'Run Integration Test'
333+ - task : PublishTestResults@2
334+ displayName : ' Publish Test Results'
335+ condition : succeededOrFailed()
336+ inputs :
337+ testResultsFormat : ' NUnit'
338+ testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
339+ testRunTitle : ' Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
340+
341+ - stage : Integration_Test_Commands_BIReportServer
342+ displayName : ' Integration Test Commands - BI Report Server'
343+ dependsOn : Integration_Test_Commands_SqlServer
344+ jobs :
345+ - job : Test_Integration
346+ displayName : ' Commands'
347+ strategy :
348+ matrix :
349+ SQL2022_WIN2019 :
350+ JOB_VMIMAGE : ' windows-2019'
351+ TEST_CONFIGURATION : ' Integration_PowerBI'
352+ SQL2022_WIN2022 :
353+ JOB_VMIMAGE : ' windows-2022'
354+ TEST_CONFIGURATION : ' Integration_PowerBI'
355+ pool :
356+ vmImage : $(JOB_VMIMAGE)
357+ timeoutInMinutes : 0
358+ steps :
359+ - task : DownloadPipelineArtifact@2
360+ displayName : ' Download Build Artifact'
361+ inputs :
362+ buildType : ' current'
363+ artifactName : $(buildArtifactName)
364+ targetPath : ' $(Build.SourcesDirectory)/$(buildFolderName)'
365+ - task : PowerShell@2
366+ name : configureWinRM
367+ displayName : ' Configure WinRM'
368+ inputs :
369+ targetType : ' inline'
370+ script : ' winrm quickconfig -quiet'
371+ pwsh : false
372+ - powershell : |
373+ Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
374+ Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
375+ Remove-Module -Name CommonTestHelper
376+ name: cleanCIWorker
377+ displayName: 'Clean CI worker'
378+ - powershell : |
379+ ./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
380+ # Run the integration tests in a specific group order.
381+ # Group 0
382+ 'tests/Integration/Commands/Prerequisites.Integration.Tests.ps1'
383+ # Group 1
384+ 'tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1'
385+ # Group 8
386+ 'tests/Integration/Commands/Repair-SqlDscBIReportServer.Integration.Tests.ps1'
387+ # Group 9
388+ 'tests/Integration/Commands/Uninstall-SqlDscBIReportServer.Integration.Tests.ps1'
389+ )
390+ name: test
391+ displayName: 'Run Integration Test'
392+ - task : PublishTestResults@2
393+ displayName : ' Publish Test Results'
394+ condition : succeededOrFailed()
395+ inputs :
396+ testResultsFormat : ' NUnit'
397+ testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
398+ testRunTitle : ' Integration Commands ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
399+
400+ - stage : Integration_Test_Resources_SqlServer
401+ displayName : ' Integration Test Resources - SQL Server'
402+ dependsOn : Quality_Test_and_Unit_Test
275403 jobs :
276404 - job : Test_Integration
277405 displayName : ' Integration'
@@ -371,9 +499,12 @@ stages:
371499 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
372500 testRunTitle : ' Integration Resources ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
373501
374- - job : Test_Integration_dbatools
375- displayName : ' Integration (dbatools)'
376- dependsOn : Test_Integration
502+ - stage : Integration_Test_Resources_SqlServer_dbatools
503+ displayName : ' Integration Test Resources - SQL Server (dbatools)'
504+ dependsOn : Integration_Test_Resources_SqlServer
505+ jobs :
506+ - job : Test_Integration
507+ displayName : ' Integration'
377508 strategy :
378509 matrix :
379510 SQL2016_WIN2022 :
@@ -461,8 +592,12 @@ stages:
461592 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
462593 testRunTitle : ' Integration (dbatools) ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
463594
464- - job : Test_Integration_RS
465- displayName : ' Integration Reporting Services'
595+ - stage : Integration_Test_Resources_ReportingServices
596+ displayName : ' Integration Test Resources - Reporting Services'
597+ dependsOn : Integration_Test_Resources_SqlServer
598+ jobs :
599+ - job : Test_Integration
600+ displayName : ' Integration'
466601 strategy :
467602 matrix :
468603 SQL2016_WIN2019 :
@@ -537,9 +672,12 @@ stages:
537672 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
538673 testRunTitle : ' Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
539674
540- - job : Test_Integration_RS_dbatools
541- displayName : ' Integration Reporting Services (dbatools)'
542- dependsOn : Test_Integration_RS
675+ - stage : Integration_Test_Resources_ReportingServices_dbatools
676+ displayName : ' Integration Test Resources - Reporting Services (dbatools)'
677+ dependsOn : Integration_Test_Resources_SqlServer
678+ jobs :
679+ - job : Test_Integration
680+ displayName : ' Integration'
543681 strategy :
544682 matrix :
545683 SQL2016_WIN2022 :
@@ -599,8 +737,13 @@ stages:
599737 - stage : Deploy
600738 dependsOn :
601739 - Quality_Test_and_Unit_Test
602- - Integration_Test_Commands
603- - Integration_Test_Resources
740+ - Integration_Test_Commands_SqlServer
741+ - Integration_Test_Commands_ReportingServices
742+ - Integration_Test_Commands_BIReportServer
743+ - Integration_Test_Resources_SqlServer
744+ - Integration_Test_Resources_SqlServer_dbatools
745+ - Integration_Test_Resources_ReportingServices
746+ - Integration_Test_Resources_ReportingServices_dbatools
604747 condition : |
605748 and(
606749 succeeded(),
0 commit comments