From 46b17b268fd1e2456e00d5e19d547c89fa52144c Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Thu, 10 Sep 2020 15:23:38 +0800 Subject: [PATCH] test create, resize, uploadRange for 4tb file with a preprod account --- .../storage-file-share/test/fileclient.spec.ts | 18 +++++++++--------- .../storage-file-share/test/utils/index.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/storage/storage-file-share/test/fileclient.spec.ts b/sdk/storage/storage-file-share/test/fileclient.spec.ts index f490c036a128..2e220d1fcb6c 100644 --- a/sdk/storage/storage-file-share/test/fileclient.spec.ts +++ b/sdk/storage/storage-file-share/test/fileclient.spec.ts @@ -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"; @@ -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 () => { diff --git a/sdk/storage/storage-file-share/test/utils/index.ts b/sdk/storage/storage-file-share/test/utils/index.ts index 1621b0eee117..0de08e5051f5 100644 --- a/sdk/storage/storage-file-share/test/utils/index.ts +++ b/sdk/storage/storage-file-share/test/utils/index.ts @@ -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); }