@@ -54,14 +54,15 @@ stages:
5454 publishLocation : ' pipeline'
5555 parallel : true
5656
57- - stage : Test
57+ - stage : Quality_Test_and_Unit_Test
58+ displayName : ' Quality Test and Unit Test'
5859 dependsOn : Build
5960 jobs :
6061 - job : Test_HQRM
6162 displayName : ' HQRM'
6263 pool :
6364 vmImage : ' windows-latest'
64- timeoutInMinutes : 0
65+ timeoutInMinutes : ' 0 '
6566 steps :
6667 - task : DownloadPipelineArtifact@2
6768 displayName : ' Download Pipeline Artifact'
@@ -86,28 +87,19 @@ stages:
8687 testRunTitle : ' HQRM'
8788 condition : succeededOrFailed()
8889
89- - job : Test_Unit_Matrix
90- displayName : ' Unit Tests '
90+ - job : Test_Unit
91+ displayName : ' Unit'
9192 strategy :
9293 matrix :
93- Unit_Windows_Server_2019 :
94- osImage : windows-2019
95- testRunTitle : ' Unit (Windows Server 2019)'
96- publishArtifact : true # Publish the test artifact for code coverage
97- Unit_Windows_Server_2022 :
98- osImage : windows-2022
99- testRunTitle : ' Unit (Windows Server 2022)'
100- publishArtifact : false
101- Unit_Windows_Server_2025 :
102- osImage : windows-2025
103- testRunTitle : ' Unit (Windows Server 2025)'
104- publishArtifact : false
105- variables :
106- testType : Unit
107- configureWinRM : false
94+ Windows Server 2019 :
95+ vmImage : windows-2019
96+ Windows Server 2022 :
97+ vmImage : windows-2022
98+ Windows Server 2025 :
99+ vmImage : windows-2025
108100 pool :
109- vmImage : $(osImage )
110- timeoutInMinutes : 0
101+ vmImage : $(vmImage )
102+ timeoutInMinutes : ' 0 '
111103 steps :
112104 - task : DownloadPipelineArtifact@2
113105 displayName : ' Download Pipeline Artifact'
@@ -117,7 +109,7 @@ stages:
117109 targetPath : ' $(Build.SourcesDirectory)/$(buildArtifactName)'
118110
119111 - task : PowerShell@2
120- displayName : ' Run $(testRunTitle) Test'
112+ displayName : ' Run Unit Test'
121113 inputs :
122114 filePath : ' ./build.ps1'
123115 arguments : " -Tasks test -PesterScript 'tests/Unit'"
@@ -128,23 +120,21 @@ stages:
128120 inputs :
129121 testResultsFormat : NUnit
130122 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
131- testRunTitle : ' $(testRunTitle )'
123+ testRunTitle : ' Unit $(vmImage )'
132124 condition : succeededOrFailed()
133125
134126 - task : PublishPipelineArtifact@1
135127 displayName : ' Publish Test Artifact'
136- condition : eq(variables['publishArtifact'], 'true')
137128 inputs :
138129 targetPath : ' $(buildFolderName)/$(testResultFolderName)/'
139- artifactName : $(testArtifactName)
140- parallel : true
130+ artifactName : ' $(testArtifactName)_$(vmImage)'
141131
142132 - job : Code_Coverage
143133 displayName : ' Publish Code Coverage'
144- dependsOn : Test_Unit_Matrix
134+ dependsOn : Test_Unit
145135 pool :
146136 vmImage : ' ubuntu-latest'
147- timeoutInMinutes : 0
137+ timeoutInMinutes : ' 0 '
148138 steps :
149139 - task : DownloadPipelineArtifact@2
150140 displayName : ' Download Pipeline Artifact'
@@ -157,9 +147,16 @@ stages:
157147 displayName : ' Download Test Artifact'
158148 inputs :
159149 buildType : current
160- artifactName : $(testArtifactName)
161150 targetPath : ' $(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)'
162151
152+ - task : PowerShell@2
153+ name : merge
154+ displayName : ' Merge Code Coverage files'
155+ inputs :
156+ filePath : ' ./build.ps1'
157+ arguments : ' -tasks merge'
158+ pwsh : true
159+
163160 - task : PublishCodeCoverageResults@1
164161 displayName : ' Publish Code Coverage to Azure DevOps'
165162 inputs :
@@ -171,26 +168,23 @@ stages:
171168 bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml"
172169 displayName: 'Upload to Codecov.io'
173170
174- - job : Test_Integration_Matrix
175- displayName : ' Integration Tests'
171+ - stage : Integration_Test
172+ displayName : ' Integration Test'
173+ dependsOn : Quality_Test_and_Unit_Test
174+ jobs :
175+ - job : Test_Integration
176+ displayName : ' Integration'
176177 strategy :
177178 matrix :
178- Integration_Windows_Server_2019 :
179- osImage : windows-2019
180- testRunTitle : ' Integration (Windows Server 2019)'
181- Integration_Windows_Server_2022 :
182- osImage : windows-2022
183- testRunTitle : ' Integration (Windows Server 2022)'
184- Integration_Windows_Server_2025 :
185- osImage : windows-2025
186- testRunTitle : ' Integration (Windows Server 2025)'
187- variables :
188- testType : Integration
189- configureWinRM : true
190- publishArtifact : false
179+ Windows Server 2019 :
180+ vmImage : windows-2019
181+ Windows Server 2022 :
182+ vmImage : windows-2022
183+ Windows Server 2025 :
184+ vmImage : windows-2025
191185 pool :
192- vmImage : $(osImage )
193- timeoutInMinutes : 0
186+ vmImage : $(vmImage )
187+ timeoutInMinutes : ' 0 '
194188 steps :
195189 - task : DownloadPipelineArtifact@2
196190 displayName : ' Download Pipeline Artifact'
@@ -199,17 +193,17 @@ stages:
199193 artifactName : $(buildArtifactName)
200194 targetPath : ' $(Build.SourcesDirectory)/$(buildArtifactName)'
201195
202- # Integration tests need WinRM
203196 - task : PowerShell@2
197+ name : configureWinRM
204198 displayName : ' Configure WinRM'
205- condition : eq(variables['configureWinRM'], 'true')
206199 inputs :
207- targetType : inline
208- script : winrm quickconfig -quiet
200+ targetType : ' inline'
201+ script : ' winrm quickconfig -quiet'
209202 pwsh : false
210203
211204 - task : PowerShell@2
212- displayName : ' Run $(testRunTitle) Test'
205+ name : test
206+ displayName : ' Run Integration Test'
213207 inputs :
214208 filePath : ' ./build.ps1'
215209 arguments : " -Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
@@ -218,13 +212,15 @@ stages:
218212 - task : PublishTestResults@2
219213 displayName : ' Publish Test Results'
220214 inputs :
221- testResultsFormat : NUnit
215+ testResultsFormat : ' NUnit'
222216 testResultsFiles : ' $(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
223- testRunTitle : ' $(testRunTitle)'
217+ testRunTitle : ' Integration $(testRunTitle)'
224218 condition : succeededOrFailed()
225219
226220 - stage : Deploy
227- dependsOn : Test
221+ dependsOn :
222+ - Quality_Test_and_Unit_Test
223+ - Integration_Test
228224 condition : |
229225 and(
230226 succeeded(),
0 commit comments