test(foundry): use approved token placeholders

This commit is contained in:
Vincent Koc
2026-07-15 05:03:42 +01:00
committed by Peter Steinberger
parent 41aa36a6e7
commit 11c570294a
+6 -6
View File
@@ -434,7 +434,7 @@ describe("microsoft-foundry plugin", () => {
it("preserves the model-derived base URL for Entra runtime auth refresh", async () => {
const provider = registerProvider();
const prepareRuntimeAuth = requirePrepareRuntimeAuth(provider);
mockAzureCliToken({ accessToken: "test-token", expiresInMs: 60_000 });
mockAzureCliToken({ accessToken: "test-token-placeholder", expiresInMs: 60_000 });
ensureAuthProfileStoreMock.mockReturnValueOnce(buildEntraProfileStore());
const prepared = requireRuntimeAuthResult(
@@ -444,7 +444,7 @@ describe("microsoft-foundry plugin", () => {
expect(prepared.baseUrl).toBe("https://example.services.ai.azure.com/openai/v1");
expect(prepared.request?.auth).toEqual({
mode: "authorization-bearer",
token: "test-token",
token: "test-token-placeholder",
});
expect(execFileMock.mock.calls[0]?.[1]).toEqual(
expect.arrayContaining(["--resource", COGNITIVE_SERVICES_RESOURCE]),
@@ -454,7 +454,7 @@ describe("microsoft-foundry plugin", () => {
it("falls back to Entra metadata when a configured Foundry endpoint is malformed", async () => {
const provider = registerProvider();
const prepareRuntimeAuth = requirePrepareRuntimeAuth(provider);
mockAzureCliToken({ accessToken: "test-token", expiresInMs: 60_000 });
mockAzureCliToken({ accessToken: "test-token-placeholder", expiresInMs: 60_000 });
ensureAuthProfileStoreMock.mockReturnValueOnce(buildEntraProfileStore());
const prepared = requireRuntimeAuthResult(
@@ -469,7 +469,7 @@ describe("microsoft-foundry plugin", () => {
expect(prepared.baseUrl).toBe("https://example.services.ai.azure.com/openai/v1");
expect(prepared.request?.auth).toEqual({
mode: "authorization-bearer",
token: "test-token",
token: "test-token-placeholder",
});
});
@@ -502,7 +502,7 @@ describe("microsoft-foundry plugin", () => {
it("uses active model routing when Entra metadata points at another deployment", async () => {
const provider = registerProvider();
const prepareRuntimeAuth = requirePrepareRuntimeAuth(provider);
mockAzureCliToken({ accessToken: "test-token", expiresInMs: 60_000 });
mockAzureCliToken({ accessToken: "test-token-placeholder", expiresInMs: 60_000 });
ensureAuthProfileStoreMock.mockReturnValueOnce(
buildEntraProfileStore({
endpoint: "https://example.services.ai.azure.com",
@@ -1765,7 +1765,7 @@ describe("microsoft-foundry plugin", () => {
it("preserves project-scoped endpoint prefixes when extracting the Foundry endpoint", async () => {
const provider = registerProvider();
mockAzureCliToken({ accessToken: "test-token", expiresInMs: 60_000 });
mockAzureCliToken({ accessToken: "test-token-placeholder", expiresInMs: 60_000 });
ensureAuthProfileStoreMock.mockReturnValueOnce({ profiles: {} });
const prepared = await provider.prepareRuntimeAuth?.(