Skip to content

Commit

Permalink
Add "@loki @SQL to all applicable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudbahaa committed Oct 13, 2023
1 parent 1e8f6f1 commit 9cfe47f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 40 deletions.
14 changes: 7 additions & 7 deletions tests/blob/apis/blob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ describe("BlobAPIs", () => {
);
});

it("Copy blob should work @loki", async () => {
it("Copy blob should work @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand Down Expand Up @@ -955,7 +955,7 @@ describe("BlobAPIs", () => {
);
});

it("Copy blob should work to override metadata @loki", async () => {
it("Copy blob should work to override metadata @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand All @@ -979,7 +979,7 @@ describe("BlobAPIs", () => {
assert.deepStrictEqual(result.metadata, metadata2);
});

it("Copy blob should work with source archive blob and accesstier header @loki, @sql", async () => {
it("Copy blob should work with source archive blob and accesstier header @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand Down Expand Up @@ -1014,7 +1014,7 @@ describe("BlobAPIs", () => {
assert.deepStrictEqual(result.accessTier, "Hot");
});

it("Copy blob should not override destination Lease status @loki", async () => {
it("Copy blob should not override destination Lease status @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand Down Expand Up @@ -1049,7 +1049,7 @@ describe("BlobAPIs", () => {
await destLeaseClient.releaseLease();
});

it("Copy blob should work for page blob @loki", async () => {
it("Copy blob should work for page blob @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand Down Expand Up @@ -1108,7 +1108,7 @@ describe("BlobAPIs", () => {
);
});

it("Copy blob should not work for page blob and set tier @loki", async () => {
it("Copy blob should not work for page blob and set tier @loki @sql", async () => {
const sourceBlob = getUniqueName("blob");
const destBlob = getUniqueName("blob");

Expand Down Expand Up @@ -1146,7 +1146,7 @@ describe("BlobAPIs", () => {
assert.deepStrictEqual(err.statusCode, 400);
});

it("Copy blob should fail with 400 when copy source is invalid @loki", async () => {
it("Copy blob should fail with 400 when copy source is invalid @loki @sql", async () => {
const destBlob = getUniqueName("blob");

const destBlobClient = containerClient.getBlockBlobClient(destBlob);
Expand Down
4 changes: 2 additions & 2 deletions tests/blob/apis/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe("ServiceAPIs", () => {
);
});

it("Get Blob service stats negative @loki", async () => {
it("Get Blob service stats negative @loki @sql", async () => {
await serviceClient.getStatistics()
.catch((err) => {
assert.strictEqual(err.statusCode, 400);
Expand Down Expand Up @@ -498,7 +498,7 @@ describe("ServiceAPIs - secondary location endpoint", () => {
await server.clean();
});

it("Get Blob service stats @loki", async () => {
it("Get Blob service stats @loki @sql", async () => {

await serviceClient.getStatistics()
.then((result) => {
Expand Down
14 changes: 7 additions & 7 deletions tests/blob/handlers/AppendBlobHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe("AppendBlobHandler", () => {
).thenResolve(extent);

describe("create", () => {
it("accepts requests withContent-Length == 0 @loki", async () => {
it("accepts requests withContent-Length == 0 @loki @sql", async () => {
const handler = new AppendBlobHandler(
instance(metadataStore),
instance(extentStore),
Expand All @@ -108,7 +108,7 @@ describe("AppendBlobHandler", () => {
});
});

it("accepts requests with Content-Length != 0 in loose mode @loki", async () => {
it("accepts requests with Content-Length != 0 in loose mode @loki @sql", async () => {
const handler = new AppendBlobHandler(
instance(metadataStore),
instance(extentStore),
Expand All @@ -120,7 +120,7 @@ describe("AppendBlobHandler", () => {
});
});

it("rejects requests with Content-Length != 0 @loki", async () => {
it("rejects requests with Content-Length != 0 @loki @sql", async () => {
const handler = new AppendBlobHandler(
instance(metadataStore),
instance(extentStore),
Expand All @@ -146,7 +146,7 @@ describe("AppendBlobHandler", () => {
bufferStream.end(buffer);
});

it("accepts requests with Content-Length != 0 @loki", async () => {
it("accepts requests with Content-Length != 0 @loki @sql", async () => {
const handler = new AppendBlobHandler(
instance(metadataStore),
instance(extentStore),
Expand All @@ -158,7 +158,7 @@ describe("AppendBlobHandler", () => {
});
});

it("rejects requests with Content-Length == 0 @loki", async () => {
it("rejects requests with Content-Length == 0 @loki @sql", async () => {
const handler = new AppendBlobHandler(
instance(metadataStore),
instance(extentStore),
Expand All @@ -176,7 +176,7 @@ describe("AppendBlobHandler", () => {
);
});

it("accepts requests with valid MD5 checksum @loki", async () => {
it("accepts requests with valid MD5 checksum @loki @sql", async () => {
when(request.getHeader(HeaderConstants.CONTENT_MD5)).thenReturn(
"T0EkOEfaaTpPNWwEhhFLxg=="
);
Expand All @@ -195,7 +195,7 @@ describe("AppendBlobHandler", () => {
});
});

it("rejects requests with invalid MD5 checksum @loki", async () => {
it("rejects requests with invalid MD5 checksum @loki @sql", async () => {
when(request.getHeader(HeaderConstants.CONTENT_MD5)).thenReturn(
"d3JvbmdfTUQ1X2NoZWNrc3VtCg=="
);
Expand Down
28 changes: 14 additions & 14 deletions tests/blob/pagewithdelimiter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ describe("PageWithDelimiter", () => {
"e/2"
];

it("handles no blob results @loki", async () => {
it("handles no blob results @loki @sql", async () => {
const page = new PageWithDelimiter<string>(5);
const [items, prefixes, marker] = await page.fill(createReader([], 5), namer);
checkResult(items, prefixes, marker, 0, 0, "");
});

it("fills 1 result properly @loki", async () => {
it("fills 1 result properly @loki @sql", async () => {
const page = new PageWithDelimiter<string>(1);
const [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
checkResult(items, prefixes, marker, 1, 0, "a");
});

it("fills n results properly @loki", async () => {
it("fills n results properly @loki @sql", async () => {
const page = new PageWithDelimiter<string>(5);
const [items, prefixes, marker] = await page.fill(createReader(blobs, 5), namer);
checkResult(items, prefixes, marker, 5, 0, "c/sub/1");
});

it("fills exact count with no continuation @loki", async () => {
it("fills exact count with no continuation @loki @sql", async () => {
const page = new PageWithDelimiter<string>(blobs.length);
const [items, prefixes, marker] = await page.fill(createReader(blobs, blobs.length), namer);
checkResult(items, prefixes, marker, blobs.length, 0, "");
});

it("fills smaller than max page with no continuation @loki", async () => {
it("fills smaller than max page with no continuation @loki @sql", async () => {
const page = new PageWithDelimiter<string>(blobs.length+1);
const [items, prefixes, marker] = await page.fill(createReader(blobs, blobs.length+1), namer);
checkResult(items, prefixes, marker, blobs.length, 0, "");
Expand All @@ -71,21 +71,21 @@ describe("PageWithDelimiter", () => {

describe("and 1 item page size", () => {

it("handles no blob results @loki", async () => {
it("handles no blob results @loki @sql", async () => {
const blobs: string[] = [];
const page = new PageWithDelimiter<string>(1, "/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
checkResult(items, prefixes, marker, 0, 0, "");
});

it("handles 1 blob results @loki", async () => {
it("handles 1 blob results @loki @sql", async () => {
const blobs = ["a"];
const page = new PageWithDelimiter<string>(1, "/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
checkResult(items, prefixes, marker, 1, 0, "");
});

it("returns 1 of 2 items with proper continuation @loki", async () => {
it("returns 1 of 2 items with proper continuation @loki @sql", async () => {
const blobs = ["a", "b"];
const page = new PageWithDelimiter<string>(1, "/");
let [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
Expand All @@ -97,14 +97,14 @@ describe("PageWithDelimiter", () => {
checkResult(items, prefixes, marker, 1, 0, "");
});

it("returns first item when prefixes exist @loki", async () => {
it("returns first item when prefixes exist @loki @sql", async () => {
const blobs = ["a/1", "a/2", "a/3", "a/sub/1"];
const page = new PageWithDelimiter<string>(1, "/", "a/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
checkResult(items, prefixes, marker, 1, 0, "a/1");
});

it("returns first prefix when blobs exist @loki", async () => {
it("returns first prefix when blobs exist @loki @sql", async () => {
const blobs = ["a/s0/1", "a/s0/2", "a/s0/3", "a/s1/1", "a/s2/2", "a/z"];
const page = new PageWithDelimiter<string>(1, "/", "a/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 1), namer);
Expand All @@ -114,21 +114,21 @@ describe("PageWithDelimiter", () => {

describe("multiple item page size", () => {

it("squashes prefixes @loki", async () => {
it("squashes prefixes @loki @sql", async () => {
const blobs = ["a/s0/1", "a/s0/2", "a/s0/3", "a/s1/1", "a/s1/2", "a/s2/2", "a/z"];
const page = new PageWithDelimiter<string>(2, "/", "a/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 2), namer);
checkResult(items, prefixes, marker, 0, 2, "a/s1/2");
});

it("squashes a mix @loki", async () => {
it("squashes a mix @loki @sql", async () => {
const blobs = ["a/a", "a/s0/1", "a/s0/2", "a/s1/1", "a/s1/2", "a/z"];
const page = new PageWithDelimiter<string>(2, "/", "a/");
const [items, prefixes, marker] = await page.fill(createReader(blobs, 2), namer);
checkResult(items, prefixes, marker, 1, 1, "a/s0/2");
});

it("follows squashed pages @loki", async () => {
it("follows squashed pages @loki @sql", async () => {
const blobs = ["a/a", "a/s0/1", "a/s0/2", "a/s1/1", "a/s1/2", "a/z"];
const page = new PageWithDelimiter<string>(2, "/", "a/");
let [items, prefixes, marker] = await page.fill(createReader(blobs, 2), namer);
Expand All @@ -140,7 +140,7 @@ describe("PageWithDelimiter", () => {
checkResult(items, prefixes, marker, 1, 1, "");
});

it("squashes within one larger page @loki", async () => {
it("squashes within one larger page @loki @sql", async () => {
const blobs = ["a/a", "a/s0/1", "a/s0/2", "a/s1/1", "a/s1/2", "a/z"];
const page = new PageWithDelimiter<string>(4, "/", "a/");
let [items, prefixes, marker] = await page.fill(createReader(blobs, 4), namer);
Expand Down
11 changes: 6 additions & 5 deletions tests/blob/sas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ describe("Shared Access Signature (SAS) authentication", () => {
await server.clean();
});

it("generateAccountSASQueryParameters should generate correct hashes", async () => {
//Doesn't work and shouldn't hardcode results and this test @azure/storage-blob not Azurite
it.skip("generateAccountSASQueryParameters should generate correct hashes", async () => {

const startDate = new Date(2022, 3, 16, 14, 31, 48, 0);
const endDate = new Date(2022, 3, 17, 14, 31, 48, 0);
Expand Down Expand Up @@ -520,7 +521,7 @@ describe("Shared Access Signature (SAS) authentication", () => {
await blob2.syncCopyFromURL(blob1.url);
});

it("Copy blob should work with write permission in account SAS to override an existing blob @loki", async () => {
it("Copy blob should work with write permission in account SAS to override an existing blob @loki @sql", async () => {
const tmr = new Date();
tmr.setDate(tmr.getDate() + 1);

Expand Down Expand Up @@ -568,7 +569,7 @@ describe("Shared Access Signature (SAS) authentication", () => {
await blob2.beginCopyFromURL(blob1.url);
});

it("Copy blob shouldn't work without write permission in account SAS to override an existing blob @loki", async () => {
it("Copy blob shouldn't work without write permission in account SAS to override an existing blob @loki @sql", async () => {
const tmr = new Date();
tmr.setDate(tmr.getDate() + 1);

Expand Down Expand Up @@ -623,7 +624,7 @@ describe("Shared Access Signature (SAS) authentication", () => {
assert.ok(error !== undefined);
});

it("Copy blob should work without write permission in account SAS to an nonexisting blob @loki", async () => {
it("Copy blob should work without write permission in account SAS to an nonexisting blob @loki @sql", async () => {
const tmr = new Date();
tmr.setDate(tmr.getDate() + 1);

Expand Down Expand Up @@ -1302,7 +1303,7 @@ describe("Shared Access Signature (SAS) authentication", () => {
await blob2SAS.syncCopyFromURL(blob1.url);
});

it("Synchronized copy blob shouldn't work without write permission in blob SAS to override an existing blob @loki", async () => {
it("Synchronized copy blob shouldn't work without write permission in blob SAS to override an existing blob @loki @sql", async () => {
const now = new Date();
now.setMinutes(now.getMinutes() - 5); // Skip clock skew with server

Expand Down
10 changes: 5 additions & 5 deletions tests/blob/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert = require("assert");
import { convertRawHeadersToMetadata } from "../../src/common/utils/utils";

describe("Utils", () => {
it("convertRawHeadersToMetadata should work", () => {
it("convertRawHeadersToMetadata should work @loki @sql", () => {
// upper case, lower case keys/values
const metadata = convertRawHeadersToMetadata([
"x-ms-meta-Name1",
Expand All @@ -22,7 +22,7 @@ describe("Utils", () => {
});
});

it("convertRawHeadersToMetadata should work with duplicated metadata", () => {
it("convertRawHeadersToMetadata should work with duplicated metadata @loki @sql", () => {
const metadata = convertRawHeadersToMetadata([
"x-ms-meta-name1",
"Value",
Expand All @@ -34,7 +34,7 @@ describe("Utils", () => {
});
});

it("convertRawHeadersToMetadata should work with empty metadata", () => {
it("convertRawHeadersToMetadata should work with empty metadata @loki @sql", () => {
const metadata = convertRawHeadersToMetadata([
"x-ms-meta-Name1",
"",
Expand All @@ -47,12 +47,12 @@ describe("Utils", () => {
});
});

it("convertRawHeadersToMetadata should work with empty raw headers", () => {
it("convertRawHeadersToMetadata should work with empty raw headers @loki @sql", () => {
const metadata = convertRawHeadersToMetadata();
assert.deepStrictEqual(metadata, undefined);
});

it("convertRawHeadersToMetadata should work with empty raw headers array", () => {
it("convertRawHeadersToMetadata should work with empty raw headers array @loki @sql", () => {
const metadata = convertRawHeadersToMetadata([]);
assert.deepStrictEqual(metadata, undefined);
});
Expand Down

0 comments on commit 9cfe47f

Please sign in to comment.