From f12b60385aa1a32a21fe9104eb31ea15ebcfc0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=9C=88?= Date: Sat, 30 May 2026 14:24:33 +0800 Subject: [PATCH] test: update worktree test to match new tea pr create procedure tea pr create should run from main repo dir instead of using --repo flag, because tea cannot detect repo from worktree .git files. --- .../__tests__/solve-issue-tea-worktree.test.ts | 17 +++++------------ packages/workflow-agent-claude-code/src/cli.ts | 0 2 files changed, 5 insertions(+), 12 deletions(-) mode change 100644 => 100755 packages/workflow-agent-claude-code/src/cli.ts diff --git a/packages/cli-workflow/src/__tests__/solve-issue-tea-worktree.test.ts b/packages/cli-workflow/src/__tests__/solve-issue-tea-worktree.test.ts index 5683213..cd93e01 100644 --- a/packages/cli-workflow/src/__tests__/solve-issue-tea-worktree.test.ts +++ b/packages/cli-workflow/src/__tests__/solve-issue-tea-worktree.test.ts @@ -24,7 +24,7 @@ describe("solve-issue workflow: tea pr create worktree fix", () => { "solve-issue.yaml", ); - test("committer procedure should include --repo flag in tea pr create command", async () => { + test("committer procedure should require running tea pr create from main repo directory", async () => { const yamlContent = await readFile(workflowPath, "utf-8"); const workflow = parse(yamlContent) as WorkflowPayload; @@ -32,19 +32,12 @@ describe("solve-issue workflow: tea pr create worktree fix", () => { const committerProcedure = workflow.roles.committer?.procedure; expect(committerProcedure).toBeDefined(); - // Verify the procedure includes tea pr create with --repo flag + // Verify the procedure includes tea pr create expect(committerProcedure).toContain("tea pr create"); - expect(committerProcedure).toContain("--repo"); - // Verify the --repo flag appears before or together with tea pr create - // This ensures the command is: tea pr create --repo ... - const teaPrCreateMatch = committerProcedure?.match(/tea pr create[^\n]*/); - expect(teaPrCreateMatch).not.toBeNull(); - - if (teaPrCreateMatch) { - const teaCommandLine = teaPrCreateMatch[0]; - expect(teaCommandLine).toContain("--repo"); - } + // Verify the procedure warns about running from main repo dir (not worktree) + expect(committerProcedure).toMatch(/main repo directory/i); + expect(committerProcedure).toMatch(/not a worktree/i); }); test("committer procedure should mention repo extraction from git remote", async () => { diff --git a/packages/workflow-agent-claude-code/src/cli.ts b/packages/workflow-agent-claude-code/src/cli.ts old mode 100644 new mode 100755