Skip to content

Commit

Permalink
merge conflict changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chradek committed Apr 2, 2021
1 parent 290fe12 commit 3a5e13d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 65 deletions.
58 changes: 31 additions & 27 deletions sdk/eventhub/event-hubs/test/internal/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ describe("internal/auth.spec.ts", function() {
}

describe("Authentication via", () => {
const {
endpoint,
fullyQualifiedNamespace,
sharedAccessKey,
sharedAccessKeyName
} = parseEventHubConnectionString(env[EnvVarKeys.EVENTHUB_CONNECTION_STRING]);
const service = {
connectionString: env[EnvVarKeys.EVENTHUB_CONNECTION_STRING],
path: env[EnvVarKeys.EVENTHUB_NAME],
endpoint: parseEventHubConnectionString(
env[EnvVarKeys.EVENTHUB_CONNECTION_STRING]
).endpoint.replace(/\/+$/, "")
endpoint: endpoint.replace(/\/+$/, "")
};

before(() => {
Expand Down Expand Up @@ -166,38 +170,38 @@ describe("internal/auth.spec.ts", function() {
await producerClient.close();
});
});
});

describe("using SASCredential", () => {
it("EventHubConsumerClient", async () => {
const sasCredential = new AzureSASCredential(getSas());
describe("using SASCredential", () => {
it("EventHubConsumerClient", async () => {
const sasCredential = new AzureSASCredential(getSas());

const consumerClient = new EventHubConsumerClient(
"$Default",
fullyQualifiedNamespace,
service.path,
sasCredential
);
const consumerClient = new EventHubConsumerClient(
"$Default",
fullyQualifiedNamespace,
service.path,
sasCredential
);

const properties = await consumerClient.getEventHubProperties();
should.exist(properties);
const properties = await consumerClient.getEventHubProperties();
should.exist(properties);

await consumerClient.close();
});
await consumerClient.close();
});

it("EventHubProducerClient", async () => {
const sasCredential = new AzureSASCredential(getSas());
it("EventHubProducerClient", async () => {
const sasCredential = new AzureSASCredential(getSas());

const producerClient = new EventHubProducerClient(
fullyQualifiedNamespace,
service.path,
sasCredential
);
const producerClient = new EventHubProducerClient(
fullyQualifiedNamespace,
service.path,
sasCredential
);

const properties = await producerClient.getEventHubProperties();
should.exist(properties);
const properties = await producerClient.getEventHubProperties();
should.exist(properties);

await producerClient.close();
await producerClient.close();
});
});
});
});
Expand Down
26 changes: 7 additions & 19 deletions sdk/eventhub/event-hubs/test/internal/sender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ describe("internal/sender.spec.ts", function() {
{ body: `${list[i].name}` },
{
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
}
);
Expand Down Expand Up @@ -402,9 +400,7 @@ describe("internal/sender.spec.ts", function() {
function modernOptions(rootSpan: TestSpan): OperationOptions {
return {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
};
}
Expand Down Expand Up @@ -485,9 +481,7 @@ describe("internal/sender.spec.ts", function() {
}
await producerClient.sendBatch(eventDataBatch, {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
rootSpan.end();
Expand Down Expand Up @@ -772,9 +766,7 @@ describe("internal/sender.spec.ts", function() {
await producerClient.sendBatch(events, {
partitionId: "0",
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
rootSpan.end();
Expand Down Expand Up @@ -931,9 +923,7 @@ describe("internal/sender.spec.ts", function() {
}
await producerClient.sendBatch(events, {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
rootSpan.end();
Expand Down Expand Up @@ -1005,9 +995,7 @@ describe("internal/sender.spec.ts", function() {
events[0].properties = { [TRACEPARENT_PROPERTY]: "foo" };
await producerClient.sendBatch(events, {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
rootSpan.end();
Expand Down Expand Up @@ -1066,7 +1054,7 @@ describe("internal/sender.spec.ts", function() {
throw new Error(`Test failure`);
} catch (err) {
err.name.should.equal("AbortError");
err.message.should.equal("Send request has been cancelled.");
err.message.should.equal(StandardAbortMessage);
}
});

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/test/public/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createSasTokenProvider } from "@azure/core-amqp";
import { SinonFakeTimers, useFakeTimers } from "sinon";

const should = chai.should();
const env = getEnvVars();
const env = getEnvVars("live");

const TEST_FAILURE = "test failure";

Expand Down
24 changes: 6 additions & 18 deletions sdk/eventhub/event-hubs/test/public/hubruntime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const ids = await producerClient.getPartitionIds({
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
ids.should.have.members(arrayOfIncreasingNumbersFromZero(ids.length));
Expand Down Expand Up @@ -166,9 +164,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const ids = await consumerClient.getPartitionIds({
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
ids.should.have.members(arrayOfIncreasingNumbersFromZero(ids.length));
Expand Down Expand Up @@ -261,9 +257,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const hubRuntimeInfo = await producerClient.getEventHubProperties({
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
hubRuntimeInfo.partitionIds.should.have.members(
Expand Down Expand Up @@ -300,9 +294,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const hubRuntimeInfo = await consumerClient.getEventHubProperties({
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
hubRuntimeInfo.partitionIds.should.have.members(
Expand Down Expand Up @@ -473,9 +465,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const partitionRuntimeInfo = await producerClient.getPartitionProperties("0", {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
partitionRuntimeInfo.partitionId.should.equal("0");
Expand Down Expand Up @@ -514,9 +504,7 @@ describe("public/hubruntime.spec.ts", function() {
const rootSpan = tracer.startSpan("root");
const partitionRuntimeInfo = await consumerClient.getPartitionProperties("0", {
tracingOptions: {
spanOptions: {
parent: rootSpan.context()
}
tracingContext: setSpan(context.active(), rootSpan)
}
});
partitionRuntimeInfo.partitionId.should.equal("0");
Expand Down

0 comments on commit 3a5e13d

Please sign in to comment.