-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 RecordedByProxy decorator and AzureRecordedTestCase #20138
Conversation
# TODO, get the test-proxy server a real SSL certificate. The issue here is that SSL Certificates are | ||
# normally associated with a domain name. Need to talk to the //SSLAdmin folks (or someone else) and get | ||
# a recommendation for how to get a valid SSL Cert for localhost | ||
kwargs["connection_verify"] = False |
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.
As discussed. I'll help figure out the trust methodology for the certificate. We should remove this before we merge.
tools/azure-sdk-tools/devtools_testutils/aio/proxy_testcase_async.py
Outdated
Show resolved
Hide resolved
from azure_devtools.scenario_tests.utilities import trim_kwargs_from_test_function | ||
|
||
# defaults | ||
PROXY_URL = "http://localhost:5000" |
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.
If we're ok with manual start of the proxy, we should probably assume SSL. I'll see if I can figure that out today. If I can, let's get those changes added to this PR and swap this to https.
/check-enforcer reset |
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.
LGTM, two small comments
# Adding this for new proxy testcase | ||
if hasattr(test_class_instance, "scrubber"): | ||
test_class_instance.scrubber.register_name_pair(resource_name, self.moniker) |
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.
Nit: I would add a log as an else statement here because then the name pair will not be scrubbed from the recordings. With a log at least you are notifying the dev that the object has no scrubber object.
# Adding this for new proxy testcase | ||
if hasattr(self.test_class_instance, "scrubber"): | ||
self.test_class_instance.scrubber.register_name_pair( | ||
self.real_values[key.lower()], scrubbed_value | ||
) |
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.
same as above, might just break out into a small helper function
return os.sep.join(path_components).replace("::", "").replace("\\", "/") | ||
|
||
|
||
def get_current_sha(): |
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.
nit:I believe we can clean this function out.
…into header_tuples * 'main' of https://github.com/Azure/azure-sdk-for-python: (104 commits) [Key Vault] Add 7.3-preview support for administration (#20364) Fix Monitor opentelemetry exporter readme issues (#19038) More Renaming in query (#20303) Update CODEOWNERS (#20366) [ServiceBus] update migration guide with message count info (#20360) [rest] change text from a property to a method (#20290) Handle value types for results (#20358) Remove old unused update changelog script (#20357) bump node version (#20353) [AutoRelease] t2-web-2021-08-03-73015 (#20053) Fix query batch processing (#20345) Sync eng/common directory with azure-sdk-tools for PR 1912 (#20340) Increment version for schemaregistry releases (#20326) [SchemaRegistry] prepare avro for release (#20321) Update CHANGELOG.md (#20334) Update main.py (#20332) Removing C:\Git\azure-sdk-tools\eng\common\scripts\FilterPoliCheckResults.ps1 as it was no longer used (#20325) Suppress CredScan warning for test proxy devcert (#20324) [SchemaRegistry] update samples readme (#20323) [Test Proxy] Add RecordedByProxy decorator and AzureRecordedTestCase (#20138) ...
Merges in tools from the integrate-proxy branch so that SDKs can begin migrating tests to the test proxy.