@@ -109,10 +109,27 @@ parameters:
109109 type : boolean
110110 default : false
111111
112+ # If tests need to run against an ODSP tenant, specify the type of tenant here. Steps will be injected to lease one for the duration of the test.
113+ - name : odspTenantType
114+ type : string
115+ default : none
116+ values :
117+ - none
118+ - prod
119+ - dogfood
120+
121+ # lockBehavior of the stage (if any).
122+ - name : lockBehavior
123+ type : string
124+ default : none
125+ values :
126+ - none
127+ - sequential
128+
112129stages :
113130- stage : ${{ parameters.stageId}}
114- ${{ if in (parameters.stageId , 'e2e_routerlicious', 'e2e_frs', 'stress_tests_odspdf', 'stress_tests_frs', 'stress_tests_frs_canary ') }} :
115- lockBehavior : sequential
131+ ${{ if ne (parameters.lockBehavior , 'none ') }} :
132+ lockBehavior : ${{ parameters.lockBehavior }}
116133 condition : ${{ parameters.condition }}
117134 displayName : ${{ parameters.stageDisplayName }}
118135 dependsOn : ${{ parameters.stageDependencies }}
@@ -150,7 +167,7 @@ stages:
150167
151168 steps :
152169 # Setup
153- - checkout : git://internal/ ff_pipeline_host
170+ - checkout : ff_pipeline_host
154171 clean : true
155172
156173 # Install self-signed cert for R11s deployment in local cert store
@@ -351,7 +368,7 @@ stages:
351368 path : $(compatVersionInstallsPath)
352369
353370 # Only check out tenants from the tenant pool if we are running tests against ODSP
354- - ${{ if or(eq( parameters.stageId , 'e2e_odsp'), eq(parameters.stageId, 'stress_tests_odsp') ) }} :
371+ - ${{ if ne( parameters.odspTenantType , 'none' ) }} :
355372 # Retrieve a tenant from the tenant pool
356373 - task : AzureCLI@2
357374 displayName : ' Log in to retrieve tenant credentials'
@@ -376,19 +393,24 @@ stages:
376393 set -eu -o pipefail
377394
378395 # Increase the maximum time to wait for a tenant to 1 hour to accommodate multiple test runs at the same time.
379- pnpm exec trips-setup --waitTime=3600 --accessToken=$SYSTEM_ACCESSTOKEN
396+ pnpm exec trips-setup --waitTime=3600 --accessToken=$SYSTEM_ACCESSTOKEN --odspEndpoint=${{ parameters.odspTenantType }}
380397 echo "##vso[task.setvariable variable=tenantSetupSuccess;]true"
381398
382399 # run the test
383400 - task : Npm@1
384401 displayName : ' [test] ${{ parameters.testCommand }} ${{ variant.flags }}'
385402 continueOnError : ${{ parameters.continueOnError }}
386403 env :
387- ${{ if and(ne(parameters.stageId, 'e2e_odsp'), ne(parameters.stageId, 'stress_tests_odsp')) }} :
388- ${{ parameters.env }}
389- ${{ else }} :
390- login__odsp__test__tenants : $(tenantCreds)
404+ ${{ each pair in parameters.env }} :
405+ ${{ pair.key }} : ${{ pair.value }}
406+ # ODSP tenant setup script injects the values here (appClientId, tenantCreds).
407+ # The e2e test workload references the keys (login__*).
408+ ${{ if eq(parameters.odspTenantType, 'dogfood') }} :
409+ login__microsoft__clientId : $(appClientId)
410+ login__odspdf__test__tenants : $(tenantCreds)
411+ ${{ elseif eq(parameters.odspTenantType, 'prod') }} :
391412 login__microsoft__clientId : $(appClientId)
413+ login__odsp__test__tenants : $(tenantCreds)
392414 inputs :
393415 command : ' custom'
394416 workingDir : $(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }}
@@ -439,8 +461,8 @@ stages:
439461 condition : always()
440462 continueOnError : true # Keep running subsequent tasks even if this one fails (e.g. the tinylicious log wasn't there)
441463
442- # Only release tenants that were checked out from the tenant pool for ODSP tests
443- - ${{ if or(eq( parameters.stageId , 'e2e_odsp'), eq(parameters.stageId, 'stress_tests_odsp') ) }} :
464+ # Only release tenants that were checked out from the tenant pool for ODSP/ODSPDF tests
465+ - ${{ if ne( parameters.odspTenantType , 'none' ) }} :
444466 # Login to release tenant credentials
445467 # Currently, some of the compat tests run for longer than 60 minutes and exceed the average token lifetime:
446468 # https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimes#access-tokens
@@ -464,7 +486,7 @@ stages:
464486 targetType : ' inline'
465487 script : |
466488 set -eu -o pipefail
467- pnpm exec trips-cleanup --reservationId=$(stringBearerToken)
489+ pnpm exec trips-cleanup --reservationId=$(stringBearerToken) --odspEndpoint=${{ parameters.odspTenantType }}
468490 condition : eq(variables['tenantSetupSuccess'], 'true')
469491
470492 # Log Test Failures
0 commit comments