-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Unified Recorder] Re-enable ContinuationSanitizer tests #18841
[Unified Recorder] Re-enable ContinuationSanitizer tests #18841
Conversation
Looks good to me, but I don’t have the context regarding the new recorder. Is this enough, @HarshaNalluru ? |
@@ -0,0 +1,51 @@ | |||
{ | |||
"Entries": [ |
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.
run the test in browser too, please.
@@ -259,7 +259,7 @@ function getTestServerUrl() { | |||
); | |||
}); | |||
|
|||
it.skip("ContinuationSanitizer", async () => { | |||
it("ContinuationSanitizer", async () => { |
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.
The intention behind this sanitizer is to handle a case at ACR service.
Right now, the proxy tool only supports continuation sanitizer only in the headers I think.
I (vaguely) remember the ACR case to have the id at request body.
If the sanitizer can't be used for that case, it's pretty much worthless.
Can you test that case on your local, observe the changes in the recordings to understand, and then see what else we'd need to add in the proxy tool to support such a case?
@jeremymeng should be able to point you to the test case from ACR.
After you test using the ACR test, add a new test or update this test to represent the exact scenario over there.
Add more/different routes to the server under utils as needed.
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.
the name Continuation
doesn't ring a bell. In ACR I had to sanitize part of the token value while keeping expiration info. I also had to call pluginForClientSecretCredentialTests(env.CONTAINERREGISTRY_TENANT_ID)
but I don't remember the exact reason now.
azure-sdk-for-js/sdk/containerregistry/container-registry/test/utils/utils.ts
Lines 41 to 57 in c07af44
customizationsOnRecordings: [ | |
(recording: string): string => | |
recording.replace( | |
/"refresh_token":"[^"]+"/g, | |
`"refresh_token":"sanitized.${expiryReplacement}.sanitized"` | |
), | |
(recording: string): string => | |
recording.replace(/access_token=(.+?)(&|")/, `access_token=access_token$2`), | |
(recording: string): string => | |
recording.replace( | |
/refresh_token=([^&]+?)(&|")/, | |
`refresh_token=sanitized.${expiryReplacement}.sanitized$2` | |
) | |
], | |
onLoadCallbackForPlayback: () => { | |
pluginForClientSecretCredentialTests(env.CONTAINERREGISTRY_TENANT_ID); | |
} |
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.
@jeremymeng this is about some UUID that is present as part of the response of one request, is passed as part of a future request of the same test.
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.
Talked to Jeremy, and turns out this wasn't the requirement.
Let's move on with what we have and revisit if we need to support something else while migrating the tests.
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 merge after adding the browser recording
Resolves #18220
Do we need additional tests beyond this one? Let me know and I can add them.