@@ -54,6 +54,8 @@ parameters:
5454 default : false
5555 - name : OSName
5656 type : string
57+ - name : UseFederatedAuth
58+ type : boolean
5759
5860jobs :
5961 - job :
@@ -134,6 +136,9 @@ jobs:
134136 TestResourcesDirectory : ' $(TestResourcesDirectory)'
135137 SubscriptionConfiguration : $(SubscriptionConfiguration)
136138 ArmTemplateParameters : $(ArmTemplateParameters)
139+ UseFederatedAuth : ${{ parameters.UseFederatedAuth }}
140+ ServiceConnection : ${{ parameters.CloudConfig.ServiceConnection }}
141+ SubscriptionConfigurationFilePath : ${{ parameters.CloudConfig.SubscriptionConfigurationFilePath }}
137142 - ${{ if not(parameters.TestResourceDirectories) }} :
138143 - template : /eng/common/TestResources/deploy-test-resources.yml
139144 parameters :
@@ -143,6 +148,10 @@ jobs:
143148 TestResourcesDirectory : ' $(TestResourcesDirectory)'
144149 SubscriptionConfiguration : $(SubscriptionConfiguration)
145150 ArmTemplateParameters : $(ArmTemplateParameters)
151+ UseFederatedAuth : ${{ parameters.UseFederatedAuth }}
152+ ServiceConnection : ${{ parameters.CloudConfig.ServiceConnection }}
153+ SubscriptionConfigurationFilePath : ${{ parameters.CloudConfig.SubscriptionConfigurationFilePath }}
154+
146155 - pwsh : |
147156 if ($env:SupportsRecording -and $env:Record) {
148157 Write-Host "Enabling Record mode"
@@ -152,30 +161,62 @@ jobs:
152161 - template : /eng/pipelines/templates/steps/install-dotnet.yml
153162 parameters :
154163 Container : ${{ parameters.UsePlatformContainer }}
155- - script : >
156- dotnet test eng/service.proj
157- --framework $(TestTargetFramework)
158- --filter "TestCategory!=Manually & ($(AdditionalTestFilters))"
159- --logger "trx"
160- --logger:"console;verbosity=normal"
161- --blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TimeoutInMinutes}}minutes
162- /p:SDKType=${{ parameters.SDKType }}
163- /p:ServiceDirectory=${{ parameters.ServiceDirectory }}
164- /p:Project=${{ parameters.Project }}
165- /p:IncludeSrc=false
166- /p:IncludeSamples=false
167- /p:IncludePerf=false
168- /p:IncludeStress=false
169- /p:BuildInParallel=${{ parameters.BuildInParallel }}
170- /p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}
171- /p:EnableSourceLink=false
172- $(AdditionalTestArguments)
173-
174- displayName: "Build & Test (all tests for $(TestTargetFramework))"
175- env:
176- AZURE_TEST_MODE: $(TestMode)
177- ${{ each var in parameters.EnvVars }}:
178- ${{ var.key }}: ${{ var.value }}
164+
165+ - ${{ if eq('true', parameters.UseFederatedAuth) }} :
166+ - task : AzurePowerShell@5
167+ displayName : " Build & Test (all tests for $(TestTargetFramework)) - Federated Auth"
168+ inputs :
169+ azureSubscription : ${{ parameters.CloudConfig.ServiceConnection }}
170+ azurePowerShellVersion : LatestVersion
171+ pwsh : true
172+ ScriptType : InlineScript
173+ Inline : >-
174+ dotnet test eng/service.proj
175+ --framework $(TestTargetFramework)
176+ --filter "TestCategory!=Manually & ($(AdditionalTestFilters))"
177+ --logger "trx"
178+ --logger:"console;verbosity=normal"
179+ --blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TimeoutInMinutes}}minutes
180+ /p:SDKType=${{ parameters.SDKType }}
181+ /p:ServiceDirectory=${{ parameters.ServiceDirectory }}
182+ /p:Project=${{ parameters.Project }}
183+ /p:IncludeSrc=false
184+ /p:IncludeSamples=false
185+ /p:IncludePerf=false
186+ /p:IncludeStress=false
187+ /p:BuildInParallel=${{ parameters.BuildInParallel }}
188+ /p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}
189+ /p:EnableSourceLink=false
190+ $(AdditionalTestArguments)
191+ env :
192+ AZURE_TEST_MODE : $(TestMode)
193+ ${{ each var in parameters.EnvVars }} :
194+ ${{ var.key }} : ${{ var.value }}
195+
196+ - ${{ else }} :
197+ - script : >-
198+ dotnet test eng/service.proj
199+ --framework $(TestTargetFramework)
200+ --filter "TestCategory!=Manually & ($(AdditionalTestFilters))"
201+ --logger "trx"
202+ --logger:"console;verbosity=normal"
203+ --blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TimeoutInMinutes}}minutes
204+ /p:SDKType=${{ parameters.SDKType }}
205+ /p:ServiceDirectory=${{ parameters.ServiceDirectory }}
206+ /p:Project=${{ parameters.Project }}
207+ /p:IncludeSrc=false
208+ /p:IncludeSamples=false
209+ /p:IncludePerf=false
210+ /p:IncludeStress=false
211+ /p:BuildInParallel=${{ parameters.BuildInParallel }}
212+ /p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}
213+ /p:EnableSourceLink=false
214+ $(AdditionalTestArguments)
215+ displayName: "Build & Test (all tests for $(TestTargetFramework)) - Client Secret Auth"
216+ env:
217+ AZURE_TEST_MODE: $(TestMode)
218+ ${{ each var in parameters.EnvVars }}:
219+ ${{ var.key }}: ${{ var.value }}
179220
180221 - ${{ if parameters.DeployTestResources }} :
181222 - ${{ if parameters.TestResourceDirectories }} :
@@ -184,11 +225,18 @@ jobs:
184225 parameters :
185226 ServiceDirectory : ' ${{ directory }}'
186227 SubscriptionConfiguration : $(SubscriptionConfiguration)
228+ UseFederatedAuth : ${{ parameters.UseFederatedAuth }}
229+ ServiceConnection : ${{ parameters.CloudConfig.ServiceConnection }}
230+ SubscriptionConfigurationFilePath : ${{ parameters.CloudConfig.SubscriptionConfigurationFilePath }}
231+
187232 - ${{ if not(parameters.TestResourceDirectories) }} :
188233 - template : /eng/common/TestResources/remove-test-resources.yml
189234 parameters :
190235 ServiceDirectory : ' ${{ parameters.ServiceDirectory }}'
191236 SubscriptionConfiguration : $(SubscriptionConfiguration)
237+ UseFederatedAuth : ${{ parameters.UseFederatedAuth }}
238+ ServiceConnection : ${{ parameters.CloudConfig.ServiceConnection }}
239+ SubscriptionConfigurationFilePath : ${{ parameters.CloudConfig.SubscriptionConfigurationFilePath }}
192240
193241 - task : PublishTestResults@2
194242 condition : always()
0 commit comments