(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestLoadWorkflowBadPath(t *testing.T) { |
| 78 | tests := []struct { |
| 79 | name string |
| 80 | path string |
| 81 | }{ |
| 82 | {"absolute missing", "/definitely/does/not/exist.yaml"}, |
| 83 | {"relative missing", "./missing_workflow.yaml"}, |
| 84 | {"directory not file", t.TempDir()}, |
| 85 | } |
| 86 | for _, tc := range tests { |
| 87 | t.Run(tc.name, func(t *testing.T) { |
| 88 | _, err := LoadWorkflow(tc.path) |
| 89 | if err == nil { |
| 90 | t.Fatalf("expected error for %q, got nil", tc.path) |
| 91 | } |
| 92 | if !strings.Contains(err.Error(), "workflow") { |
| 93 | t.Errorf("error %q should mention 'workflow'", err.Error()) |
| 94 | } |
| 95 | }) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | func TestLoadWorkflowMalformedYAML(t *testing.T) { |
| 100 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected