Skip to content
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

Merged

Conversation

timovv
Copy link
Member

@timovv timovv commented Nov 26, 2021

Resolves #18220

Do we need additional tests beyond this one? Let me know and I can add them.

@timovv timovv added the test-utils-recorder Label for the issues related to the common recorder label Nov 26, 2021
@sadasant
Copy link
Contributor

Looks good to me, but I don’t have the context regarding the new recorder. Is this enough, @HarshaNalluru ?

@@ -0,0 +1,51 @@
{
"Entries": [
Copy link
Member

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 () => {
Copy link
Member

@HarshaNalluru HarshaNalluru Nov 29, 2021

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.

Copy link
Member

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.

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);
}

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

@HarshaNalluru HarshaNalluru left a 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

@timovv timovv enabled auto-merge (squash) December 10, 2021 00:22
@timovv timovv merged commit 5ec971e into Azure:main Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-utils-recorder Label for the issues related to the common recorder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Unified Recorder] Fix ContinuationSanitizer
4 participants