MCPcopy Create free account
hub / github.com/github/gh-aw / TestParseAgentTaskConfig

Function TestParseAgentTaskConfig

pkg/workflow/create_agent_session_test.go:9–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func 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 {

Callers

nothing calls this directly

Calls 5

NewCompilerFunction · 0.85
templatableIntValueFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected