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

Function TestCompileWorkflowData_Success

pkg/workflow/compiler_test.go:281–312  ·  view source on GitHub ↗

TestCompileWorkflowData_Success tests CompileWorkflowData with valid workflow data

(t *testing.T)

Source from the content-addressed store, hash-verified

279
280// TestCompileWorkflowData_Success tests CompileWorkflowData with valid workflow data
281func TestCompileWorkflowData_Success(t *testing.T) {
282 tmpDir := testutil.TempDir(t, "compiler-data-test")
283
284 workflowData := &WorkflowData{
285 Name: "Test Workflow",
286 Command: []string{"echo", "test"},
287 MarkdownContent: "# Test\n\nTest content",
288 AI: "copilot",
289 }
290
291 markdownPath := filepath.Join(tmpDir, "test.md")
292 // Create the markdown file (needed for lock file generation)
293 testContent := `---
294on: push
295engine: copilot
296---
297
298# Test
299
300Test content
301`
302 require.NoError(t, os.WriteFile(markdownPath, []byte(testContent), 0644))
303
304 compiler := NewCompiler()
305 err := compiler.CompileWorkflowData(workflowData, markdownPath)
306 require.NoError(t, err, "CompileWorkflowData should succeed with valid data")
307
308 // Verify lock file was created
309 lockFile := stringutil.MarkdownToLockFile(markdownPath)
310 _, err = os.Stat(lockFile)
311 require.NoError(t, err, "Lock file should be created")
312}
313
314func TestCompileWorkflow_CachesResolvedManifestBaseline(t *testing.T) {
315 tmpDir := testutil.TempDir(t, "compiler-manifest-cache")

Callers

nothing calls this directly

Calls 4

CompileWorkflowDataMethod · 0.95
TempDirFunction · 0.92
MarkdownToLockFileFunction · 0.92
NewCompilerFunction · 0.85

Tested by

no test coverage detected