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

Function TestGetWorkflowInputs

pkg/cli/run_input_validation_test.go:12–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestGetWorkflowInputs(t *testing.T) {
13 tests := []struct {
14 name string
15 lockContent string
16 expectedCount int
17 expectedReq map[string]bool // map of input name to required status
18 }{
19 {
20 name: "workflow with required and optional inputs",
21 lockContent: `name: "Test Workflow"
22on:
23 workflow_dispatch:
24 inputs:
25 issue_url:
26 description: 'Issue URL'
27 required: true
28 type: string
29 debug_mode:
30 description: 'Enable debug mode'
31 required: false
32 type: boolean
33jobs:
34 test:
35 runs-on: ubuntu-latest
36 steps:
37 - run: echo "test"
38`,
39 expectedCount: 2,
40 expectedReq: map[string]bool{
41 "issue_url": true,
42 "debug_mode": false,
43 },
44 },
45 {
46 name: "workflow with no inputs",
47 lockContent: `name: "Test Workflow"
48on:
49 workflow_dispatch:
50jobs:
51 test:
52 runs-on: ubuntu-latest
53 steps:
54 - run: echo "test"
55`,
56 expectedCount: 0,
57 },
58 {
59 name: "workflow without workflow_dispatch",
60 lockContent: `name: "Test Workflow"
61on:
62 issues:
63 types: [opened]
64jobs:
65 test:
66 runs-on: ubuntu-latest
67 steps:
68 - run: echo "test"
69`,

Callers

nothing calls this directly

Calls 3

getWorkflowInputsFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected