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

Azure Storage Turn on Fixed Tests #4422

Closed
wants to merge 23 commits into from

Conversation

alzimmermsft
Copy link
Member

Fixes #4325

  • Turns on tests that had changes made in Azure Core to support
  • Turns on the 'Download with retry range' test
  • Renamed DownloadAsyncResponse to DownloadResponse

@alzimmermsft alzimmermsft changed the title Az storage turn on tests Azure Storage Turn on Fixed Tests Jul 12, 2019
@alzimmermsft alzimmermsft self-assigned this Jul 15, 2019
@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Jul 15, 2019
…to ContainerClient (Azure#4376)

* Removed raw clients

* Added deleteContainer to StorageClient

* Added getAppendBlob with snapshot to ContainerClient
@alzimmermsft alzimmermsft changed the base branch from storage-post-review1-dev to master July 25, 2019 23:40
@alzimmermsft alzimmermsft requested a review from sima-zhu as a code owner July 26, 2019 00:07
@@ -336,7 +337,7 @@
* @return
* A reactive response containing the information of the cleared pages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Make return one line.

return null
}
@Override
Mono<String> bodyAsString(Charset charset) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary to have, it looks like a duplicate to the one above? Since it is a mock response, we can only include the necessary part.

Copy link
Member Author

Choose a reason for hiding this comment

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

You have to include everything as it's implementing an interface, I should change extends -> implements

@@ -15,8 +16,9 @@

@BeforeClass
public static void setup() {
String endpoint = String.format("https://%s.blob.core.windows.net", ConfigurationManager.getConfiguration().get("PRIMARY_STORAGE_ACCOUNT_KEY"));
Copy link
Contributor

Choose a reason for hiding this comment

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

PRIMARY_STORAGE_ACCOUNT_KEY. It should be account name

Copy link
Member Author

Choose a reason for hiding this comment

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

This class is being deleted in another PR

storageClient = new BlobServiceClientBuilder()
.endpoint("https://" + System.getenv("ACCOUNT_NAME") + ".blob.core.windows.net")
.endpoint(endpoint)
.credential(new EnvironmentCredential())
// .httpClient(HttpClient.createDefault().proxy(() -> new ProxyOptions(Type.HTTP, new InetSocketAddress("localhost", 8888))))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

This class is being deleted in another PR

@@ -57,6 +57,9 @@ class AppendBlobAPITest extends APISpec {
bu.create(headers, null, null, null)
Response<BlobProperties> response = bu.getProperties()

// If the value isn't set the service will automatically set it
contentType = (contentType == null) ? "application/octet-stream" : contentType
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason you remove it from APISpec but added here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't true for all cases that used the method

@@ -368,15 +372,15 @@ class BlobAPITest extends APISpec {
.blobContentType("type")
.blobCacheControl(properties.cacheControl())
.blobContentLanguage(properties.contentLanguage())
.blobContentMD5(Base64.getDecoder().decode(properties.contentMD5()))
.blobContentMD5(Base64.getEncoder().encode(MessageDigest.getInstance("MD5").digest(defaultData.array())))
Copy link
Contributor

Choose a reason for hiding this comment

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

This line of changes is really different than original one. Why change it like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous call was trying to decode the default data that was sent to the service incorrectly. This new call is just constructing the ContentMD5 from the actual source.

}*/
response.value().pageRange().size() == 1
validateBasicHeaders(response.headers())
Integer.parseInt(response.headers().value("x-ms-blob-content-length")) == PageBlobClient.PAGE_BYTES
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, do we maintain the header value as "x-ms-blob-content-length" instead of "Content-Length"?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a custom header that contains the blob size, Content-Length contains other information

@alzimmermsft
Copy link
Member Author

Changes made in this PR were captured in #4491

@alzimmermsft alzimmermsft deleted the AzStorage_TurnOnTests branch August 2, 2019 18:09
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. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn on Disabled Tests
3 participants