Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev-tool] Restore the assets only when they are present #32752

Merged
merged 10 commits into from
Jan 28, 2025
3 changes: 2 additions & 1 deletion common/tools/dev-tool/src/commands/run/testVitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { runTestsWithProxyTool } from "../../util/testUtils";
import { createPrinter } from "../../util/printer";
import { shouldStartRelay, startRelayServer } from "../../util/browserRelayServer";
import { runTestProxyCommand } from "../../util/testProxyUtils";
import fs from "fs-extra";

const log = createPrinter("test:vitest");

Expand Down Expand Up @@ -93,7 +94,7 @@ export default leafCommand(commandInfo, async (options) => {
if (options["test-proxy-debug"]) process.env["Logging__LogLevel__Default"] = "Debug";

// restore recordings first in CI to avoid impacting the first playback test
if (process.env["BUILD_BUILDNUMBER"]) {
if (process.env["BUILD_BUILDNUMBER"] && (await fs.pathExists("assets.json"))) {
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
log.info(`restoring recordings before testing`);
await runTestProxyCommand(["restore", "-a", "assets.json"]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe("#parseEventHubSpan(...)", () => {

assert.strictEqual((baseData as any).source, undefined);
assert.strictEqual(baseData.measurements, undefined);
assert.strictEqual("abc", "abc") // added to test https://github.com/Azure/azure-sdk-for-js/pull/32752, revert this after testing
});

it("should correctly parse SpanKind.PRODUCER", () => {
Expand Down
Loading