TestCompileWorkflowData_Success tests CompileWorkflowData with valid workflow data
(t *testing.T)
| 279 | |
| 280 | // TestCompileWorkflowData_Success tests CompileWorkflowData with valid workflow data |
| 281 | func 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 := `--- |
| 294 | on: push |
| 295 | engine: copilot |
| 296 | --- |
| 297 | |
| 298 | # Test |
| 299 | |
| 300 | Test 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 | |
| 314 | func TestCompileWorkflow_CachesResolvedManifestBaseline(t *testing.T) { |
| 315 | tmpDir := testutil.TempDir(t, "compiler-manifest-cache") |
nothing calls this directly
no test coverage detected