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

Function TestCompileToYAML_EndToEnd

pkg/workflow/compiler_string_api_test.go:273–305  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

271}
272
273func TestCompileToYAML_EndToEnd(t *testing.T) {
274 // Full round trip: markdown string -> parse -> compile -> YAML string
275 markdown := `---
276name: e2e-test
277description: End-to-end string API test
278on:
279 issues:
280 types: [opened]
281engine: copilot
282---
283
284# Mission
285
286When 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
307func TestCompileToYAML_PromptContentInlined(t *testing.T) {
308 // Verify that the markdown prompt content is inlined in the compiled YAML

Callers

nothing calls this directly

Calls 5

ParseWorkflowStringMethod · 0.95
CompileToYAMLMethod · 0.95
NewCompilerFunction · 0.85
WithNoEmitFunction · 0.85
WithSkipValidationFunction · 0.85

Tested by

no test coverage detected