-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SERVICEBUS_ envvars to test pipeline (#342)
* update envvars for SB and version * temp comment out tests * test create resources * add deploy test resources to pipeline * remove SB client id/secret/tenant from explicit envvars * add test proxy files * specify cwd to run testproxy templ * update template location * add tests back * create log file for linux/mac test proxy * check mac/linux testproxy * pwd for test proxy mac/linux * print binaries dir * more things * rm workingDirectory from mac/linux testproxy * re-enable all OS * move line in template
- Loading branch information
Showing
3 changed files
with
116 additions
and
1 deletion.
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,68 @@ | ||
parameters: | ||
rootFolder: '$(Build.SourcesDirectory)' | ||
runProxy: true | ||
targetVersion: '' | ||
templateRoot: '$(Build.SourcesDirectory)' | ||
condition: true | ||
|
||
steps: | ||
- pwsh: | | ||
${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 | ||
displayName: 'Language Specific Certificate Trust' | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
- pwsh: | | ||
$version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim() | ||
$overrideVersion = "${{ parameters.targetVersion }}" | ||
if($overrideVersion) { | ||
Write-Host "Overriding default target proxy version of '$version' with override $overrideVersion." | ||
$version = $overrideVersion | ||
} | ||
dotnet tool install azure.sdk.tools.testproxy ` | ||
--tool-path $(Build.BinariesDirectory)/test-proxy ` | ||
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json ` | ||
--version $version | ||
displayName: "Install test-proxy" | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
- pwsh: | | ||
Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy" | ||
displayName: "Prepend path with test-proxy tool install location" | ||
- ${{ if eq(parameters.runProxy, 'true') }}: | ||
- pwsh: | | ||
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx" | ||
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" | ||
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" | ||
displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
- pwsh: | | ||
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` | ||
-ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` | ||
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log | ||
displayName: 'Run the testproxy - windows' | ||
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }}) | ||
# nohup does NOT continue beyond the current session if you use it within powershell | ||
- bash: | | ||
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.templateRoot }}/test-proxy.log & | ||
displayName: "Run the testproxy - linux/mac" | ||
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }}) | ||
- pwsh: | | ||
for ($i = 0; $i -lt 10; $i++) { | ||
try { | ||
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null | ||
exit 0 | ||
} catch { | ||
Write-Warning "Failed to successfully connect to test proxy. Retrying..." | ||
Start-Sleep 6 | ||
} | ||
} | ||
Write-Error "Could not connect to test proxy." | ||
exit 1 | ||
displayName: Test Proxy IsAlive | ||
condition: and(succeeded(), ${{ parameters.condition }}) |
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