@@ -2,13 +2,7 @@ parameters:
22- name : PackageName
33 type : string
44 default : " "
5- - name : PreIntegrationSteps
6- type : string
7- default : " "
8- - name : PostIntegrationSteps
9- type : string
10- default : " "
11- - name : ResourceServiceDirectory
5+ - name : ServiceDirectory
126 type : string
137 default : " "
148- name : EnvVars
@@ -23,161 +17,64 @@ parameters:
2317- name : PublishCodeCoverage
2418 type : boolean
2519 default : false
26- - name : SubscriptionConfiguration
27- type : string
28- default : $(sub-config-azure-cloud-test-resources)
29- - name : ResourceGroupLocation
20+ - name : PreSteps
21+ type : object
22+ default : []
23+ - name : PostSteps
24+ type : object
25+ default : []
26+ - name : Location
3027 type : string
31- default : " "
32- - name : ResourceGroupLocationCanary
28+ default : ' '
29+ - name : CloudConfig
30+ type : object
31+ default : {}
32+ - name : Matrix
3333 type : string
34- default : " centraluseuap"
35- - name : ArmTemplateParameters
34+ - name : DependsOn
3635 type : string
37- default : " @{}"
38- - name : TestBrowser
39- type : boolean
40- default : true
41- - name : TestSamples
42- type : boolean
43- default : true
44- - name : TestMinMax
45- type : boolean
46- default : false
47- - name : TestSame
36+ default : ' '
37+ - name : UsePlatformContainer
4838 type : boolean
4939 default : false
50- - name : TestCanary
51- type : boolean
52- default : false
53- - name : Matrix
54- type : object
55- default :
56- Windows Node 8 :
57- Pool : azsdk-pool-mms-win-2019-general
58- OSVmImage : MMS2019
59- TestType : " node"
60- NodeTestVersion : " 8.x"
61- PublishCodeCoverage : true
62- Linux Node 10 :
63- Pool : azsdk-pool-mms-ubuntu-1804-general
64- OSVmImage : MMSUbuntu18.04
65- TestType : " node"
66- NodeTestVersion : " 10.x"
67- Linux Node 12 :
68- Pool : azsdk-pool-mms-ubuntu-1804-general
69- OSVmImage : MMSUbuntu18.04
70- TestType : " node"
71- NodeTestVersion : " 12.x"
72- MacOS Node 14 :
73- Pool : Azure Pipelines
74- OSVmImage : " macOS-10.15"
75- TestType : " node"
76- NodeTestVersion : " 14.x"
40+
7741
7842jobs :
79- - job : " IntegrationTest"
43+ - job :
44+ dependsOn : ${{ parameters.DependsOn }}
45+ condition : ne(${{ parameters.Matrix }}, '{}')
46+ strategy :
47+ maxParallel : ${{ parameters.MaxParallel }}
48+ matrix : $[ ${{ parameters.Matrix }} ]
8049
8150 variables :
8251 - template : ../variables/globals.yml
83- - name : SubscriptionConfiguration
84- value : ${{ parameters.SubscriptionConfiguration }}
85- - name : ResourceGroupLocation
86- value : ${{ parameters.ResourceGroupLocation }}
8752 - name : ArmTemplateParameters
88- value : ${{ parameters.ArmTemplateParameters }}
89-
90-
91- strategy :
92- maxParallel : ${{ parameters.MaxParallel }}
93- matrix :
94- ${{ each matrixEntry in parameters.Matrix }} :
95- ${{ matrixEntry.key }} :
96- # TestResultsFiles
97- ${{ if eq(matrixEntry.value.TestType, 'browser' )}} :
98- TestResultsFiles : " **/test-results.browser.xml"
99- ${{ if eq(matrixEntry.value.TestType, 'node') }} :
100- TestResultsFiles : " **/test-results.xml"
101- # Remaining entries from the matrix object
102- ${{ insert }} : ${{ matrixEntry.value }}
103- # Include these entries in all test matrices. Note that TestResultsFile
104- # is specified because the template logic above is not running in this
105- # context.
106-
107- # Add matrix entry for browser testing
108- ${{ if eq(parameters.TestBrowser, 'true') }} :
109- Windows Browser :
110- Pool : azsdk-pool-mms-win-2019-general
111- OSVmImage : MMS2019
112- TestType : " browser"
113- NodeTestVersion : " $(NodeVersion)"
114- TestResultsFiles : " **/test-results.browser.xml"
115-
116- # Add matrix entry for sample testing
117- ${{ if eq(parameters.TestSamples, 'true') }} :
118- Samples Linux Node 10 :
119- Pool : azsdk-pool-mms-ubuntu-1804-general
120- OSVmImage : MMSUbuntu18.04
121- TestType : " sample"
122- NodeTestVersion : " 10.x"
123-
124- # Add matrix entry for min-max testing
125- ${{ if eq(parameters.TestMinMax, 'true') }} :
126- MaxVersion_Node :
127- Pool : azsdk-pool-mms-ubuntu-1804-general
128- OSVmImage : MMSUbuntu18.04
129- TestType : " node"
130- DependencyVersion : max
131- NodeTestVersion : " $(NodeVersion)"
132- TestResultsFiles : " **/test-results.xml"
133- MinVersion_Node :
134- Pool : azsdk-pool-mms-ubuntu-1804-general
135- OSVmImage : MMSUbuntu18.04
136- TestType : " node"
137- DependencyVersion : min
138- NodeTestVersion : " $(NodeVersion)"
139- TestResultsFiles : " **/test-results.xml"
140-
141- # Add matrix entry for same dep testing
142- ${{ if eq(parameters.TestSame, 'true') }} :
143- SameVersion_Node :
144- Pool : azsdk-pool-mms-ubuntu-1804-general
145- OSVmImage : MMSUbuntu18.04
146- TestType : " node"
147- DependencyVersion : same
148- NodeTestVersion : " $(NodeVersion)"
149- TestResultsFiles : " **/test-results.xml"
150-
151- # Add matrix entry for canary testing
152- ${{ if eq(parameters.TestCanary, 'true') }} :
153- CanaryTest_Node :
154- Pool : azsdk-pool-mms-ubuntu-1804-general
155- OSVmImage : MMSUbuntu18.04
156- TestType : " node"
157- NodeTestVersion : " $(NodeVersion)"
158- TestResultsFiles : " **/test-results.xml"
159- SubscriptionConfiguration : $(sub-config-azure-cloud-test-resources-preview)
160- ResourceGroupLocation : ${{ parameters.ResourceGroupLocationCanary }}
53+ value : ' @{}'
16154
16255 pool :
16356 name : $(Pool)
16457 vmImage : $(OSVmImage)
16558
16659 timeoutInMinutes : ${{ parameters.TimeoutInMinutes }}
16760
61+ ${{ if eq(parameters.UsePlatformContainer, 'true') }} :
62+ container : $[ variables['Container'] ]
63+
16864 steps :
16965 - template : ../steps/common.yml
17066
17167 - template : /eng/common/pipelines/templates/steps/verify-agent-os.yml
17268 parameters :
17369 AgentImage : $(OSVmImage)
17470
175- - ${{ if ne(parameters.ResourceServiceDirectory , '') }} :
71+ - ${{ if ne(parameters.ServiceDirectory , '') }} :
17672 - template : /eng/common/TestResources/deploy-test-resources.yml
17773 parameters :
178- ServiceDirectory : " ${{ parameters.ResourceServiceDirectory }}"
179- SubscriptionConfiguration : $(SubscriptionConfiguration)
180- Location : $(ResourceGroupLocation)
74+ ${{ if or(parameters.Location, parameters.CloudConfig.Location) }} :
75+ Location : ${{ coalesce(parameters.Location, parameters.CloudConfig.Location) }}
76+ ServiceDirectory : ' ${{ parameters.ServiceDirectory }}'
77+ SubscriptionConfiguration : ${{ parameters.CloudConfig.SubscriptionConfiguration }}
18178 ArmTemplateParameters : $(ArmTemplateParameters)
18279
18380 - script : |
19693 node common/scripts/install-run-rush.js build:test -t "${{parameters.PackageName}}" --verbose -p max
19794 displayName: "Build test assets"
19895 condition: and(succeededOrFailed(),eq(variables['DependencyVersion'],''))
199-
96+
20097 - script : |
20198 npm install
20299 node index.js --artifact-name "${{parameters.PackageName}}" --version-type $(DependencyVersion) --source-dir "$(Build.SourcesDirectory)" --test-folder "test/public"
@@ -216,8 +113,7 @@ jobs:
216113 workingDirectory: $(PackageTestPath)
217114 condition: and(succeededOrFailed(),ne(variables['DependencyVersion'],''))
218115
219- - ${{if ne(parameters.PreIntegrationSteps, '')}} :
220- - template : ../steps/${{parameters.PreIntegrationSteps}}.yml
116+ - ${{ parameters.PreSteps }}
221117
222118 - pwsh : |
223119 npm install
@@ -247,8 +143,7 @@ jobs:
247143 TEST_MODE: "live"
248144 ${{ insert }}: ${{ parameters.EnvVars }}
249145
250- - ${{if ne(parameters.PostIntegrationSteps, '')}} :
251- - template : ../steps/${{parameters.PostIntegrationSteps}}.yml
146+ - ${{ parameters.PostSteps }}
252147
253148 - script : |
254149 node common/scripts/npm-run-project.js "${{parameters.PackageName}}" execute:samples
@@ -258,11 +153,11 @@ jobs:
258153 ${{ insert }}: ${{ parameters.EnvVars }}
259154 condition: and(succeeded(),eq(variables['TestType'],'sample'))
260155
261- - ${{ if ne(parameters.ResourceServiceDirectory , '') }} :
156+ - ${{ if ne(parameters.ServiceDirectory , '') }} :
262157 - template : /eng/common/TestResources/remove-test-resources.yml
263158 parameters :
264- ServiceDirectory : " ${{ parameters.ResourceServiceDirectory }}"
265- SubscriptionConfiguration : $( SubscriptionConfiguration)
159+ ServiceDirectory : " ${{ parameters.ServiceDirectory }}"
160+ SubscriptionConfiguration : ' ${{ parameters.CloudConfig. SubscriptionConfiguration }} '
266161
267162 - task : PublishCodeCoverageResults@1
268163 displayName : " Publish NodeJs Code Coverage to DevOps"
@@ -302,17 +197,12 @@ jobs:
302197 - task : PublishTestResults@2
303198 inputs :
304199 searchFolder : " $(System.DefaultWorkingDirectory)/sdk"
305- testResultsFiles : " **/test-results.xml"
306- testRunTitle : " $(OSName) - NodeJS - Integration Tests - [Node $(NodeTestVersion)]"
307- condition : and(always(), eq(variables['TestType'], 'node'))
308- displayName : " Publish NodeJS integration test results"
309-
310- # It's important for performance to pass "sdk" as "searchFolder" to avoid looking under root "node_modules".
311- # PublishTestResults.searchFolder only supports absolute paths, not relative.
312- - task : PublishTestResults@2
313- inputs :
314- searchFolder : " $(System.DefaultWorkingDirectory)/sdk"
315- testResultsFiles : " **/test-results.browser.xml"
316- testRunTitle : " $(OSName) - Browser - Integration Tests - [Node $(NodeTestVersion)]"
317- condition : and(always(), eq(variables['TestType'], 'browser'))
318- displayName : " Publish browser integration test results"
200+ testResultsFiles : " $(TestResultsFiles)"
201+ testRunTitle : " $(OSName) - $(TestType) - Integration Tests - [Node $(NodeTestVersion)]"
202+ condition : >
203+ and(
204+ always(),
205+ ne(variables['TestResultsFiles'], ''),
206+ or(eq(variables['TestType'], 'node'), eq(variables['TestType'], 'browser'))
207+ )
208+ displayName : " Publish $(TestType) integration test results"
0 commit comments