-
Notifications
You must be signed in to change notification settings - Fork 951
[Internal] Add methods for configuring tests to work with test proxy #15259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
43e875b
moving into a separate PR to merge with main
seankane-msft ce8dfa6
adding yml and script to start server
seankane-msft 8b716cd
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-go into…
seankane-msft 2d34f68
renaming examples for go vet
seankane-msft 858f929
fixing stop command
seankane-msft 0e78180
merge conflicts
seankane-msft abfd495
skipping problematic tests
seankane-msft ae991cc
bens feedback
seankane-msft ab34658
testproxy changes from track2-tables
seankane-msft 464bb90
simplification
seankane-msft 5170886
fix
seankane-msft 1bb884d
updating to work with common
seankane-msft 6355a03
getting main build-test.yml files
seankane-msft ccf37a8
whitespace
seankane-msft 29bed05
adding tests for test proxy infra
seankane-msft f33a232
setting azure_record_mode to playback
seankane-msft 0ea12a0
setting proxy cert variable
seankane-msft def4c27
prepend ./ to testId, use testId to determine full path from repo root
seankane-msft 42e667a
workaround for magically dissappearing files
seankane-msft 0455394
more tests
seankane-msft 0f87900
dropping coverage
seankane-msft 2921e52
removing azcore dependent code
seankane-msft 66158cb
undoing changes to eng files
seankane-msft 3de4936
unexporting a couple things
seankane-msft 5feef38
fixed issue with deleting recordings
seankane-msft e752a6f
adding additional tests
seankane-msft 8ec2e2a
dropping code coverage
seankane-msft 32c6570
cleanup
seankane-msft 297b899
richards comments
seankane-msft ecc9563
improving coverage
seankane-msft 7867ab1
fixing recording options test
seankane-msft 1453a3d
inching closer
seankane-msft 2cee416
a
seankane-msft b3f7949
dropping coverage 1%, have every inch of new code tested
seankane-msft bd98736
adding test case for backwards slash path
seankane-msft 9ca55c8
no newline
seankane-msft 9421675
fixing test
seankane-msft e2b0ded
allowing parallel tests
seankane-msft 6c3d638
removing snippet
seankane-msft b62e797
undoing change to config
seankane-msft f40b00d
Merge branch 'main' into test-proxy-main
seankane-msft a009528
fixing armcore link
seankane-msft 2c8e939
Merge branch 'test-proxy-main' of https://github.com/seankane-msft/az…
seankane-msft cdca98a
Merge branch 'main' into test-proxy-main
seankane-msft 2d96846
undoing changes to migration guide
seankane-msft 1fd955b
merge conflict
seankane-msft d3719af
Update sdk/internal/recording/recordings/TestUriSanitizer.json
seankane-msft 0a56f19
Update sdk/internal/recording/recordings/TestStartStop.json
seankane-msft 6aba571
richards comments
seankane-msft a20591d
Merge branch 'test-proxy-main' of https://github.com/seankane-msft/az…
seankane-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,18 @@ | ||
| parameters: | ||
| ServiceDirectory: '' | ||
|
|
||
| steps: | ||
| - pwsh: | | ||
| $certUriPfx = "https://github.com/Azure/azure-sdk-tools/raw/main/tools/test-proxy/docker/dev_certificate/dotnet-devcert.pfx" | ||
| $certUriCrt = "https://github.com/Azure/azure-sdk-tools/raw/main/tools/test-proxy/docker/dev_certificate/dotnet-devcert.crt" | ||
| $certLocationPfx = "$(Build.SourcesDirectory)/dotnet-devcert.pfx" | ||
| $certLocationCrt = "$(Build.SourcesDirectory)/dotnet-devcert.crt" | ||
| Invoke-WebRequest ` | ||
| -Uri $certUriPfx ` | ||
| -OutFile $certLocationPfx -UseBasicParsing | ||
| Invoke-WebRequest ` | ||
| -Uri $certUriCrt ` | ||
| -OutFile $certLocationCrt -UseBasicParsing | ||
| dotnet dev-certs https --clean --import $certLocationPfx -p "password" | ||
| Write-Host "##vso[task.setvariable variable=PROXY_CERT]$certLocationCrt" | ||
| displayName: 'Download and Trust Certificate' | ||
This file contains hidden or 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,66 @@ | ||
| param( | ||
| [ValidateSet("start", "stop")] | ||
| [String] | ||
| $mode, | ||
| [String] | ||
| $targetFolder = "." | ||
| ) | ||
|
|
||
| try { | ||
| docker --version | Out-Null | ||
| } | ||
| catch { | ||
| Write-Error "A invocation of docker --version failed. This indicates that docker is not properly installed or running." | ||
| Write-Error "Please check your docker invocation and try running the script again." | ||
| } | ||
|
|
||
| $repoRoot = (Resolve-Path $targetFolder).Path.Replace("`\", "/") | ||
| Write-Host $repoRoot | ||
|
|
||
| $CONTAINER_NAME = "ambitious_azsdk_test_proxy" | ||
| $IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:1037115" | ||
| $Initial = "" | ||
|
|
||
| if ($IsWindows -and $env:TF_BUILD){ | ||
| $IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:1037115" | ||
| $Initial = "C:" | ||
| } | ||
|
|
||
| function Get-Proxy-Container(){ | ||
| return (docker container ls -a --format "{{ json . }}" --filter "name=$CONTAINER_NAME" ` | ||
| | ConvertFrom-Json ` | ||
| | Select-Object -First 1) | ||
| } | ||
|
|
||
| if ($mode -eq "start"){ | ||
| $proxyContainer = Get-Proxy-Container | ||
|
|
||
| # if we already have one, we just need to check the state | ||
| if($proxyContainer){ | ||
| if ($proxyContainer.State -eq "running") | ||
| { | ||
| Write-Host "Discovered an already running instance of the test-proxy!. Exiting" | ||
| exit(0) | ||
| } | ||
| } | ||
| # else we need to create it | ||
| else { | ||
| Write-Host "Attempting creation of Docker host $CONTAINER_NAME" | ||
| Write-Host "docker container create -v `"${repoRoot}:${Initial}/etc/testproxy`" -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE" | ||
| docker container create -v "${repoRoot}:${Initial}/etc/testproxy" -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE | ||
| } | ||
|
|
||
| Write-Host "Attempting start of Docker host $CONTAINER_NAME" | ||
| docker container start $CONTAINER_NAME | ||
| } | ||
|
|
||
| if ($mode -eq "stop"){ | ||
| $proxyContainer = Get-Proxy-Container | ||
|
|
||
| if($proxyContainer){ | ||
| if($proxyContainer.State -eq "running"){ | ||
| Write-Host "Found a running instance of $CONTAINER_NAME, shutting it down." | ||
| docker container stop $CONTAINER_NAME | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.