-
Notifications
You must be signed in to change notification settings - Fork 186
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 logs - sanitizer info #9164
Conversation
…d; update commentsAdded a ToString method to RecordEntry for string representation.Introduced logging in RecordSession to track sanitizer changes.Added SanitizerId to RecordedTestSanitizer for unique identification.Updated RegisteredSanitizer constructor to set SanitizerId.Corrected copyright comment in RequestOrResponse.cs.Added necessary using directives to RecordEntry.cs.
I like the idea, but we are adding a ton of workload to every single request. Every time we sanitize we write all the entries out. We have to put this behind a debug flag somehow. I'm not certain how big of an impact there will be, so my thoughts is once you get these tests resolved, I will help you get this upgrade to a branch off of Easiest way to check performance of a proxy upgrade is to simply try updating the target_version.txt and see how all the repos handle it. |
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.
Thank you Harsha!
We spoke offline about fixing tests, figuring out how to put the heavier consistent tostringing behind a flag, and checking against existing libraries.
Push this to an upstream branch at your convenience so we can easily publish the results as proxy versions.
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
…n.cs Co-authored-by: Scott Beddall <[email protected]>
…n.cs Co-authored-by: Scott Beddall <[email protected]>
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordEntry.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RequestOrResponse.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordEntry.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
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.
Overall this is pretty damn solid. I requested a couple refactors for clarity, but nothing that is crazy.
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordEntry.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordEntry.cs
Outdated
Show resolved
Hide resolved
tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/RecordSession.cs
Outdated
Show resolved
Hide resolved
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.
Please address this comment and then we're g2g aside from your ToString()
todo.
Feel free to use TryGetContentAsText if you'd prefer that to relying on ToString()
.
…time of sanitization
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 @HarshaNalluru !
## What's going on? - Invocation of `test-proxy` in the `child_process` will now support environment variables - injects the current environment variables into the child's environment - Added a new flag `"test-proxy-debug"` to all the test commands, which enables debug logging for the test-proxy - sets the environment variable `Logging__LogLevel__Default` to `"Debug"` - Simply setting the environment variable `Logging__LogLevel__Default` to `"Debug"` will have the same effect as passing `test-proxy-debug` flag to the test commands. Related to Azure/azure-sdk-tools#9164
Test Proxy Logs - Impacted recordings and sanitizers
Introducing improvements to the test proxy logging in terms of which sanitizers are applied and how.
Key changes below:
Main changes
RecordEntry.cs
Clone
method to create a copy of theRecordEntry
, which is used primarily for sanitization logging.RecordSession.cs
RecordEntry
and log modifications, enhancing traceability and debugging capabilities.LoggingTests.cs
AssertLogs
method to include atestType
parameter, adjusting the logic to handle different test types.PlaybackLogsSanitizedRequest
andRecordingHandlerLogsSanitizedRequests
tests to use the newAssertLogs
method.Impact
These changes enhance the transparency and traceability of the sanitizers in test proxy by adding detailed logging for request and response modifications. This will aid in debugging and understanding the effects of sanitizers during test sessions.
Fixes #8474
Example Output
Output 1
Output 2