diff --git a/azure-pipelines-internal-tests.yml b/azure-pipelines-internal-tests.yml index 02278646f5c..3296bada682 100644 --- a/azure-pipelines-internal-tests.yml +++ b/azure-pipelines-internal-tests.yml @@ -160,15 +160,39 @@ extends: demands: ImageOverride -equals 1es-ubuntu-2204 os: linux variables: + - _runCounter: $[counter(variables['Build.Reason'], 0)] # Rely on task Arcade injects, not auto-injected build step. - skipComponentGovernanceDetection: true + - ${{ if notin(variables['Build.Reason'], 'PullRequest', 'Schedule') }}: + - _CosmosConnectionUrl: 'true' steps: + - bash: | + echo "##vso[task.setvariable variable=_CosmosConnectionUrl]https://ef-nightly-test.documents.azure.com:443/" + displayName: Prepare to run Cosmos tests on ef-nightly-test + condition: and(eq(variables['_CosmosConnectionUrl'], 'true'), or(endsWith(variables['_runCounter'], '0'), endsWith(variables['_runCounter'], '2'), endsWith(variables['_runCounter'], '4'), endsWith(variables['_runCounter'], '6'), endsWith(variables['_runCounter'], '8'))) + - bash: | + echo "##vso[task.setvariable variable=_CosmosConnectionUrl]https://ef-pr-test.documents.azure.com:443/" + displayName: Prepare to run Cosmos tests on ef-pr-test + condition: and(eq(variables['_CosmosConnectionUrl'], 'true'), or(endsWith(variables['_runCounter'], '1'), endsWith(variables['_runCounter'], '3'), endsWith(variables['_runCounter'], '5'), endsWith(variables['_runCounter'], '7'), endsWith(variables['_runCounter'], '9'))) - template: /eng/common/templates-official/steps/enable-internal-sources.yml - template: /eng/common/templates-official/steps/enable-internal-runtimes.yml - script: eng/common/build.sh --restore --build --test --pack --ci --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs) displayName: Build + - task: AzureCLI@2 + displayName: Run Cosmos tests + condition: notin(variables['Build.Reason'], 'PullRequest', 'Schedule') + inputs: + azureSubscription: EFCosmosTesting + addSpnToEnvironment: true + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + ./test.sh --ci --configuration $(_BuildConfig) --projects $(Build.SourcesDirectory)/test/EFCore.Cosmos.FunctionalTests/EFCore.Cosmos.FunctionalTests.csproj env: Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl) + Test__Cosmos__UseTokenCredential: true + Test__Cosmos__SubscriptionId: d709b837-4a74-4aec-addc-b6e4b9b23e7e + Test__Cosmos__ResourceGroup: efcosmosci name: Build templateContext: sdl: