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

Function TestResolveWorkflowName_MissingNameField

pkg/workflow/resolve_test.go:187–201  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

185}
186
187func TestResolveWorkflowName_MissingNameField(t *testing.T) {
188 workflowsDir := setupWorkflowDir(t)
189
190 // Create workflow with valid YAML but missing name field
191 mdFile := filepath.Join(workflowsDir, "no-name.md")
192 lockFile := filepath.Join(workflowsDir, "no-name.lock.yml")
193
194 require.NoError(t, os.WriteFile(mdFile, []byte("# No Name\nSome content"), 0644), "failed to write workflow markdown file")
195 require.NoError(t, os.WriteFile(lockFile, []byte("on: push\njobs: {}\n"), 0644), "failed to write lock file without name field")
196
197 // Test that it returns an error when name field is missing
198 _, err := ResolveWorkflowName("no-name")
199 require.Error(t, err, "ResolveWorkflowName should return an error when name field is missing")
200 assert.Contains(t, err.Error(), "workflow name not found", "error should mention missing workflow name")
201}
202
203func TestResolveWorkflowName_ExistingAgenticWorkflow(t *testing.T) {
204 // The test is run from the project root where go.mod is located.

Callers

nothing calls this directly

Calls 3

setupWorkflowDirFunction · 0.85
ResolveWorkflowNameFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected