(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestParseAgentTaskConfig(t *testing.T) { |
| 10 | tests := []struct { |
| 11 | name string |
| 12 | outputMap map[string]any |
| 13 | wantConfig bool |
| 14 | wantBase string |
| 15 | wantRepo string |
| 16 | }{ |
| 17 | { |
| 18 | name: "parse basic agent-session config", |
| 19 | outputMap: map[string]any{ |
| 20 | "create-agent-session": map[string]any{}, |
| 21 | }, |
| 22 | wantConfig: true, |
| 23 | wantBase: "", |
| 24 | wantRepo: "", |
| 25 | }, |
| 26 | { |
| 27 | name: "parse agent-session config with base branch", |
| 28 | outputMap: map[string]any{ |
| 29 | "create-agent-session": map[string]any{ |
| 30 | "base": "develop", |
| 31 | }, |
| 32 | }, |
| 33 | wantConfig: true, |
| 34 | wantBase: "develop", |
| 35 | wantRepo: "", |
| 36 | }, |
| 37 | { |
| 38 | name: "parse agent-session config with target-repo", |
| 39 | outputMap: map[string]any{ |
| 40 | "create-agent-session": map[string]any{ |
| 41 | "target-repo": "owner/repo", |
| 42 | }, |
| 43 | }, |
| 44 | wantConfig: true, |
| 45 | wantBase: "", |
| 46 | wantRepo: "owner/repo", |
| 47 | }, |
| 48 | { |
| 49 | name: "parse agent-session config with all fields", |
| 50 | outputMap: map[string]any{ |
| 51 | "create-agent-session": map[string]any{ |
| 52 | "base": "main", |
| 53 | "target-repo": "owner/repo", |
| 54 | "max": 1, |
| 55 | }, |
| 56 | }, |
| 57 | wantConfig: true, |
| 58 | wantBase: "main", |
| 59 | wantRepo: "owner/repo", |
| 60 | }, |
| 61 | { |
| 62 | name: "no agent-session config", |
| 63 | outputMap: map[string]any{}, |
| 64 | wantConfig: false, |
| 65 | }, |
| 66 | { |
nothing calls this directly
no test coverage detected