-
Notifications
You must be signed in to change notification settings - Fork 951
Add live test pipeline templates #15382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| parameters: | ||
| - name: ServiceDirectory | ||
| type: string | ||
| default: '' | ||
| - name: EnvVars | ||
| type: object | ||
| default: {} | ||
| - name: TimeoutInMinutes | ||
| type: number | ||
| default: 60 | ||
| - name: PreSteps | ||
| type: object | ||
| default: [] | ||
| - name: PostSteps | ||
| type: object | ||
| default: [] | ||
| - name: CloudConfig | ||
| type: object | ||
| default: {} | ||
| - name: Location | ||
| type: string | ||
| default: '' | ||
| - name: Matrix | ||
| type: string | ||
| - name: DependsOn | ||
| type: string | ||
| default: '' | ||
| - name: UsePlatformContainer | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| - job: | ||
| displayName: Live Test on | ||
benbp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dependsOn: ${{ parameters.DependsOn }} | ||
| condition: ne(${{ parameters.Matrix }}, '{}') | ||
| strategy: | ||
| maxParallel: 0 | ||
| matrix: $[ ${{ parameters.Matrix }} ] | ||
|
|
||
| variables: | ||
| - template: ../variables/globals.yml | ||
| - name: ArmTemplateParameters | ||
| value: '@{}' | ||
|
|
||
| pool: | ||
| name: $(Pool) | ||
| vmImage: $(OSVmImage) | ||
|
|
||
| timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} | ||
|
|
||
| ${{ if eq(parameters.UsePlatformContainer, 'true') }}: | ||
| container: $[ variables['Container'] ] | ||
|
|
||
| steps: | ||
| - ${{ parameters.PreSteps }} | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml | ||
| parameters: | ||
| AgentImage: $(OSVmImage) | ||
|
|
||
| - template: /eng/common/TestResources/build-test-resource-config.yml | ||
| parameters: | ||
| SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }} | ||
| SubscriptionConfigurations: ${{ parameters.CloudConfig.SubscriptionConfigurations }} | ||
|
|
||
| - template: /eng/common/TestResources/deploy-test-resources.yml | ||
| parameters: | ||
| ${{ if or(parameters.Location, parameters.CloudConfig.Location) }}: | ||
| Location: ${{ coalesce(parameters.Location, parameters.CloudConfig.Location) }} | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| SubscriptionConfiguration: $(SubscriptionConfiguration) | ||
| ArmTemplateParameters: $(ArmTemplateParameters) | ||
|
|
||
| - task: GoTool@0 | ||
| inputs: | ||
| version: '$(GoVersion)' | ||
| displayName: "Select Go Version" | ||
|
|
||
| - template: ../steps/create-go-workspace.yml | ||
|
|
||
| - template: ../steps/set-scope.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| GoWorkspace: $(GO_WORKSPACE_PATH) | ||
|
|
||
| - template: ../steps/build-test.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| GoWorkspace: $(GO_WORKSPACE_PATH) | ||
| Scope: $(SCOPE) | ||
| Image: $(OSVmImage) | ||
| GoVersion: $(GoVersion) | ||
| RunTests: true | ||
|
|
||
| - ${{ parameters.PostSteps }} | ||
|
|
||
| - template: /eng/common/TestResources/remove-test-resources.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| SubscriptionConfiguration: $(SubscriptionConfiguration) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| parameters: | ||
| - name: ServiceDirectory | ||
| type: string | ||
| default: '' | ||
| - name: Clouds | ||
| type: string | ||
| default: 'Public' | ||
| - name: SupportedClouds | ||
| type: string | ||
| default: 'Public,UsGov,China' | ||
| - name: UnsupportedClouds | ||
| type: string | ||
| default: '' | ||
| - name: PreSteps | ||
| type: object | ||
| default: [] | ||
| - name: PostSteps | ||
| type: object | ||
| default: [] | ||
| - name: TimeoutInMinutes | ||
| type: number | ||
| default: 60 | ||
| - name: Location | ||
| type: string | ||
| 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: 'centraluseuap' | ||
| UsGov: | ||
| SubscriptionConfiguration: $(sub-config-gov-test-resources) | ||
| China: | ||
| SubscriptionConfiguration: $(sub-config-cn-test-resources) | ||
| - name: MatrixConfigs | ||
| type: object | ||
| default: | ||
| - Name: Go_live_test_base | ||
| Path: eng/pipelines/templates/stages/platform-matrix.json | ||
| Selection: all | ||
| GenerateVMJobs: true | ||
| - name: AdditionalMatrixConfigs | ||
| type: object | ||
| default: [] | ||
| - name: MatrixFilters | ||
| type: object | ||
| default: [] | ||
| - name: MatrixReplace | ||
| type: object | ||
| default: [] | ||
|
|
||
| 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 or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: | ||
| - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: | ||
| - stage: ${{ cloud.key }} | ||
| dependsOn: [] | ||
| jobs: | ||
| - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml | ||
| parameters: | ||
| JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml | ||
| AdditionalParameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| EnvVars: ${{ parameters.EnvVars }} | ||
| TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} | ||
| Location: ${{ parameters.Location }} | ||
| PreSteps: | ||
| - ${{ parameters.PreSteps }} | ||
| PostSteps: | ||
| - ${{ parameters.PostSteps }} | ||
| MatrixConfigs: | ||
| # Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix). | ||
| - ${{ each config in parameters.MatrixConfigs }}: | ||
| - ${{ config }} | ||
| - ${{ each config in parameters.AdditionalMatrixConfigs }}: | ||
| - ${{ config }} | ||
| MatrixFilters: | ||
| - ${{ each cloudFilter in cloud.value.MatrixFilters }}: | ||
| - ${{ cloudFilter }} | ||
| - ${{ parameters.MatrixFilters }} | ||
| MatrixReplace: | ||
| - ${{ each cloudReplace in cloud.value.MatrixReplace }}: | ||
| - ${{ cloudReplace }} | ||
| - ${{ parameters.MatrixReplace }} | ||
| CloudConfig: | ||
| SubscriptionConfiguration: ${{ cloud.value.SubscriptionConfiguration }} | ||
| SubscriptionConfigurations: ${{ cloud.value.SubscriptionConfigurations }} | ||
| Location: ${{ coalesce(parameters.Location, cloud.value.Location) }} | ||
| Cloud: ${{ cloud.key }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "matrix": { | ||
| "Agent": { | ||
| "ubuntu-20.04": { | ||
| "OSVmImage": "MMSUbuntu20.04", | ||
| "Pool": "azsdk-pool-mms-ubuntu-2004-general" | ||
| }, | ||
| "windows-2019": { | ||
| "OSVmImage": "MMS2019", | ||
| "Pool": "azsdk-pool-mms-win-2019-general" | ||
| } | ||
| }, | ||
| "GoVersion": [ | ||
| "1.16.7", | ||
| "1.17" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,27 @@ | ||
| parameters: | ||
| ServiceDirectory: '' | ||
| GoWorkspace: '' | ||
| Scope: 'sdk/...' | ||
| Image: '' | ||
| GoVersion: '' | ||
| RunTests: false | ||
| - name: ServiceDirectory | ||
| type: string | ||
| default: '' | ||
| - name: GoWorkspace | ||
| type: string | ||
| default: '' | ||
| - name: Scope | ||
| type: string | ||
| default: 'sdk/...' | ||
| - name: Image | ||
| type: string | ||
| default: '' | ||
| - name: GoVersion | ||
| type: string | ||
| default: '' | ||
| - name: RunTests | ||
| type: boolean | ||
| default: false | ||
| - name: EnvVars | ||
| type: object | ||
| default: {} | ||
|
|
||
| steps: | ||
|
|
||
| - pwsh: ./eng/scripts/build.ps1 | ||
| displayName: 'Build' | ||
| workingDirectory: '${{parameters.GoWorkspace}}' | ||
|
|
@@ -48,6 +62,7 @@ steps: | |
| workingDirectory: '${{parameters.GoWorkspace}}' | ||
| env: | ||
| GO111MODULE: 'on' | ||
| ${{ insert }}: ${{ parameters.EnvVars }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a way of merging two key/value yaml objects via the template expressions, see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#insertion. |
||
|
|
||
| - pwsh: ../eng/scripts/create_coverage.ps1 ${{parameters.ServiceDirectory}} | ||
| displayName: 'Generate Coverage XML' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.