Skip to content

Commit

Permalink
Temp add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww committed Dec 2, 2024
1 parent ed350d8 commit 049161c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/BlobTestServerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BlobConfiguration from "../src/blob/BlobConfiguration";
import BlobServer from "../src/blob/BlobServer";
import SqlBlobConfiguration from "../src/blob/SqlBlobConfiguration";
import SqlBlobServer from "../src/blob/SqlBlobServer";
import { AzuriteTelemetryClient } from "../src/common/Telemetry";
import { StoreDestinationArray } from "../src/common/persistence/IExtentStore";
import { DEFAULT_SQL_OPTIONS } from "../src/common/utils/constants";

Expand Down Expand Up @@ -75,6 +76,7 @@ export default class BlobTestServerFactory {
undefined,
inMemoryPersistence
);
AzuriteTelemetryClient.init("", true, undefined);
return new BlobServer(config);
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/blob/blobCorsRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from "../testutils";
import OPTIONSRequestPolicyFactory from "./RequestPolicy/OPTIONSRequestPolicyFactory";
import OriginPolicyFactory from "./RequestPolicy/OriginPolicyFactory";
import { AzuriteTelemetryClient } from "../../src/common/Telemetry";

// Set true to enable debug log
configLogger(false);
Expand All @@ -41,11 +42,13 @@ describe("Blob Cors requests test", () => {

before(async () => {
await server.start();
await AzuriteTelemetryClient.TraceStartEvent("Blob Test");
});

after(async () => {
await server.close();
await server.clean();
AzuriteTelemetryClient.TraceStopEvent("Blob Test");
});

it("OPTIONS request without cors rules in server should be fail @loki @sql", async () => {
Expand Down
3 changes: 3 additions & 0 deletions tests/queue/oauth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { StoreDestinationArray } from "../../src/common/persistence/IExtentStore
import { EMULATOR_ACCOUNT_KEY, generateJWTToken, getUniqueName } from "../testutils";
import { SimpleTokenCredential } from "../simpleTokenCredential";
import QueueTestServerFactory from "./utils/QueueTestServerFactory";
import { AzuriteTelemetryClient } from "../../src/common/Telemetry";

// Set true to enable debug log
configLogger(false);
Expand Down Expand Up @@ -41,11 +42,13 @@ describe("Queue OAuth Basic", () => {
oauth: "basic"
})
await server.start();
await AzuriteTelemetryClient.TraceStartEvent("Queue Test");
});

after(async () => {
await server.close();
await server.clean();
AzuriteTelemetryClient.TraceStopEvent("Queue Test");
});

it(`Should work with create container @loki @sql`, async () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/queue/utils/QueueTestServerFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AzuriteTelemetryClient } from "../../../src/common/Telemetry"
import { StoreDestinationArray } from "../../../src/common/persistence/IExtentStore"
import QueueConfiguration from "../../../src/queue/QueueConfiguration"
import QueueServer from "../../../src/queue/QueueServer"
Expand Down Expand Up @@ -43,6 +44,7 @@ export default class QueueTestServerFactory {
undefined,
inMemoryPersistence
);
AzuriteTelemetryClient.init("", true, undefined);
return new QueueServer(config);
}
}
4 changes: 4 additions & 0 deletions tests/table/apis/table.entity.azure.data-tables.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
LargeDataTablesTestEntityFactory,
LargeTableTestEntity
} from "../models/LargeDataTablesTestEntityFactory";
import { AzuriteTelemetryClient } from "../../../src/common/Telemetry";
// Set true to enable debug log
configLogger(false);
// For convenience, we have a switch to control the use
Expand All @@ -38,10 +39,13 @@ describe("table Entity APIs test - using Azure/data-tables", () => {
before(async () => {
server = createTableServerForTestHttps();
await server.start();
AzuriteTelemetryClient.init("", true, undefined);
await AzuriteTelemetryClient.TraceStartEvent("Table Test");
});

after(async () => {
await server.close();
AzuriteTelemetryClient.TraceStopEvent("Table Test");
});

it("01. Batch API should return row keys in format understood by @azure/data-tables, @loki", async () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/table/utils/TableTestServerFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AzuriteTelemetryClient } from "../../../src/common/Telemetry";
import TableConfiguration from "../../../src/table/TableConfiguration";
import TableServer from "../../../src/table/TableServer";

Expand Down Expand Up @@ -42,6 +43,7 @@ export default class TableTestServerFactory {
undefined,
inMemoryPersistence
);
AzuriteTelemetryClient.init("", true, undefined);
return new TableServer(config);
}
}

0 comments on commit 049161c

Please sign in to comment.