(t *testing.T)
| 271 | } |
| 272 | |
| 273 | func TestCompileToYAML_EndToEnd(t *testing.T) { |
| 274 | // Full round trip: markdown string -> parse -> compile -> YAML string |
| 275 | markdown := `--- |
| 276 | name: e2e-test |
| 277 | description: End-to-end string API test |
| 278 | on: |
| 279 | issues: |
| 280 | types: [opened] |
| 281 | engine: copilot |
| 282 | --- |
| 283 | |
| 284 | # Mission |
| 285 | |
| 286 | When a new issue is opened, add a welcome comment. |
| 287 | ` |
| 288 | |
| 289 | compiler := NewCompiler( |
| 290 | WithNoEmit(true), |
| 291 | WithSkipValidation(true), |
| 292 | ) |
| 293 | |
| 294 | wd, err := compiler.ParseWorkflowString(markdown, "workflow.md") |
| 295 | require.NoError(t, err) |
| 296 | |
| 297 | yaml, err := compiler.CompileToYAML(wd, "workflow.md") |
| 298 | require.NoError(t, err) |
| 299 | |
| 300 | // Verify the YAML is valid-looking |
| 301 | // CompileToYAML skips the ASCII art header (wasm/editor mode), so YAML starts with the name |
| 302 | assert.NotContains(t, yaml, "Agentic", "compiled YAML should not contain ASCII art header") |
| 303 | assert.Contains(t, yaml, "e2e-test") |
| 304 | assert.Contains(t, yaml, "issues") |
| 305 | } |
| 306 | |
| 307 | func TestCompileToYAML_PromptContentInlined(t *testing.T) { |
| 308 | // Verify that the markdown prompt content is inlined in the compiled YAML |
nothing calls this directly
no test coverage detected