Skip to content

Commit bbbec4e

Browse files
azure-sdkscbedd
andauthored
add a parameter 'condition' to the test-proxy ci invocations. (Azure#19122)
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
1 parent f6da19d commit bbbec4e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

eng/common/testproxy/test-proxy-docker.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@ parameters:
22
rootFolder: '$(Build.SourcesDirectory)'
33
targetVersion: ''
44
templateRoot: '$(Build.SourcesDirectory)'
5+
condition: true
56

67
steps:
78
- pwsh: |
89
${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1
910
displayName: 'Language Specific Certificate Trust'
11+
condition: and(succeeded(), ${{ parameters.condition }})
1012
1113
- pwsh: |
1214
docker info
1315
displayName: 'Dump active docker information'
16+
condition: and(succeeded(), ${{ parameters.condition }})
1417
1518
- pwsh: |
1619
${{ parameters.templateRoot }}/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}"
1720
displayName: 'Run the docker container'
21+
condition: and(succeeded(), ${{ parameters.condition }})
1822
1923
- pwsh: |
2024
docker container ls -a
2125
displayName: Check running container
26+
condition: and(succeeded(), ${{ parameters.condition }})
2227
2328
- pwsh: |
2429
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
2530
displayName: 'Set PROXY_MANUAL_START'
31+
condition: and(succeeded(), ${{ parameters.condition }})

eng/common/testproxy/test-proxy-tool.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ parameters:
33
runProxy: true
44
targetVersion: ''
55
templateRoot: '$(Build.SourcesDirectory)'
6+
condition: true
67

78
steps:
89
- pwsh: |
910
${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1
1011
displayName: 'Language Specific Certificate Trust'
12+
condition: and(succeeded(), ${{ parameters.condition }})
1113
1214
- pwsh: |
1315
$version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim()
@@ -23,6 +25,7 @@ steps:
2325
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
2426
--version $version
2527
displayName: "Install test-proxy"
28+
condition: and(succeeded(), ${{ parameters.condition }})
2629
2730
- pwsh: |
2831
Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy"
@@ -34,19 +37,20 @@ steps:
3437
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
3538
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
3639
displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'
40+
condition: and(succeeded(), ${{ parameters.condition }})
3741
3842
- pwsh: |
3943
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
4044
-ArgumentList "--storage-location ${{ parameters.rootFolder }}" `
4145
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log
4246
displayName: 'Run the testproxy - windows'
43-
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'))
47+
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
4448
4549
# nohup does NOT continue beyond the current session if you use it within powershell
4650
- bash: |
4751
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.templateRoot }}/test-proxy.log &
4852
displayName: "Run the testproxy - linux/mac"
49-
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
53+
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
5054
workingDirectory: "${{ parameters.rootFolder }}"
5155
5256
- pwsh: |
@@ -62,4 +66,4 @@ steps:
6266
Write-Error "Could not connect to test proxy."
6367
exit 1
6468
displayName: Test Proxy IsAlive
65-
69+
condition: and(succeeded(), ${{ parameters.condition }})

0 commit comments

Comments
 (0)