test(FN-5039): stabilize workflow scope tests under attribution filtering
Fusion-Task-Id: FN-5039 Fusion-Task-Lineage: 324b7259-e08f-4051-b89c-b94836b73d5d
This commit is contained in:
committed by
gsxdsm
parent
447c18c52e
commit
656744fb95
@@ -853,6 +853,7 @@ describe("Workflow Steps Execution", () => {
|
||||
});
|
||||
|
||||
const executor = new TaskExecutor(store, "/tmp/test", {});
|
||||
vi.spyOn(executor as any, "captureModifiedFiles").mockResolvedValue(["packages/engine/src/foo.ts"]);
|
||||
const executeStepSpy = vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task, "/tmp/test", {});
|
||||
@@ -974,6 +975,7 @@ describe("Workflow Steps Execution", () => {
|
||||
});
|
||||
|
||||
const executor = new TaskExecutor(store, "/tmp/test", {});
|
||||
vi.spyOn(executor as any, "captureModifiedFiles").mockResolvedValue(["packages/engine/src/foo.ts"]);
|
||||
const executeStepSpy = vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(pausedTask, "/tmp/test", {});
|
||||
|
||||
@@ -92,6 +92,7 @@ describe("executor workflow step scope gating", () => {
|
||||
mockDiffFiles(diffFiles);
|
||||
|
||||
const executor = new TaskExecutor(store as any, "/tmp/test", {} as any);
|
||||
vi.spyOn(executor as any, "captureModifiedFiles").mockResolvedValue(diffFiles);
|
||||
const executeStepSpy = vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task as any, "/tmp/test", {} as any);
|
||||
@@ -117,6 +118,7 @@ describe("executor workflow step scope gating", () => {
|
||||
mockDiffFiles(["packages/engine/src/executor.ts"]);
|
||||
|
||||
const executor = new TaskExecutor(store as any, "/tmp/test", {} as any);
|
||||
vi.spyOn(executor as any, "captureModifiedFiles").mockResolvedValue(["packages/engine/src/executor.ts"]);
|
||||
vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task as any, "/tmp/test", { workflowStepScopeEnforcement: "block" } as any);
|
||||
@@ -133,6 +135,9 @@ describe("executor workflow step scope gating", () => {
|
||||
mockDiffSequence([], ["packages/dashboard/app/components/TaskDetailModal.tsx"]);
|
||||
|
||||
const executor = new TaskExecutor(store as any, "/tmp/test", {} as any);
|
||||
vi.spyOn(executor as any, "captureModifiedFiles")
|
||||
.mockResolvedValueOnce([])
|
||||
.mockResolvedValueOnce(["packages/dashboard/app/components/TaskDetailModal.tsx"]);
|
||||
vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task as any, "/tmp/test", { workflowStepScopeEnforcement: "block" } as any);
|
||||
@@ -154,6 +159,9 @@ describe("executor workflow step scope gating", () => {
|
||||
);
|
||||
|
||||
const executor = new TaskExecutor(store as any, "/tmp/test", {} as any);
|
||||
vi.spyOn(executor as any, "captureModifiedFiles")
|
||||
.mockResolvedValueOnce(["packages/engine/src/executor.ts"])
|
||||
.mockResolvedValueOnce(["packages/engine/src/executor.ts", "packages/dashboard/app/components/TaskDetailModal.tsx"]);
|
||||
vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task as any, "/tmp/test", { workflowStepScopeEnforcement: "block" } as any);
|
||||
@@ -171,6 +179,9 @@ describe("executor workflow step scope gating", () => {
|
||||
mockDiffSequence([], ["packages/dashboard/app/components/TaskDetailModal.tsx"]);
|
||||
|
||||
const executor = new TaskExecutor(store as any, "/tmp/test", {} as any);
|
||||
vi.spyOn(executor as any, "captureModifiedFiles")
|
||||
.mockResolvedValueOnce([])
|
||||
.mockResolvedValueOnce(["packages/dashboard/app/components/TaskDetailModal.tsx"]);
|
||||
vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "ok" });
|
||||
|
||||
const result = await (executor as any).runWorkflowSteps(task as any, "/tmp/test", { workflowStepScopeEnforcement: "warn" } as any);
|
||||
|
||||
@@ -708,6 +708,9 @@ describe("In-progress task resume after restart", () => {
|
||||
}));
|
||||
|
||||
const executor = new TaskExecutor(store, "/tmp/test");
|
||||
vi.spyOn(executor as any, "captureModifiedFiles").mockResolvedValue([
|
||||
"packages/dashboard/app/components/SettingsModal.tsx",
|
||||
]);
|
||||
const executeSpy = vi.spyOn(executor, "execute");
|
||||
|
||||
mockedExecSync.mockImplementation((command) => {
|
||||
|
||||
Reference in New Issue
Block a user