Closed g2vinay closed 5 years ago
Successfully ran the live tests for storage. https://dev.azure.com/azure-sdk/playground/_build/results?buildId=28127
Breakdowns:
The recode json files has successfully generated. 26 of 1078 tests failed. https://dev.azure.com/azure-sdk/playground/_build/results?buildId=33918&view=ms.vss-test-web.build-test-results-tab&runId=1217924&resultId=100349&paneView=debug
Needs to figure out the reason of failing.
Put along the failed record tests into the second part. Worked on successful ones. Make playback tests run on the success record tests.
Phase 1: Storage API level PR: #3782 Phase 2: Storage Func tests. Phase 3 Transfer Manager
PR out for all the tests: https://github.com/Azure/azure-sdk-for-java/pull/3793
High level Strategy to integrate Record Playback followed in Java Central Repo:
In Record mode, rest client needs to be setup in a way similar to this. You need to pass your custom RestClient to the service client(Keyvault, Storage etc.)
interceptorManager = InterceptorManager.create(testName.getMethodName(), testMode); RestClient restClient; ServiceClientCredentials credentials = createTestCredentials(); if (isRecordMode()) { restClient = buildRestClient(new RestClient.Builder().withBaseUrl(<Service/Resource Endpoint URL>) .withSerializerAdapter(new AzureJacksonAdapter()) .withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials) .withLogLevel(LogLevel.NONE) .withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS)) .withNetworkInterceptor(interceptorManager.initInterceptor()) .withInterceptor(new ResourceManagerThrottlingInterceptor())); -- Utilize this Rest Client to instantiate the service client (e.g KeyvaultClient) } else{ //Playback mode restClient = new RestClient.Builder().withBaseUrl("http://localhost:")
.withSerializerAdapter(new AzureJacksonAdapter())
.withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials)
.withLogLevel(LogLevel.NONE)
.withNetworkInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS))
.withNetworkInterceptor(interceptorManager.initInterceptor())
.withInterceptor(new ResourceManagerThrottlingInterceptor()).build();
-- Utilize this Rest Client to instantiate the service client (e.g KeyvaultClient)
}
Call, interceptorManager.finalizeInterceptor(); -- This step writes the recorded test to a file in record mode, which is used to playback the test later.