|
| 1 | +parameters: |
| 2 | +- name: Variables |
| 3 | + type: object |
| 4 | + default: [] |
| 5 | +- name: OperatingSystems |
| 6 | + type: string |
| 7 | + default: 'Linux' |
| 8 | +- name: Language |
| 9 | + type: string |
| 10 | + default: '' |
| 11 | +- name: InstallLanguageSteps |
| 12 | + type: stepList |
| 13 | + default: [] |
| 14 | +- name: ServiceDirectory |
| 15 | + type: string |
| 16 | + default: '' |
| 17 | +- name: Services |
| 18 | + type: string |
| 19 | + default: '' |
| 20 | +- name: PackageVersions |
| 21 | + type: string |
| 22 | + default: '.*' |
| 23 | +- name: Tests |
| 24 | + type: string |
| 25 | + default: '.*' |
| 26 | +- name: Arguments |
| 27 | + type: string |
| 28 | + default: '.*' |
| 29 | +- name: Iterations |
| 30 | + type: number |
| 31 | + default: '5' |
| 32 | +- name: AdditionalArguments |
| 33 | + type: string |
| 34 | + default: '' |
| 35 | +- name: EnvVars |
| 36 | + type: object |
| 37 | + default: {} |
| 38 | + |
| 39 | +resources: |
| 40 | + repositories: |
| 41 | + - repository: azure-sdk-tools |
| 42 | + type: github |
| 43 | + endpoint: Azure |
| 44 | + name: Azure/azure-sdk-tools |
| 45 | + ref: main |
| 46 | + |
| 47 | +variables: |
| 48 | +- ${{ parameters.Variables }} |
| 49 | + |
| 50 | +jobs: |
| 51 | +- job: Perf |
| 52 | + timeoutInMinutes: 360 |
| 53 | + strategy: |
| 54 | + matrix: |
| 55 | + ${{ if contains(parameters.OperatingSystems, 'Linux') }}: |
| 56 | + Linux: |
| 57 | + Pool: 'azsdk-pool-mms-ubuntu-2004-perf' |
| 58 | + OsVmImage: 'MMSUbuntu20.04' |
| 59 | + MatrixName: 'Linux' |
| 60 | + ${{ if contains(parameters.OperatingSystems, 'Windows') }}: |
| 61 | + Windows: |
| 62 | + Pool: 'azsdk-pool-mms-win-2019-perf' |
| 63 | + OsVmImage: 'MMS2019' |
| 64 | + MatrixName: 'Windows' |
| 65 | + pool: |
| 66 | + name: $(Pool) |
| 67 | + vmImage: $(OSVmImage) |
| 68 | + steps: |
| 69 | + - checkout: self |
| 70 | + path: s |
| 71 | + |
| 72 | + - checkout: azure-sdk-tools |
| 73 | + path: s/azure-sdk-tools |
| 74 | + |
| 75 | + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml |
| 76 | + parameters: |
| 77 | + AgentImage: $(OSVmImage) |
| 78 | + |
| 79 | + - ${{ parameters.InstallLanguageSteps }} |
| 80 | + |
| 81 | + - template: /eng/common/TestResources/deploy-test-resources.yml |
| 82 | + parameters: |
| 83 | + ServiceDirectory: ${{ parameters.ServiceDirectory }} |
| 84 | + Location: westus |
| 85 | + ResourceType: perf |
| 86 | + |
| 87 | + - pwsh: | |
| 88 | + set-content -path config.yml -value "WorkingDirectories:" |
| 89 | + add-content -path config.yml -value " ${{ parameters.Language }}: $(Agent.BuildDirectory)/s" |
| 90 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation |
| 91 | + displayName: Create config.yml |
| 92 | +
|
| 93 | + - script: >- |
| 94 | + dotnet run -- run |
| 95 | + --no-sync |
| 96 | + --languages ${{ parameters.Language }} |
| 97 | + --services "${{ parameters.Services }}" |
| 98 | + --package-versions "${{ parameters.PackageVersions }}" |
| 99 | + --tests "${{ parameters.Tests }}" |
| 100 | + --arguments "${{ parameters.Arguments }}" |
| 101 | + --iterations ${{ parameters.Iterations }} |
| 102 | + ${{ parameters.AdditionalArguments }} |
| 103 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation |
| 104 | + env: |
| 105 | + ${{ each var in parameters.EnvVars }}: |
| 106 | + ${{ var.key }}: ${{ var.value }} |
| 107 | + displayName: Run perf tests |
| 108 | +
|
| 109 | + - pwsh: | |
| 110 | + get-content results.csv |
| 111 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 112 | + displayName: Print results.csv |
| 113 | + condition: always() |
| 114 | +
|
| 115 | + - pwsh: | |
| 116 | + get-content results.json |
| 117 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 118 | + displayName: Print results.json |
| 119 | + condition: always() |
| 120 | +
|
| 121 | + - task: PublishPipelineArtifact@1 |
| 122 | + inputs: |
| 123 | + targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 124 | + artifactName: results-$(MatrixName) |
| 125 | + condition: always() |
| 126 | + |
| 127 | + - template: /eng/common/TestResources/remove-test-resources.yml |
| 128 | + parameters: |
| 129 | + ServiceDirectory: ${{ parameters.ServiceDirectory }} |
| 130 | + ResourceType: perf |
0 commit comments