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

[TestProxyMigration-TA] Rerecord all tests #33931

Merged
merged 9 commits into from
Apr 11, 2023
Merged

Conversation

mssfang
Copy link
Member

@mssfang mssfang commented Mar 8, 2023

Rerecord all tests in live mode with the new TestProxy.

(Phase 1) Steps to integrate with Test Proxy:
Use azure-core-test newer than 1.15.0. (If there are bug fixes you need you may need to depend on an unreleased version of the lib.)
Change the Base type of the respective SDK test class from TestBase to TestProxyTestBase
Run tests in record mode.
Validate recordings are as expected and do not contain secrets. Example updated recording
Check in the updated recordings to the main repo
Validate changes by running the Live/ci test pipeline

@mssfang mssfang added Client This issue points to a problem in the data-plane of the library. Cognitive - Text Analytics labels Mar 8, 2023
@mssfang mssfang added this to the 2023-04 milestone Mar 8, 2023
@mssfang mssfang self-assigned this Mar 8, 2023
@mssfang mssfang requested a review from samvaity as a code owner March 8, 2023 19:11
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@mssfang mssfang changed the title [TestProxyMigration-TA] re record all tests [TestProxyMigration-TA] Rerecord all tests Apr 5, 2023
@@ -1,47 +0,0 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were some of the tests not replaced but only removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are disabled tests record files

@samvaity samvaity requested a review from billwert April 11, 2023 17:03
@mssfang mssfang requested a review from samvaity April 11, 2023 17:40
.clientId(clientId)
.tenantId(tenantId)
.build();
credential = new DefaultAzureCredentialBuilder().build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The configuration loading before this call is now ignored and can be removed

if (interceptorManager.isPlaybackMode()) {
// since running in playback mode won't have the token credential, so skipping matching it.
interceptorManager.addMatchers(Arrays.asList(
new CustomMatcher().setExcludedHeaders(Arrays.asList("Authorization"))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Authorization header should be redacted by default and this isn't needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this case we wanted to set this as with Record we expect the header to be present but with playback we don't set any auth mode at all so are missing even the presence of the header.

@mssfang mssfang requested a review from alzimmermsft April 11, 2023 19:03
@billwert
Copy link
Contributor

:shipit:

@mssfang mssfang merged commit bd3dbbb into Azure:main Apr 11, 2023
@mssfang mssfang deleted the TA-TestProxy branch April 11, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Text Analytics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants