-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add recorded tests for Storage #6609
Conversation
/azp run net - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run net - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run net - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Changes to Azure.Core testing framework look good! |
/azp run net - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run net - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -118,17 +118,17 @@ public async Task CreateAsync_Metadata() | |||
} | |||
|
|||
//TODO | |||
[Ignore] | |||
[TestMethod] | |||
[Ignore("Not yet implemented")] |
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.
Should we have an issue for this?
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.
I haven't been filing issues for the Storage Team's TODOs that were already in the code. We should chat tomorrow about whether we want to do this and possibly add a work item in the next milestone for me to add issues for all TODOs.
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.
Looks good to me, though I lack a thorough understanding of the contexts and our recorded test infrastructure. You'll probably want at least one other approval rather than relying on just me.
- Improve the StorageRequestFailedException error message - Have Response.Headers.Date return x-ms-date if Date isn't present - Make tests more reliable with MemoryStream.ToArray() instead .GetBuffer() Here's an example of an error message with additional info specified: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:6b6d5a57-201e-007b-2291-250f92000000 Time:2019-06-18T04:53:02.9793056Z Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) ErrorCode: AuthenticationFailed Additional Information: AuthenticationErrorDetail: The MAC signature found in the HTTP request 'T8bvpwE2Fp9cKr9yAfo1kblARYwUoRLovmH1nIlPrpQ=' is not the same as any computed signature. Server used following string to sign: 'GET x-ms-client-request-id:097eb32f-12eb-476b-8fe2-e912b96e6974 x-ms-date:Tue, 18 Jun 2019 04:53:01 GMT x-ms-return-client-request-id:true x-ms-version:2018-11-09 /storageteglazatesting/ comp:properties restype:account'. Headers: Server: Microsoft-HTTPAPI/2.0 x-ms-request-id: 6b6d5a57-201e-007b-2291-250f92000000 x-ms-error-code: AuthenticationFailed Date: Tue, 18 Jun 2019 04:53:02 GMT Content-Length: 779 Content-Type: application/xml
Most of the changes are tweaking the Storage tests to be less stateful. They used a lot of random values and
DateTimeOffset.Now
which needed to be isolated to individual test methods so replaying works correctly. The staticTestHelper
class, in particular, had to be turned into base classes that can access the current testRecording
member variable.You can set the
AZURE_TEST_MODE
environment variable toLive
for running tests against the live service,Record
for updating recordings,Playback
to run the recordings, or leave it empty to default toPlayback
. Additionally, all of the Storage test classes allow you to pass theRecordedTestMode
enum into theirctor
if you want to override the environment variable (only intended for use while developing)./cc @kfarmer-msft and @seanmcc-msft