-
Notifications
You must be signed in to change notification settings - Fork 570
Expand file tree
/
Copy pathlive-test.yml
More file actions
123 lines (105 loc) · 3.69 KB
/
Copy pathlive-test.yml
File metadata and controls
123 lines (105 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
parameters:
- name: Matrix
type: object
- name: MaxParallel
type: number
- name: TimeoutInMinutes
type: number
jobs:
- job: LiveTest
displayName: "Live tests -"
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
# The variable reference in the matrix parameter will resolve to a json map. If there are no live test legs, it will be an empty map.
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))
strategy:
maxParallel: ${{ parameters.MaxParallel }}
matrix: $[ ${{ parameters.Matrix }} ]
steps:
- checkout: self
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- task: UseNode@1
displayName: 'Install Node.js 24'
inputs:
version: '24.x'
- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
- pwsh: |
$serverName = $env:SERVERNAME
if ([string]::IsNullOrWhiteSpace($serverName)) {
./eng/scripts/Build-Local.ps1 -VerifyNpx
}
else {
./eng/scripts/Build-Local.ps1 -ServerName $serverName -VerifyNpx
}
exit $LastExitCode
displayName: "Build local package"
workingDirectory: $(Build.SourcesDirectory)
- pwsh: >
./eng/scripts/Test-Code.ps1
-TestType 'Live'
-Path $(PathToTest)
-OnlyBuild
displayName: "Confirm tests build"
workingDirectory: $(Build.SourcesDirectory)
- template: /eng/common/TestResources/build-test-resource-config.yml
parameters:
EnvVars:
Pool: $(Pool)
- template: /eng/common/TestResources/deploy-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public
PersistOidcToken: true
TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath)
- task: AzurePowershell@5
displayName: "Run tests (stdio) - az pwsh"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
AZURE_MCP_COLLECT_TELEMETRY: 'false'
inputs:
azureSubscription: azure-sdk-tests-public
azurePowerShellVersion: 'LatestVersion'
scriptType: InlineScript
Inline: |
./eng/scripts/Test-Code.ps1 `
-TestType 'Live' `
-Path $(PathToTest) `
-TestResultsPath '$(Build.ArtifactStagingDirectory)/testResults'
exit $LastExitCode
pwsh: true
workingDirectory: $(Build.SourcesDirectory)
- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public
- template: /eng/common/TestResources/deploy-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public
PersistOidcToken: true
TestResourcesDirectory: $(Build.SourcesDirectory)/$(TestResourcesPath)
AdditionalParameters: "@{ UseHttpTransport = true }"
- task: AzurePowershell@5
displayName: "Run tests (http) - az pwsh"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
AZURE_MCP_COLLECT_TELEMETRY: 'false'
inputs:
azureSubscription: azure-sdk-tests-public
azurePowerShellVersion: 'LatestVersion'
scriptType: InlineScript
Inline: |
./eng/scripts/Test-Code.ps1 `
-TestType 'Live' `
-Path $(PathToTest) `
-TestResultsPath '$(Build.ArtifactStagingDirectory)/testResults'
exit $LastExitCode
pwsh: true
workingDirectory: $(Build.SourcesDirectory)
- task: PublishTestResults@2
condition: succeededOrFailed()
displayName: "Publish Results"
inputs:
testResultsFiles: "$(Build.ArtifactStagingDirectory)/testResults/*.trx"
testRunTitle: "live - $(PathToTest)"
testResultsFormat: "VSTest"
mergeTestResults: true
- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
ServiceConnection: azure-sdk-tests-public