fix: add timeout to CI-slow tests + check stderr for help output
CI / check (pull_request) Failing after 1m55s
CI / check (pull_request) Failing after 1m55s
This commit is contained in:
@@ -241,7 +241,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(finalEntry!.head).toBe(step2.head);
|
expect(finalEntry!.head).toBe(step2.head);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("2. branching workflow loops developer→reviewer→developer→reviewer→$END", async () => {
|
test("2. branching workflow loops developer→reviewer→developer→reviewer→$END", { timeout: 30_000 }, async () => {
|
||||||
await writeMockConfig("e2e-loop.mock.yaml");
|
await writeMockConfig("e2e-loop.mock.yaml");
|
||||||
const workflowHash = await addWorkflow("e2e-loop.workflow.yaml", "test-loop");
|
const workflowHash = await addWorkflow("e2e-loop.workflow.yaml", "test-loop");
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(finalEntry!.status).toBe("completed");
|
expect(finalEntry!.status).toBe("completed");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("3. role mismatch in mock data makes the agent exit with an error", async () => {
|
test("3. role mismatch in mock data makes the agent exit with an error", { timeout: 30_000 }, async () => {
|
||||||
// Reuses the linear workflow but with a mock whose step[1].role is wrong.
|
// Reuses the linear workflow but with a mock whose step[1].role is wrong.
|
||||||
await writeMockConfig("e2e-mismatch.mock.yaml");
|
await writeMockConfig("e2e-mismatch.mock.yaml");
|
||||||
const workflowHash = await addWorkflow("e2e-linear.workflow.yaml", "test-linear");
|
const workflowHash = await addWorkflow("e2e-linear.workflow.yaml", "test-linear");
|
||||||
@@ -325,7 +325,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(entry!.head).toBe(step1.head);
|
expect(entry!.head).toBe(step1.head);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("4. planner $SUSPEND then resume re-runs planner and reaches $END", async () => {
|
test("4. planner $SUSPEND then resume re-runs planner and reaches $END", { timeout: 30_000 }, async () => {
|
||||||
await writeMockConfig("e2e-suspend.mock.yaml");
|
await writeMockConfig("e2e-suspend.mock.yaml");
|
||||||
const workflowHash = await addWorkflow("e2e-suspend.workflow.yaml", "test-suspend");
|
const workflowHash = await addWorkflow("e2e-suspend.workflow.yaml", "test-suspend");
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(finalEntry!.head).toBe(resumeOut.head);
|
expect(finalEntry!.head).toBe(resumeOut.head);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("5. --count 3 runs the whole linear pipeline in one invocation", async () => {
|
test("5. --count 3 runs the whole linear pipeline in one invocation", { timeout: 30_000 }, async () => {
|
||||||
await writeMockConfig("e2e-count.mock.yaml");
|
await writeMockConfig("e2e-count.mock.yaml");
|
||||||
const workflowHash = await addWorkflow("e2e-count.workflow.yaml", "test-count");
|
const workflowHash = await addWorkflow("e2e-count.workflow.yaml", "test-count");
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(finalEntry!.head).toBe(results[2].head);
|
expect(finalEntry!.head).toBe(results[2].head);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("6. mustache edge prompt renders planner variables into the worker step", async () => {
|
test("6. mustache edge prompt renders planner variables into the worker step", { timeout: 30_000 }, async () => {
|
||||||
await writeMockConfig("e2e-mustache.mock.yaml");
|
await writeMockConfig("e2e-mustache.mock.yaml");
|
||||||
const workflowHash = await addWorkflow("e2e-mustache.workflow.yaml", "test-mustache");
|
const workflowHash = await addWorkflow("e2e-mustache.workflow.yaml", "test-mustache");
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ describe("E2E mock-agent: full uwf pipeline", () => {
|
|||||||
expect(workerStep.edgePrompt).toBe("Work on branch fix/42-auth in /tmp/my-repo");
|
expect(workerStep.edgePrompt).toBe("Work on branch fix/42-auth in /tmp/my-repo");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("7. completed thread can be resumed (衔尾蛇: end → start)", async () => {
|
test("7. completed thread can be resumed (衔尾蛇: end → start)", { timeout: 30_000 }, async () => {
|
||||||
// Reuse the suspend workflow (planner with ready → $END), but mock data
|
// Reuse the suspend workflow (planner with ready → $END), but mock data
|
||||||
// goes straight to ready on first run, then ready again after resume.
|
// goes straight to ready on first run, then ready again after resume.
|
||||||
await writeMockConfig("e2e-completed-resume.mock.yaml");
|
await writeMockConfig("e2e-completed-resume.mock.yaml");
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ describe("prompt commands", () => {
|
|||||||
expect(result).toContain("version");
|
expect(result).toContain("version");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("prompt help subcommand is suppressed", () => {
|
test("prompt help subcommand is suppressed", { timeout: 30_000 }, () => {
|
||||||
const output = execFileSync("npx", ["tsx", "src/cli.ts", "prompt", "--help"], {
|
const output = execFileSync("npx", ["tsx", "src/cli.ts", "prompt", "--help"], {
|
||||||
cwd: join(__dirname, "..", ".."),
|
cwd: join(__dirname, "..", ".."),
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
|
|||||||
@@ -24,15 +24,17 @@ function runCli(args: string[]): { stdout: string; stderr: string; exitCode: num
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe("thread exec --count CLI parsing", () => {
|
describe("thread exec --count CLI parsing", () => {
|
||||||
test("--help shows -c/--count option", () => {
|
test("--help shows -c/--count option", { timeout: 30_000 }, () => {
|
||||||
const result = runCli(["thread", "exec", "--help"]);
|
const result = runCli(["thread", "exec", "--help"]);
|
||||||
expect(result.stdout).toContain("--count");
|
const combined = result.stdout + result.stderr;
|
||||||
expect(result.stdout).toContain("-c");
|
expect(combined).toContain("--count");
|
||||||
|
expect(combined).toContain("-c");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("description says 'one or more steps'", () => {
|
test("description says 'one or more steps'", { timeout: 30_000 }, () => {
|
||||||
const result = runCli(["thread", "exec", "--help"]);
|
const result = runCli(["thread", "exec", "--help"]);
|
||||||
expect(result.stdout).toContain("one or more steps");
|
const combined = result.stdout + result.stderr;
|
||||||
|
expect(combined).toContain("one or more steps");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user