From f78d7f2aa5d07c8ac7ba65f87fe66ea21bc1075a Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 7 Mar 2026 23:49:54 +0000 Subject: test(task): update validator and parser tests to use AgentConfig --- internal/task/parser_test.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'internal/task/parser_test.go') diff --git a/internal/task/parser_test.go b/internal/task/parser_test.go index cb68e86..7c3aadc 100644 --- a/internal/task/parser_test.go +++ b/internal/task/parser_test.go @@ -11,7 +11,8 @@ func TestParse_SingleTask(t *testing.T) { yaml := ` name: "Test Task" description: "A simple test" -claude: +agent: + type: "claude" model: "sonnet" instructions: "Do something" working_dir: "/tmp" @@ -30,8 +31,8 @@ tags: if task.Name != "Test Task" { t.Errorf("expected name 'Test Task', got %q", task.Name) } - if task.Claude.Model != "sonnet" { - t.Errorf("expected model 'sonnet', got %q", task.Claude.Model) + if task.Agent.Model != "sonnet" { + t.Errorf("expected model 'sonnet', got %q", task.Agent.Model) } if task.Timeout.Duration != 10*time.Minute { t.Errorf("expected timeout 10m, got %v", task.Timeout.Duration) @@ -51,12 +52,14 @@ func TestParse_BatchTasks(t *testing.T) { yaml := ` tasks: - name: "Task A" - claude: + agent: + type: "claude" instructions: "Do A" working_dir: "/tmp" tags: ["alpha"] - name: "Task B" - claude: + agent: + type: "claude" instructions: "Do B" working_dir: "/tmp" tags: ["beta"] @@ -79,7 +82,8 @@ tasks: func TestParse_MissingName_ReturnsError(t *testing.T) { yaml := ` description: "no name" -claude: +agent: + type: "claude" instructions: "something" ` _, err := Parse([]byte(yaml)) @@ -91,7 +95,8 @@ claude: func TestParse_DefaultRetryConfig(t *testing.T) { yaml := ` name: "Defaults" -claude: +agent: + type: "claude" instructions: "test" ` tasks, err := Parse([]byte(yaml)) @@ -110,7 +115,8 @@ func TestParse_WithPriority(t *testing.T) { yaml := ` name: "High Priority" priority: "high" -claude: +agent: + type: "claude" instructions: "urgent" ` tasks, err := Parse([]byte(yaml)) @@ -127,7 +133,8 @@ func TestParseFile(t *testing.T) { path := filepath.Join(dir, "task.yaml") content := ` name: "File Task" -claude: +agent: + type: "claude" instructions: "from file" working_dir: "/tmp" ` -- cgit v1.2.3