|
| 1 | +parameters: |
| 2 | + - name: serviceDirectory |
| 3 | + type: string |
| 4 | + default: '' |
| 5 | + - name: services |
| 6 | + type: string |
| 7 | + default: '' |
| 8 | + - name: packageVersions |
| 9 | + type: string |
| 10 | + default: '.*' |
| 11 | + - name: tests |
| 12 | + type: string |
| 13 | + default: '' |
| 14 | + - name: arguments |
| 15 | + type: string |
| 16 | + default: '' |
| 17 | + - name: iterations |
| 18 | + type: number |
| 19 | + default: '5' |
| 20 | + - name: envVars |
| 21 | + type: object |
| 22 | + default: {} |
| 23 | + - name: additionalArguments |
| 24 | + type: string |
| 25 | + default: '' |
| 26 | + |
| 27 | +variables: |
| 28 | + - template: /eng/pipelines/templates/variables/globals.yml |
| 29 | + - name: Pool |
| 30 | + value: 'azsdk-pool-mms-ubuntu-2004-perf' |
| 31 | + - name: OSVmImage |
| 32 | + value: 'MMSUbuntu20.04' |
| 33 | + - name: PythonVersion |
| 34 | + value: '3.7' |
| 35 | + |
| 36 | +resources: |
| 37 | + repositories: |
| 38 | + - repository: azure-sdk-tools |
| 39 | + type: github |
| 40 | + endpoint: Azure |
| 41 | + name: Azure/azure-sdk-tools |
| 42 | + |
| 43 | +jobs: |
| 44 | +- job: Perf |
| 45 | + timeoutInMinutes: 360 |
| 46 | + pool: |
| 47 | + name: $(Pool) |
| 48 | + vmImage: $(OSVmImage) |
| 49 | + steps: |
| 50 | + - checkout: self |
| 51 | + path: s |
| 52 | + |
| 53 | + - checkout: azure-sdk-tools |
| 54 | + path: s/azure-sdk-tools |
| 55 | + |
| 56 | + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml |
| 57 | + parameters: |
| 58 | + AgentImage: $(OSVmImage) |
| 59 | + |
| 60 | + - task: UsePythonVersion@0 |
| 61 | + displayName: "Use Python $(PythonVersion)" |
| 62 | + inputs: |
| 63 | + versionSpec: $(PythonVersion) |
| 64 | + |
| 65 | + - template: /eng/common/TestResources/deploy-test-resources.yml |
| 66 | + parameters: |
| 67 | + ServiceDirectory: ${{ parameters.serviceDirectory }} |
| 68 | + Location: westus |
| 69 | + ResourceType: perf |
| 70 | + |
| 71 | + - pwsh: | |
| 72 | + set-content -path config.yml -value "WorkingDirectories:" |
| 73 | + add-content -path config.yml -value " Python: $(Agent.BuildDirectory)/s" |
| 74 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation |
| 75 | + displayName: Create config.yml |
| 76 | +
|
| 77 | + - script: >- |
| 78 | + dotnet run -- run |
| 79 | + --no-sync |
| 80 | + --languages python |
| 81 | + --services "${{ parameters.services }}" |
| 82 | + --package-versions "${{ parameters.packageVersions }}" |
| 83 | + --tests "${{ parameters.tests }}" |
| 84 | + --arguments "${{ parameters.arguments }}" |
| 85 | + --iterations ${{ parameters.iterations }} |
| 86 | + ${{ parameters.additionalArguments }} |
| 87 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation |
| 88 | + env: |
| 89 | + ${{ each var in parameters.EnvVars }}: |
| 90 | + ${{ var.key }}: ${{ var.value }} |
| 91 | + displayName: Run perf tests |
| 92 | +
|
| 93 | + - pwsh: | |
| 94 | + get-content results.csv |
| 95 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 96 | + displayName: Print results.csv |
| 97 | +
|
| 98 | + - pwsh: | |
| 99 | + get-content results.json |
| 100 | + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 101 | + displayName: Print results.json |
| 102 | +
|
| 103 | + - template: /eng/common/TestResources/remove-test-resources.yml |
| 104 | + parameters: |
| 105 | + ServiceDirectory: ${{ parameters.serviceDirectory }} |
| 106 | + ResourceType: perf |
| 107 | + |
| 108 | + - task: PublishPipelineArtifact@1 |
| 109 | + inputs: |
| 110 | + targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results |
| 111 | + artifactName: results |
0 commit comments