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

Function TestMissingDataConfigParsing

pkg/workflow/missing_data_test.go:118–234  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func TestMissingDataConfigParsing(t *testing.T) {
119 tests := []struct {
120 name string
121 configData map[string]any
122 expectNil bool
123 expectMax int
124 expectIssue *string
125 expectTitle string
126 expectLabels []string
127 }{
128 {
129 name: "Default config with nil value",
130 configData: map[string]any{
131 "missing-data": nil,
132 },
133 expectNil: false,
134 expectMax: 0,
135 expectIssue: strPtr("false"),
136 expectTitle: "[missing data]",
137 expectLabels: []string{},
138 },
139 {
140 name: "Config with create-issue disabled",
141 configData: map[string]any{
142 "missing-data": map[string]any{
143 "create-issue": false,
144 },
145 },
146 expectNil: false,
147 expectMax: 0,
148 expectIssue: strPtr("false"),
149 expectTitle: "[missing data]",
150 expectLabels: []string{},
151 },
152 {
153 name: "Config with create-issue as expression",
154 configData: map[string]any{
155 "missing-data": map[string]any{
156 "create-issue": "${{ inputs.create-missing-data-issue }}",
157 },
158 },
159 expectNil: false,
160 expectMax: 0,
161 expectIssue: strPtr("${{ inputs.create-missing-data-issue }}"),
162 expectTitle: "[missing data]",
163 expectLabels: []string{},
164 },
165 {
166 name: "Config with custom title and labels",
167 configData: map[string]any{
168 "missing-data": map[string]any{
169 "title-prefix": "[data needed]",
170 "labels": []any{"data", "blocked"},
171 "max": 10,
172 },
173 },
174 expectNil: false,
175 expectMax: 10,

Callers

nothing calls this directly

Calls 7

strPtrFunction · 0.85
NewCompilerFunction · 0.85
templatableIntValueFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected