forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add live test pipeline templates (Azure#15382)
* Add live test pipeline templates * Remove coverage goal from ci stage template
- Loading branch information
1 parent
4a08bb2
commit f12439d
Showing
5 changed files
with
243 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters