-
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
[Communication Chat] Migrate communication-chat tests to the new recorder #20278
[Communication Chat] Migrate communication-chat tests to the new recorder #20278
Conversation
/azp run js - communication-chat - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - communication-chat - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
recorder = await createRecorder(this.currentTest); | ||
if (!communicationUserToken) { | ||
communicationUserToken = await createTestUser(recorder); | ||
await recorder.setMatcher("HeaderlessMatcher"); |
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.
[Just FYI]
Headerless matcher matches the requests in playback without matching the headers in the recording.
Beyond the default skipped headers(to match), there was a new header specific to the communication service I believe, that was being dynamic. Hence using the headerless matcher.
There is going to be a custom-matcher soon from the test-proxy tool and the recorder, which will allow specifying the headers to be ignored while matching. Until then(even forever tbh), the Headerless matcher should be good and should do the job.
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.
Thanks for the explanation! Yes, our services return a dynamic ms-cv correlation vector.
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 a lot for doing this migration Harsha!
It looks good except for one sanitization piece which seems to have escaped the sanitizer.
.../recordings/browsers/chatclient_chat_operations/recording_successfully_creates_a_thread.json
Show resolved
Hide resolved
recorder = await createRecorder(this.currentTest); | ||
if (!communicationUserToken) { | ||
communicationUserToken = await createTestUser(recorder); | ||
await recorder.setMatcher("HeaderlessMatcher"); |
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.
Thanks for the explanation! Yes, our services return a dynamic ms-cv correlation vector.
actualConnString: env["COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING"] || undefined, | ||
}, | ||
], | ||
bodyKeySanitizers: [{ jsonPath: "$.accessToken.token", value: fakeToken }], |
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.
Seems like this didn't catch 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.
No, that's the fakeToken which also looks like a real token. 🥲
sdk/communication/communication-chat/test/public/utils/recordedClient.ts
Show resolved
Hide resolved
/azp run js - aggregate-reports |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
As the title says, this PR migrates the Communication chat tests to the new recorder.
Follows the migration guide at https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/recorder/MIGRATION.md
Note
The new recorder requires test-proxy to be run before running the tests.
For this, "docker" needs to be installed in your environment as suggested at https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/recorder/MIGRATION.md#prerequisites.
Part of #19859