Skip to content

Commit

Permalink
test create, resize, uploadRange for 4tb file with a preprod account
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin Jian committed Sep 10, 2020
1 parent 8700fd7 commit 46b17b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions sdk/storage/storage-file-share/test/fileclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as dotenv from "dotenv";
import { AbortController } from "@azure/abort-controller";
import { isNode, URLBuilder, URLQuery } from "@azure/core-http";
import { setTracer, SpanGraph, TestTracer } from "@azure/core-tracing";
import { delay, record, Recorder, isPlaybackMode } from "@azure/test-utils-recorder";
import { delay, record, Recorder } from "@azure/test-utils-recorder";

import { FileStartCopyOptions, ShareClient, ShareDirectoryClient, ShareFileClient } from "../src";
import { FileSystemAttributes } from "../src/FileSystemAttributes";
Expand Down Expand Up @@ -149,21 +149,21 @@ describe("FileClient", () => {
assert.ok(properties.fileParentId!);
});

// need to skip this test in live as it requires Premium_LRS SKU for 2019-12-12.
it("create largest file", async function() {
it.only("create largest file", async function() {
// IE complains about "Arithmetic result exceeded 32 bits".
if (!isPlaybackMode() || (!isNode && isIE())) {
if (!isNode && isIE()) {
this.skip();
}

const GB = 1024 * 1024 * 1024;
await shareClient.setQuota(FILE_MAX_SIZE_BYTES / GB);
const cResp = await fileClient.create(FILE_MAX_SIZE_BYTES);
const fileSize = FILE_MAX_SIZE_BYTES;
const cResp = await fileClient.create(fileSize);
assert.equal(cResp.errorCode, undefined);

await fileClient.resize(FILE_MAX_SIZE_BYTES);
await fileClient.resize(fileSize);
const updatedProperties = await fileClient.getProperties();
assert.deepStrictEqual(updatedProperties.contentLength, FILE_MAX_SIZE_BYTES);
assert.deepStrictEqual(updatedProperties.contentLength, fileSize);

await fileClient.uploadRange(content, fileSize - content.length, content.length);
});

it("setProperties with default parameters", async () => {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/test/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getGenericBSU(
// Enable logger when debugging
// logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO)
});
const filePrimaryURL = `https://${accountName}${accountNameSuffix}.file.core.windows.net/`;
const filePrimaryURL = `https://${accountName}${accountNameSuffix}.file.preprod.core.windows.net/`;
return new ShareServiceClient(filePrimaryURL, pipeline);
}

Expand Down

0 comments on commit 46b17b2

Please sign in to comment.