fix(ci): add createWorkflowAuthoringTools to partial engine mocks; bump roadmap schema assertion to 109
This commit is contained in:
@@ -5,6 +5,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
|
||||
// Mock the engine module to avoid dynamic import issues in tests
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ const { mockChatStreamManager, mockSendMessage, mockCancelGeneration, mockBeginG
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({ createFnAgent: vi.fn() }));
|
||||
vi.mock("@fusion/engine", () => ({ createFnAgent: vi.fn(), createWorkflowAuthoringTools: vi.fn(() => []) }));
|
||||
vi.mock("../planning.js", () => ({
|
||||
getSession: vi.fn(), cleanupSession: vi.fn(), __setCreateFnAgent: vi.fn(), __resetPlanningState: vi.fn(), setAiSessionStore: vi.fn(), rehydrateFromStore: vi.fn().mockReturnValue(0),
|
||||
}));
|
||||
|
||||
@@ -21,6 +21,7 @@ const mockErrors = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
defaultGitOps: vi.fn(() => ({})),
|
||||
ExperimentFinalizeService: vi.fn(() => ({ previewPlan: previewPlanMock, finalize: finalizeMock })),
|
||||
ExperimentFinalizeStateError: mockErrors.StateError,
|
||||
|
||||
@@ -7,6 +7,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ vi.mock("node:child_process", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({
|
||||
session: {
|
||||
prompt: promptMock,
|
||||
|
||||
@@ -33,6 +33,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({
|
||||
session: {
|
||||
state: { messages: [] as Array<{ role: string; content: string }> },
|
||||
|
||||
@@ -55,6 +55,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
executeApprovedAgentProvisioning: vi.fn(async () => undefined),
|
||||
}));
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class MockApprovalRequestStore {
|
||||
vi.mock("@fusion/core", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@fusion/core")>()), ApprovalRequestStore: MockApprovalRequestStore, AgentStore: class { async init() {} async getAgent() { return null; } } }));
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
executeApprovedAgentProvisioning: vi.fn(),
|
||||
executeApprovedWorktrunkInstall: vi.fn(),
|
||||
assertNoSecretPlaintext: (metadata?: Record<string, unknown>) => {
|
||||
|
||||
@@ -86,6 +86,7 @@ vi.mock("@fusion/core", async (importOriginal) => ({
|
||||
const executeApprovedWorktrunkInstall = vi.fn(async () => ({ binaryPath: "~/.fusion/bin/wt", source: "installed-release" }));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
executeApprovedAgentProvisioning,
|
||||
executeApprovedWorktrunkInstall,
|
||||
}));
|
||||
|
||||
@@ -26,6 +26,7 @@ class MockApprovalRequestStore {
|
||||
}
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
WORKTRUNK_INSTALL_PATH: "~/.fusion/bin/wt",
|
||||
WORKTRUNK_PINNED_RELEASE: {
|
||||
source: "upstream-pending-verification",
|
||||
|
||||
@@ -45,6 +45,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
createResolvedAgentSession: vi.fn(async () => ({
|
||||
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },
|
||||
|
||||
@@ -38,6 +38,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({
|
||||
session: {
|
||||
state: { messages: [] as Array<{ role: string; content: string }> },
|
||||
|
||||
@@ -9,6 +9,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
}));
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
|
||||
createResolvedAgentSession: vi.fn(async () => ({
|
||||
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },
|
||||
|
||||
@@ -28,6 +28,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
|
||||
createResolvedAgentSession: vi.fn(async () => ({
|
||||
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },
|
||||
|
||||
@@ -34,6 +34,7 @@ vi.mock("@fusion/core", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@fusion/engine", () => ({
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
|
||||
createResolvedAgentSession: vi.fn(async () => ({
|
||||
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },
|
||||
|
||||
@@ -47,6 +47,9 @@ export function createEngineMock(overrides: AnyModule = {}): AnyModule {
|
||||
return withFallbackFunctions(actual, {
|
||||
createFnAgent: vi.fn(),
|
||||
promptWithFallback: vi.fn(),
|
||||
// Returns an iterable tool list; dashboard code spreads its result
|
||||
// (`...createWorkflowAuthoringTools(...)`), so it must not be undefined.
|
||||
createWorkflowAuthoringTools: vi.fn(() => []),
|
||||
...overrides,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user