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

Function TestRuntimeIfConditionIntegration

pkg/workflow/runtime_integration_test.go:370–528  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368}
369
370func TestRuntimeIfConditionIntegration(t *testing.T) {
371 tests := []struct {
372 name string
373 frontmatter map[string]any
374 expectedIfGo bool
375 expectedIfPy bool
376 expectedIfNode bool
377 expectedGoIf string
378 expectedPyIf string
379 expectedNodeIf string
380 }{
381 {
382 name: "go runtime with hashFiles if condition",
383 frontmatter: map[string]any{
384 "name": "test-workflow",
385 "engine": "copilot",
386 "runtimes": map[string]any{
387 "go": map[string]any{
388 "version": "1.25",
389 "if": "hashFiles('go.mod') != ''",
390 },
391 },
392 },
393 expectedIfGo: true,
394 expectedGoIf: "hashFiles('go.mod') != ''",
395 },
396 {
397 name: "multiple runtimes with different if conditions",
398 frontmatter: map[string]any{
399 "name": "test-workflow",
400 "engine": "copilot",
401 "runtimes": map[string]any{
402 "go": map[string]any{
403 "version": "1.25",
404 "if": "hashFiles('go.mod') != ''",
405 },
406 "python": map[string]any{
407 "version": "3.11",
408 "if": "hashFiles('requirements.txt') != '' || hashFiles('pyproject.toml') != ''",
409 },
410 "node": map[string]any{
411 "version": "20",
412 "if": "hashFiles('package.json') != ''",
413 },
414 },
415 },
416 expectedIfGo: true,
417 expectedIfPy: true,
418 expectedIfNode: true,
419 expectedGoIf: "hashFiles('go.mod') != ''",
420 expectedPyIf: "hashFiles('requirements.txt') != '' || hashFiles('pyproject.toml') != ''",
421 expectedNodeIf: "hashFiles('package.json') != ''",
422 },
423 {
424 name: "runtime with only if condition, no version",
425 frontmatter: map[string]any{
426 "name": "test-workflow",
427 "engine": "copilot",

Callers

nothing calls this directly

Calls 6

ParseFrontmatterConfigFunction · 0.85
applyRuntimeOverridesFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected