Contract: Render with a values file that does not exist surfaces a loadValues error naming the missing file. Confirms loadValues' errors propagate up cleanly.
(t *testing.T)
| 120 | // loadValues error naming the missing file. Confirms loadValues' |
| 121 | // errors propagate up cleanly. |
| 122 | func TestContract_Render_BadValueFileError(t *testing.T) { |
| 123 | chartRoot := createTestChart(t, "tc", "config.yaml", "machine:\n type: worker\n") |
| 124 | _, err := Render(context.Background(), nil, Options{ |
| 125 | Offline: true, |
| 126 | Root: chartRoot, |
| 127 | ValueFiles: []string{"/path/that/does/not/exist.yaml"}, |
| 128 | TemplateFiles: []string{"templates/config.yaml"}, |
| 129 | }) |
| 130 | if err == nil { |
| 131 | t.Fatal("expected error for missing values file") |
| 132 | } |
| 133 | if !strings.Contains(err.Error(), "does/not/exist") { |
| 134 | t.Errorf("error must reference the missing path, got: %v", err) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | // === Render: happy path === |
| 139 |
nothing calls this directly
no test coverage detected