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

Function TestIsRunnable_WithLockFile

pkg/cli/run_workflow_validation_test.go:41–160  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestIsRunnable_WithLockFile(t *testing.T) {
42 tests := []struct {
43 name string
44 markdownFile string
45 lockFileYAML string
46 expectRunnable bool
47 expectError bool
48 errorContains string
49 }{
50 {
51 name: "workflow with workflow_dispatch trigger",
52 markdownFile: "test-workflow.md",
53 lockFileYAML: `name: "Test Workflow"
54on:
55 workflow_dispatch:
56permissions:
57 contents: read
58jobs:
59 test:
60 runs-on: ubuntu-latest
61 steps:
62 - run: echo "test"
63`,
64 expectRunnable: true,
65 expectError: false,
66 },
67 {
68 name: "workflow with schedule and workflow_dispatch",
69 markdownFile: "daily-workflow.md",
70 lockFileYAML: `name: "Daily Workflow"
71on:
72 schedule:
73 - cron: "0 0 * * *"
74 workflow_dispatch:
75permissions:
76 contents: read
77jobs:
78 test:
79 runs-on: ubuntu-latest
80 steps:
81 - run: echo "test"
82`,
83 expectRunnable: true,
84 expectError: false,
85 },
86 {
87 name: "workflow without workflow_dispatch",
88 markdownFile: "pr-workflow.md",
89 lockFileYAML: `name: "PR Workflow"
90on:
91 pull_request:
92 types: [opened]
93permissions:
94 contents: read
95jobs:
96 test:
97 runs-on: ubuntu-latest
98 steps:

Callers

nothing calls this directly

Calls 4

getLockFilePathFunction · 0.85
IsRunnableFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected