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

Function TestMissingToolConfigParsing

pkg/workflow/missing_tool_test.go:188–368  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

186}
187
188func TestMissingToolConfigParsing(t *testing.T) {
189 compiler := NewCompiler()
190
191 tests := []struct {
192 name string
193 configData map[string]any
194 expectMax int
195 expectCreateIssue *string
196 expectTitlePrefix string
197 expectLabels []string
198 expectError bool
199 }{
200 {
201 name: "Empty config - defaults",
202 configData: map[string]any{"missing-tool": nil},
203 expectMax: 0,
204 expectCreateIssue: strPtr("false"),
205 expectTitlePrefix: "[missing tool]",
206 expectLabels: []string{},
207 },
208 {
209 name: "Config with max as int",
210 configData: map[string]any{
211 "missing-tool": map[string]any{"max": 5},
212 },
213 expectMax: 5,
214 expectCreateIssue: strPtr("false"),
215 expectTitlePrefix: "[missing tool]",
216 expectLabels: []string{},
217 },
218 {
219 name: "Config with max as float64 (from YAML)",
220 configData: map[string]any{
221 "missing-tool": map[string]any{"max": float64(10)},
222 },
223 expectMax: 10,
224 expectCreateIssue: strPtr("false"),
225 expectTitlePrefix: "[missing tool]",
226 expectLabels: []string{},
227 },
228 {
229 name: "Config with max as int64",
230 configData: map[string]any{
231 "missing-tool": map[string]any{"max": int64(15)},
232 },
233 expectMax: 15,
234 expectCreateIssue: strPtr("false"),
235 expectTitlePrefix: "[missing tool]",
236 expectLabels: []string{},
237 },
238 {
239 name: "No missing-tool key",
240 configData: map[string]any{},
241 expectMax: -1, // Indicates nil config
242 },
243 {
244 name: "Explicit false disables missing-tool",
245 configData: map[string]any{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected