-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Test Proxy] Add fixture to automatically start/stop Docker container #21538
Merged
Conversation
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
mccoyp
requested review from
HarshaNalluru,
YalinLi0312,
scbedd and
seankane-msft
November 2, 2021 02:26
scbedd
reviewed
Nov 2, 2021
tools/azure-sdk-tools/devtools_testutils/proxy_docker_startup.py
Outdated
Show resolved
Hide resolved
YalinLi0312
reviewed
Nov 2, 2021
YalinLi0312
reviewed
Nov 2, 2021
scbedd
reviewed
Nov 9, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to handle PROXY_MANUAL_START
here. Once we do that this is good to merge.
scbedd
approved these changes
Nov 10, 2021
iscai-msft
added a commit
to iscai-msft/azure-sdk-for-python
that referenced
this pull request
Nov 10, 2021
…into add_webpubsub_tests * 'main' of https://github.com/Azure/azure-sdk-for-python: [Key Vault] Add support for multi-tenant authentication (Azure#21290) [webpubsub] regen with hub as a client parameter (Azure#21688) update automatic close mechanism (Azure#21580) [Test Proxy] Add fixture to automatically start/stop Docker container (Azure#21538) Update Monitor Query API ref link (Azure#21683) Migration Guide from Azure-loganalytics (Azure#21674) Update docs for Web PubSub GA (Azure#21659) Update CHANGELOG.md (Azure#21681) Increment version for formrecognizer releases (Azure#21678) Increment version for videoanalyzer releases (Azure#21455) Increment version for cognitivelanguage releases (Azure#21566) Increment version for storage releases (Azure#21652) Increment version for communication releases (Azure#21667) raise decode error instead of ContentDecodingError (Azure#19433) Update CHANGELOG.md (Azure#21679) resolve mac agent failure (Azure#21677) Re-add get-codeowners.ps1 (Azure#21676) [SchemaRegistry] remove schema prefix in params (Azure#21675) Validate python docs packages using docker (Azure#21657) update git helper (Azure#21670)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a session-level fixture,
test_proxy
, that can be used to start the proxy Docker container before recorded tests run and shut it down after all tests in the pytest session are run. It also exposes two helper methods used by the fixture,start_test_proxy
andstop_test_proxy
, that can be called directly to manually start or stop the proxy container.The container needs some time to warm up before it'll accept incoming requests, so the
start_test_proxy
method pings a proxy endpoint with GET requests until receiving a 200 (or until a 10-minute timeout is hit).Usage example (that will be added to the migration guide soon)
In a package's
conftest.py
, make the fixture name a parameter to any proxy-dependent, session-level fixtures:This will make sure the the container startup script is run before any sanitizers are registered (otherwise, we'd get errors). If no sanitizers are being registered with session-level fixtures, a dummy fixture can be added to the package's
conftest.py
instead, that just invokes thetest_proxy
fixture: