(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func TestRenderRefsOrdering(t *testing.T) { |
| 146 | modTime := time.Now() |
| 147 | |
| 148 | parentChart := &chart.Chart{ |
| 149 | Metadata: &chart.Metadata{ |
| 150 | Name: "parent", |
| 151 | Version: "1.2.3", |
| 152 | }, |
| 153 | Templates: []*common.File{ |
| 154 | {Name: "templates/_helpers.tpl", ModTime: modTime, Data: []byte(`{{- define "test" -}}parent value{{- end -}}`)}, |
| 155 | {Name: "templates/test.yaml", ModTime: modTime, Data: []byte(`{{ tpl "{{ include \"test\" . }}" . }}`)}, |
| 156 | }, |
| 157 | } |
| 158 | childChart := &chart.Chart{ |
| 159 | Metadata: &chart.Metadata{ |
| 160 | Name: "child", |
| 161 | Version: "1.2.3", |
| 162 | }, |
| 163 | Templates: []*common.File{ |
| 164 | {Name: "templates/_helpers.tpl", ModTime: modTime, Data: []byte(`{{- define "test" -}}child value{{- end -}}`)}, |
| 165 | }, |
| 166 | } |
| 167 | parentChart.AddDependency(childChart) |
| 168 | |
| 169 | expect := map[string]string{ |
| 170 | "parent/templates/test.yaml": "parent value", |
| 171 | } |
| 172 | |
| 173 | for i := range 100 { |
| 174 | out, err := Render(parentChart, common.Values{}) |
| 175 | if err != nil { |
| 176 | t.Fatalf("Failed to render templates: %s", err) |
| 177 | } |
| 178 | |
| 179 | for name, data := range expect { |
| 180 | if out[name] != data { |
| 181 | t.Fatalf("Expected %q, got %q (iteration %d)", data, out[name], i+1) |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | func TestRenderInternals(t *testing.T) { |
| 188 | // Test the internals of the rendering tool. |
nothing calls this directly
no test coverage detected
searching dependent graphs…