diff --git a/eng/common/pipelines/templates/steps/bypass-local-dns.yml b/eng/common/pipelines/templates/steps/bypass-local-dns.yml index 54f49c33714b..91b5c4978303 100644 --- a/eng/common/pipelines/templates/steps/bypass-local-dns.yml +++ b/eng/common/pipelines/templates/steps/bypass-local-dns.yml @@ -3,4 +3,9 @@ steps: # https://github.com/actions/virtual-environments/issues/798 - script: sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf displayName: Bypass local DNS server to workaround issue resolving cognitiveservices names - condition: and(succeededOrFailed(), eq(variables['OSVmImage'], 'ubuntu-18.04')) \ No newline at end of file + condition: | + and( + succeededOrFailed(), + eq(variables['OSVmImage'], 'ubuntu-18.04'), + eq(variables['Container'], '') + ) diff --git a/eng/common/pipelines/templates/steps/verify-agent-os.yml b/eng/common/pipelines/templates/steps/verify-agent-os.yml index 4551279e13c0..12eaa0d3e1e1 100644 --- a/eng/common/pipelines/templates/steps/verify-agent-os.yml +++ b/eng/common/pipelines/templates/steps/verify-agent-os.yml @@ -1,4 +1,4 @@ -parameters: +parameters: OSVmImage: $(OSVmImage) steps: diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests-host.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests-host.yml new file mode 100644 index 000000000000..7b9877f9e227 --- /dev/null +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests-host.yml @@ -0,0 +1,40 @@ +parameters: +- name: AdditionalParameters + type: object +- name: CloudConfig + type: object + default: {} +- name: Platforms + type: object + default: {} +- name: UsePlatformContainer + type: boolean + default: false + +jobs: + # There is no way to specify the container and/or target fields with a runtime value + # in a way that supports both containers and VMs as hosts, so this compile time + # switch is a workaround to support specifying host type. + - template: ./archetype-sdk-tests-jobs.yml + parameters: + UsePlatformContainer: false + Platforms: + ${{ each platform in parameters.Platforms }}: + ${{ if eq(platform.value.Container, '') }}: + ${{ platform.key }}: ${{ platform.value }} + CloudConfig: ${{ parameters.CloudConfig }} + ${{ each param in parameters.AdditionalParameters }}: + ${{ param.key }}: ${{ param.value }} + # Only include the template if we know there is a platform with a container, + # otherwise azure pipelines will populate a blank job with an empty matrix + - ${{ if eq(parameters.UsePlatformContainer, 'true') }}: + - template: ./archetype-sdk-tests-jobs.yml + parameters: + UsePlatformContainer: true + Platforms: + ${{ each platform in parameters.Platforms }}: + ${{ if ne(platform.value.Container, '') }}: + ${{ platform.key }}: ${{ platform.value }} + CloudConfig: ${{ parameters.CloudConfig }} + ${{ each param in parameters.AdditionalParameters }}: + ${{ param.key }}: ${{ param.value }} diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml index 40f3a0e333ce..131426320893 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml @@ -1,7 +1,4 @@ parameters: -- name: Platforms - type: object - default: [] - name: PreSteps type: object default: [] @@ -29,86 +26,89 @@ parameters: - name: TestSetupSteps type: stepList default: [] -- name: CloudConfigurations +- name: CloudConfig + type: object + default: {} +- name: Platforms type: object - default: - AzureCloud: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + default: {} +- name: UsePlatformContainer + type: boolean + default: false jobs: - - ${{ each cloudConfig in parameters.CloudConfigurations }}: - - ${{ each platform in parameters.Platforms }}: - - job: - condition: and(succeededOrFailed(), eq(eq(variables['Record'], 'true'), eq('${{ platform.TestMode }}', 'Record'))) - displayName: ${{ platform.DisplayName }}_${{ cloudConfig.key }} - variables: - - template: ../variables/globals.yml - - name: OSVmImage - value: ${{ platform.OSVmImage }} + - job: + strategy: + maxParallel: ${{ parameters.MaxParallel }} + matrix: ${{ parameters.Platforms }} - timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} + condition: and(succeededOrFailed(), eq(eq(variables['Record'], 'true'), eq('$(TestMode)', 'Record'))) + variables: + - template: ../variables/globals.yml + # ServiceDirectory references must get passed down by the caller as variable references + - name: ServiceDirectory + value: ${{ parameters.ServiceDirectory }} + - name: AdditionalTestArguments + value: '' + - name: ArmTemplateParameters + value: '@{}' - pool: - vmImage: $(OSVmImage) - ${{ if platform.Container }}: - container: ${{ platform.Container }} + timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} - steps: - - ${{ if platform.PreSteps }}: - - ${{ platform.PreSteps }} + pool: + vmImage: $(OSVmImage) - - ${{ parameters.PreSteps }} + ${{ if eq(parameters.UsePlatformContainer, 'true') }}: + container: $[ variables['Container'] ] - - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + steps: + - ${{ parameters.PreSteps }} - - ${{ each step in parameters.TestSetupSteps }}: - - ${{ each pair in step }}: - ${{ pair.key }}: ${{ pair.value }} + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - - template: /eng/common/TestResources/deploy-test-resources.yml - parameters: - Location: ${{ coalesce(parameters.Location, cloudConfig.value.Location, 'westus2') }} - ServiceDirectory: '${{ parameters.ServiceDirectory }}' - SubscriptionConfiguration: ${{ cloudConfig.value.SubscriptionConfiguration }} - ArmTemplateParameters: ${{ cloudConfig.value.ArmTemplateParameters }} + - ${{ each step in parameters.TestSetupSteps }}: + - ${{ each pair in step }}: + ${{ pair.key }}: ${{ pair.value }} - - script: > - dotnet test eng/service.proj - --framework ${{ platform.TestTargetFramework }} - --filter "TestCategory!=Manually" - --logger "trx" - --logger:"console;verbosity=normal" - /p:ServiceDirectory=${{ parameters.ServiceDirectory }} - /p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false - /p:BuildInParallel=${{ parameters.BuildInParallel }} - ${{ platform.AdditionalTestArguments }} + - template: /eng/common/TestResources/deploy-test-resources.yml + parameters: + Location: ${{ coalesce(parameters.Location, parameters.CloudConfig.Location, 'westus2') }} + ServiceDirectory: '${{ parameters.ServiceDirectory }}' + SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }} + ArmTemplateParameters: $(ArmTemplateParameters) - displayName: "Build & Test (all tests for ${{ platform.TestTargetFramework }})" - env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_MULTILEVEL_LOOKUP: 0 - AZURE_TEST_MODE: "${{ coalesce(platform.TestMode, 'None') }}" - ${{ each var in parameters.EnvVars }}: - ${{ var.key }}: ${{ var.value }} - ${{ each var in cloudConfig.value.EnvVars }}: - ${{ var.key }}: ${{ var.value }} + - pwsh: > + dotnet test eng/service.proj + --framework $(TestTargetFramework) + --filter "TestCategory!=Manually" + --logger "trx" + --logger:"console;verbosity=normal" + /p:ServiceDirectory=${{ parameters.ServiceDirectory }} + /p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false + /p:BuildInParallel=${{ parameters.BuildInParallel }} + $(AdditionalTestArguments) - - template: /eng/common/TestResources/remove-test-resources.yml - parameters: - ServiceDirectory: '${{ parameters.ServiceDirectory }}' - SubscriptionConfiguration: ${{ cloudConfig.value.SubscriptionConfiguration }} + displayName: "Build & Test (all tests for $(TestTargetFramework))" + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_MULTILEVEL_LOOKUP: 0 + AZURE_TEST_MODE: "${{ coalesce(variables['TestMode'], 'None') }}" + ${{ each var in parameters.EnvVars }}: + ${{ var.key }}: ${{ var.value }} - - task: PublishTestResults@2 - condition: always() - displayName: "Publish Results (${{ platform.TestTargetFramework }})" - inputs: - testResultsFiles: "**/*.trx" - testRunTitle: "$(OSName) ${{ platform.TestTargetFramework }}" - testResultsFormat: "VSTest" - mergeTestResults: true + - template: /eng/common/TestResources/remove-test-resources.yml + parameters: + ServiceDirectory: '${{ parameters.ServiceDirectory }}' + SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }} - - ${{ parameters.PostSteps }} + - task: PublishTestResults@2 + condition: always() + displayName: "Publish Results ($(TestTargetFramework))" + inputs: + testResultsFiles: "**/*.trx" + testRunTitle: "$(TestTargetFramework)" + testResultsFormat: "VSTest" + mergeTestResults: true - - ${{ if platform.PostSteps }}: - - ${{ platform.PostSteps }} + - ${{ parameters.PostSteps }} diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml deleted file mode 100644 index 957fa349e7cf..000000000000 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ /dev/null @@ -1,158 +0,0 @@ -parameters: -- name: AdditionalPlatforms - type: object - default: [] -- name: PreSteps - type: object - default: [] -- name: PostSteps - type: object - default: [] -- name: EnvVars - type: object - default: {} -- name: MaxParallel - type: number - default: 0 -- name: BuildInParallel - type: boolean - default: true -- name: TimeoutInMinutes - type: number - default: 60 -- name: Location - type: string - default: '' -- name: SubscriptionConfiguration - type: string - default: $(sub-config-azure-cloud-test-resources) -- name: TestCanary - type: boolean - default: false -- name: ResourceGroupLocationCanary - type: string - default: "centraluseuap" -- name: ServiceDirectory - type: string - default: not-specified -- name: TestSetupSteps - type: stepList - default: [] -- name: Clouds - type: string - default: 'AzureCloud' - -jobs: -- template: archetype-sdk-tests-jobs.yml - parameters: - PreSteps: ${{ parameters.PreSteps }} - PostSteps: ${{ parameters.PostSteps }} - EnvVars: ${{ parameters.EnvVars }} - MaxParallel: ${{ parameters.MaxParallel }} - BuildInParallel: ${{ parameters.BuildInParallel }} - TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} - Location: ${{ parameters.Location }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - TestSetupSteps: ${{ parameters.TestSetupSteps }} - CloudConfigurations: - ${{ if contains(parameters.Clouds, 'AzureCloud') }}: - AzureCloud: - SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} - ArmTemplateParameters: >- - @{ keyVaultDomainSuffix = '.vault.azure.net'; - storageEndpointSuffix = 'core.windows.net'; - endpointSuffix = '.cognitiveservices.azure.com'; - azureAuthorityHost = 'https://login.microsoftonline.com/'; - keyVaultEndpointSuffix = '.vault.azure.net' - } - EnvVars: - SERVICE_MANAGEMENT_URL: https://management.core.windows.net/ - STORAGE_ENDPOINT_SUFFIX: core.windows.net - RESOURCE_MANAGER_URL: https://management.azure.com/ - SEARCH_ENDPOINT_SUFFIX: search.windows.net - COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com - ${{ if contains(parameters.Clouds, 'AzureUsGovCloud') }}: - AzureUsGovCloud: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - ArmTemplateParameters: >- - @{ keyVaultDomainSuffix = '.vault.usgovcloudapi.net'; - storageEndpointSuffix = 'core.usgovcloudapi.net'; - endpointSuffix = '.cognitiveservices.azure.us'; - azureAuthorityHost = 'https://login.microsoftonline.us/'; - keyVaultEndpointSuffix = '.vault.usgovcloudapi.net'; - enableStorageVersioning = $false - } - EnvVars: - AZURE_AUTHORITY_HOST: https://login.microsoftonline.us - RESOURCE_MANAGER_URL: https://management.usgovcloudapi.net/ - STORAGE_ENDPOINT_SUFFIX: core.usgovcloudapi.net - SERVICE_MANAGEMENT_URL: https://management.core.usgovcloudapi.net/ - SEARCH_ENDPOINT_SUFFIX: search.azure.us - COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.us - ${{ if contains(parameters.Clouds, 'AzureChinaCloud') }}: - AzureChinaCloud: - SubscriptionConfiguration: $(sub-config-cn-test-resources) - ArmTemplateParameters: >- - @{ keyVaultDomainSuffix = '.vault.azure.cn'; - storageEndpointSuffix = 'core.chinacloudapi.cn'; - azureAuthorityHost = 'https://login.chinacloudapi.cn/'; - keyVaultEndpointSuffix = '.vault.azure.cn'; - keyVaultSku = 'standard'; - enableStorageVersioning = $false; - endpointSuffix = '.cognitiveservices.azure.cn'; - textAnalyticsSku = 'S' - } - EnvVars: - AZURE_AUTHORITY_HOST: https://login.chinacloudapi.cn - SERVICE_MANAGEMENT_URL: https://management.core.chinacloudapi.cn/ - RESOURCE_MANAGER_URL: https://management.chinacloudapi.cn - STORAGE_ENDPOINT_SUFFIX: core.chinacloudapi.cn - SEARCH_ENDPOINT_SUFFIX: search.azure.cn - COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.cn - platforms: - - DisplayName: "Test on Linux" - OSVmImage: "ubuntu-18.04" - TestTargetFramework: netcoreapp2.1 - PreSteps: - - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml - - DisplayName: "Test on Windows for NetCoreApp" - OSVmImage: "windows-2019" - TestTargetFramework: netcoreapp2.1 - - DisplayName: "Test on Windows for NetCoreApp with UseProjectReferenceToAzureClients=true" - OSVmImage: "windows-2019" - TestTargetFramework: netcoreapp2.1 - AdditionalTestArguments: /p:UseProjectReferenceToAzureClients=true - - DisplayName: "Test on Windows for .Net Framework" - OSVmImage: "windows-2019" - TestTargetFramework: net461 - - DisplayName: "Test on Windows for .Net Framework with UseProjectReferenceToAzureClients=true" - OSVmImage: "windows-2019" - TestTargetFramework: net461 - AdditionalTestArguments: /p:UseProjectReferenceToAzureClients=true - - DisplayName: "Test on MacOS" - OSVmImage: "macOS-10.15" - TestTargetFramework: netcoreapp2.1 - - ${{ if eq(parameters.TestCanary, 'true') }}: - - DisplayName: "Test on Windows for NetCoreApp - Canary region" - OSVmImage: "windows-2019" - TestTargetFramework: netcoreapp2.1 - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) - Location: ${{ parameters.ResourceGroupLocationCanary }} - - DisplayName: "Record on Windows for NetCoreApp" - OSVmImage: "windows-2019" - TestMode: Record - TestTargetFramework: netcoreapp2.1 - PostSteps: - - task: CopyFiles@2 - displayName: "Copy Test Recordings" - inputs: - sourceFolder: '$(Build.SourcesDirectory)' - contents: 'sdk/${{ parameters.ServiceDirectory }}/**/SessionRecords/**/*.json' - targetFolder: '$(Build.ArtifactStagingDirectory)/SessionRecords' - - task: PublishBuildArtifacts@1 - displayName: "Publish Test Recordings" - inputs: - pathToPublish: '$(Build.ArtifactStagingDirectory)/SessionRecords' - artifactName: SessionRecords - - - ${{ parameters.AdditionalPlatforms }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index a3afd112fbc9..49972ed7e2b6 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -53,4 +53,4 @@ stages: TestPipeline: ${{ parameters.TestPipeline }} ArtifactName: packages TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }} - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} \ No newline at end of file + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml new file mode 100644 index 000000000000..a0113850bb4c --- /dev/null +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -0,0 +1,144 @@ +parameters: +- name: AdditionalPlatforms + type: object + default: {} +- name: Clouds + type: string + default: 'Public' +- name: UnsupportedClouds + type: string + default: '' +- name: PreSteps + type: object + default: [] +- name: PostSteps + type: object + default: [] +- name: EnvVars + type: object + default: {} +- name: MaxParallel + type: number + default: 0 +- name: BuildInParallel + type: boolean + default: true +- name: TimeoutInMinutes + type: number + default: 60 +- name: Location + type: string + default: '' +- name: ServiceDirectory + type: string + default: not-specified +- name: TestSetupSteps + type: stepList + default: [] +- name: CloudConfig + type: object + default: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Preview: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Canary: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus2euap' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) +- name: Platforms + type: object + default: + Linux_NetCore: + OSVmImage: "ubuntu-18.04" + TestTargetFramework: netcoreapp2.1 + Windows_NetCore: + OSVmImage: "windows-2019" + TestTargetFramework: netcoreapp2.1 + Windows_NetCore_ProjectRefAzureClients: + OSVmImage: "windows-2019" + TestTargetFramework: netcoreapp2.1 + AdditionalTestArguments: "/p:UseProjectReferenceToAzureClients=true" + Windows_NetFramework: + OSVmImage: "windows-2019" + TestTargetFramework: net461 + Windows_NetFramework_ProjectRefAzureClients: + OSVmImage: "windows-2019" + TestTargetFramework: net461 + AdditionalTestArguments: "/p:UseProjectReferenceToAzureClients=true" + MacOS: + OSVmImage: "macOS-10.15" + TestTargetFramework: netcoreapp2.1 + SupportedClouds: 'Public' + Windows_NetCore_Record: + OSVmImage: "windows-2019" + TestMode: Record + TestTargetFramework: netcoreapp2.1 + SupportedClouds: 'Public' +- name: PlatformPreSteps + type: object + default: + - template: /eng/common/pipelines/templates/steps/bypass-local-dns.yml +- name: PlatformPostSteps + type: object + default: + - task: CopyFiles@2 + condition: and(succeededOrFailed(), eq(variables['Agent.JobName'], 'Windows_NetCore_Record')) + displayName: "Copy Test Recordings" + inputs: + sourceFolder: '$(Build.SourcesDirectory)' + # NOTE: ServiceDirectory cannot be passed as a compile time value, because it cannot be rendered + # in the context of a parameter definition. + contents: 'sdk/$(ServiceDirectory)/**/SessionRecords/**/*.json' + targetFolder: '$(Build.ArtifactStagingDirectory)/SessionRecords' + - task: PublishBuildArtifacts@1 + condition: and(succeededOrFailed(), eq(variables['Agent.JobName'], 'Windows_NetCore_Record')) + displayName: "Publish Test Recordings" + inputs: + pathToPublish: '$(Build.ArtifactStagingDirectory)/SessionRecords' + artifactName: SessionRecords + + +stages: +- ${{ each cloud in parameters.CloudConfig }}: + # Run all clouds by default for weekly test pipeline, except for clouds specifically unsupported by the calling pipeline + - ${{ if or(contains(parameters.Clouds, cloud.key), contains(variables['Build.DefinitionName'], 'tests-weekly')) }}: + - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: + - stage: ${{ cloud.key }} + dependsOn: [] + jobs: + - template: ../jobs/archetype-sdk-tests-host.yml + parameters: + # Flag to include the job template with a container field + ${{ each platform in parameters.AdditionalPlatforms }}: + ${{ if contains(coalesce(platform.value.SupportedClouds, parameters.Clouds), cloud.key) }}: + ${{ if ne(platform.value.Container, '') }}: + UsePlatformContainer: true + AdditionalParameters: + PreSteps: + - ${{ parameters.PlatformPreSteps }} + - ${{ parameters.PreSteps }} + PostSteps: + - ${{ parameters.PlatformPostSteps }} + - ${{ parameters.PostSteps }} + EnvVars: ${{ parameters.EnvVars }} + MaxParallel: ${{ parameters.MaxParallel }} + BuildInParallel: ${{ parameters.BuildInParallel }} + TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} + Location: ${{ parameters.Location }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + TestSetupSteps: ${{ parameters.TestSetupSteps }} + Platforms: + # Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix). + ${{ each platform in parameters.Platforms }}: + ${{ if contains(coalesce(platform.value.SupportedClouds, parameters.Clouds), cloud.key) }}: + ${{ platform.key }}: ${{ platform.value }} + ${{ each platform in parameters.AdditionalPlatforms }}: + ${{ if contains(coalesce(platform.value.SupportedClouds, parameters.Clouds), cloud.key) }}: + ${{ platform.key }}: ${{ platform.value }} + CloudConfig: + SubscriptionConfiguration: ${{ cloud.value.SubscriptionConfiguration }} + Location: ${{ coalesce(parameters.Location, cloud.value.Location) }} diff --git a/sdk/anomalydetector/tests.yml b/sdk/anomalydetector/tests.yml index 45cd18f596b5..4aa8ab062b30 100644 --- a/sdk/anomalydetector/tests.yml +++ b/sdk/anomalydetector/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: anomalydetector \ No newline at end of file + ServiceDirectory: anomalydetector diff --git a/sdk/appconfiguration/tests.yml b/sdk/appconfiguration/tests.yml index 4944bde6d788..9731bacae180 100644 --- a/sdk/appconfiguration/tests.yml +++ b/sdk/appconfiguration/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: appconfiguration \ No newline at end of file + ServiceDirectory: appconfiguration diff --git a/sdk/communication/tests.yml b/sdk/communication/tests.yml index c6228f5bcaab..535f040dfecf 100644 --- a/sdk/communication/tests.yml +++ b/sdk/communication/tests.yml @@ -1,8 +1,8 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: communication EnvVars: - AZURE_COMMUNICATION_TEST_MODE: Record \ No newline at end of file + AZURE_COMMUNICATION_TEST_MODE: Record diff --git a/sdk/core/tests.yml b/sdk/core/tests.yml index 18a409be5c0d..c96181c059d3 100644 --- a/sdk/core/tests.yml +++ b/sdk/core/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: core \ No newline at end of file + ServiceDirectory: core diff --git a/sdk/digitaltwins/tests.yml b/sdk/digitaltwins/tests.yml index 2f799c176aa1..b92cfc80ff92 100644 --- a/sdk/digitaltwins/tests.yml +++ b/sdk/digitaltwins/tests.yml @@ -1,8 +1,8 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: digitaltwins Location: westus2 - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) \ No newline at end of file + Clouds: Preview diff --git a/sdk/eventgrid/tests.yml b/sdk/eventgrid/tests.yml index f9763595b91b..32e927f49c34 100644 --- a/sdk/eventgrid/tests.yml +++ b/sdk/eventgrid/tests.yml @@ -1,8 +1,8 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: eventgrid EnvVars: - AZURE_EVENTGRID_TEST_MODE: Live \ No newline at end of file + AZURE_EVENTGRID_TEST_MODE: Live diff --git a/sdk/eventhub/tests.yml b/sdk/eventhub/tests.yml index 492b7b098694..cdcbfa4eecd8 100644 --- a/sdk/eventhub/tests.yml +++ b/sdk/eventhub/tests.yml @@ -1,9 +1,9 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: MaxParallel: 6 ServiceDirectory: eventhub TimeoutInMinutes: 150 - TestCanary: true \ No newline at end of file + Clouds: 'Public,Canary' diff --git a/sdk/extensions/tests.yml b/sdk/extensions/tests.yml index 0de69921c55a..fe008f3e60ec 100644 --- a/sdk/extensions/tests.yml +++ b/sdk/extensions/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: extensions \ No newline at end of file + ServiceDirectory: extensions diff --git a/sdk/formrecognizer/tests.yml b/sdk/formrecognizer/tests.yml index 8406ac8cea63..ff70fb62722a 100644 --- a/sdk/formrecognizer/tests.yml +++ b/sdk/formrecognizer/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: formrecognizer \ No newline at end of file + ServiceDirectory: formrecognizer diff --git a/sdk/identity/tests.yml b/sdk/identity/tests.yml index 6da10a227dcd..2c88be789f77 100644 --- a/sdk/identity/tests.yml +++ b/sdk/identity/tests.yml @@ -1,26 +1,34 @@ trigger: none +resources: + containers: + - container: 'ubuntu_netcore_keyring' + image: 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore_keyring:523386' + endpoint: 'azsdkengsys' + options: -ti --cap-add=IPC_LOCK + extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: AdditionalPlatforms: - DisplayName: 'Test on Linux with keyring' - OSVmImage: "ubuntu-18.04" - TestTargetFramework: netcoreapp2.1 - Container: - image: 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore_keyring:523386' - endpoint: 'azsdkengsys' - options: -ti --cap-add=IPC_LOCK - PreSteps: - - script: | - set -x - export $(dbus-launch) - gnome-keyring-daemon --start --daemonize --components=secrets - echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_ADDRESS]$DBUS_SESSION_BUS_ADDRESS" - echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_PID]$DBUS_SESSION_BUS_PID" - echo "##vso[task.setvariable variable=GNOME_KEYRING_CONTROL]$GNOME_KEYRING_CONTROL" - ServiceDirectory: identity + Linux_NetCore_Keyring: + OSVmImage: "ubuntu-18.04" + TestTargetFramework: 'netcoreapp2.1' + Container: 'ubuntu_netcore_keyring' + SupportedClouds: 'Public,Canary,Preview' + ServiceDirectory: identity PreSteps: + - pwsh: Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose + displayName: Install Azure PowerShell module + condition: and(succeededOrFailed(), eq(variables['Agent.JobName'], 'Linux_NetCore_Keyring')) + - script: | + set -x + export $(dbus-launch) + gnome-keyring-daemon --start --daemonize --components=secrets + echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_ADDRESS]$DBUS_SESSION_BUS_ADDRESS" + echo "##vso[task.setvariable variable=DBUS_SESSION_BUS_PID]$DBUS_SESSION_BUS_PID" + echo "##vso[task.setvariable variable=GNOME_KEYRING_CONTROL]$GNOME_KEYRING_CONTROL" + condition: and(succeededOrFailed(), eq(variables['Agent.JobName'], 'Linux_NetCore_Keyring')) - pwsh: | [System.Convert]::FromBase64String($env:PFX_CONTENTS) | Set-Content -Path $(Agent.TempDirectory)/test.pfx -AsByteStream Set-Content -Path $(Agent.TempDirectory)/test.pem -Value $env:PEM_CONTENTS diff --git a/sdk/iot/tests.yml b/sdk/iot/tests.yml index 19083c9355d3..ed8ddfd207ea 100644 --- a/sdk/iot/tests.yml +++ b/sdk/iot/tests.yml @@ -1,7 +1,7 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: iot - Location: westcentralus \ No newline at end of file + Location: westcentralus diff --git a/sdk/keyvault/tests.yml b/sdk/keyvault/tests.yml index 06490c9edbe9..0f667aa67a44 100644 --- a/sdk/keyvault/tests.yml +++ b/sdk/keyvault/tests.yml @@ -1,7 +1,7 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: keyvault TimeoutInMinutes: 120 diff --git a/sdk/schemaregistry/tests.yml b/sdk/schemaregistry/tests.yml index 379b7aeb30ba..293be545064f 100644 --- a/sdk/schemaregistry/tests.yml +++ b/sdk/schemaregistry/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: schemaregistry \ No newline at end of file + ServiceDirectory: schemaregistry diff --git a/sdk/search/tests.yml b/sdk/search/tests.yml index e49aaf0d53f6..f66a1da0cff6 100644 --- a/sdk/search/tests.yml +++ b/sdk/search/tests.yml @@ -1,7 +1,7 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: search TimeoutInMinutes: 120 diff --git a/sdk/servicebus/tests.yml b/sdk/servicebus/tests.yml index 28d0e3b70c6a..56c04dfa83a3 100644 --- a/sdk/servicebus/tests.yml +++ b/sdk/servicebus/tests.yml @@ -1,9 +1,9 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: MaxParallel: 4 ServiceDirectory: servicebus TimeoutInMinutes: 120 - TestCanary: true \ No newline at end of file + Clouds: 'Public,Canary' diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index baf511d32f82..8ac4f5200e26 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -1,13 +1,13 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: storage BuildInParallel: true TimeoutInMinutes: 90 Location: canadacentral - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Clouds: Preview TestSetupSteps: - template: /sdk/storage/tests-install-azurite.yml EnvVars: diff --git a/sdk/synapse/tests.yml b/sdk/synapse/tests.yml index 1ea911031b44..eee3b5bfa8b7 100644 --- a/sdk/synapse/tests.yml +++ b/sdk/synapse/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: synapse \ No newline at end of file + ServiceDirectory: synapse diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index c7a357fa8fb7..90a0c125b70a 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -1,7 +1,7 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: tables TimeoutInMinutes: 120 diff --git a/sdk/template/tests.yml b/sdk/template/tests.yml index 4046e314977a..a64b721ac4c8 100644 --- a/sdk/template/tests.yml +++ b/sdk/template/tests.yml @@ -1,6 +1,6 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - ServiceDirectory: template \ No newline at end of file + ServiceDirectory: template diff --git a/sdk/textanalytics/tests.yml b/sdk/textanalytics/tests.yml index 9f8ce1d471dc..323b26e8fc3f 100644 --- a/sdk/textanalytics/tests.yml +++ b/sdk/textanalytics/tests.yml @@ -1,9 +1,9 @@ trigger: none extends: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: ServiceDirectory: textanalytics EnvVars: TEXT_ANALYTICS_API_KEY: $(net-textanalytics-test-api-key) - TEXT_ANALYTICS_ENDPOINT: $(net-textanalytics-test-ppe-endpoint-string) + TEXT_ANALYTICS_ENDPOINT: $(net-textanalytics-test-ppe-endpoint-string)