MCPcopy
hub / github.com/helm/helm / TestLoadFilesOrder

Function TestLoadFilesOrder

internal/chart/v3/loader/load_test.go:269–341  ·  view source on GitHub ↗

Test the order of file loading. The Chart.yaml file needs to come first for later comparison checks. See https://github.com/helm/helm/pull/8948

(t *testing.T)

Source from the content-addressed store, hash-verified

267// Test the order of file loading. The Chart.yaml file needs to come first for
268// later comparison checks. See https://github.com/helm/helm/pull/8948
269func TestLoadFilesOrder(t *testing.T) {
270 modTime := time.Now()
271 goodFiles := []*archive.BufferedFile{
272 {
273 Name: "requirements.yaml",
274 ModTime: modTime,
275 Data: []byte("dependencies:"),
276 },
277 {
278 Name: "values.yaml",
279 ModTime: modTime,
280 Data: []byte("var: some values"),
281 },
282
283 {
284 Name: "templates/deployment.yaml",
285 ModTime: modTime,
286 Data: []byte("some deployment"),
287 },
288 {
289 Name: "templates/service.yaml",
290 ModTime: modTime,
291 Data: []byte("some service"),
292 },
293 {
294 Name: "Chart.yaml",
295 ModTime: modTime,
296 Data: []byte(`apiVersion: v3
297name: frobnitz
298description: This is a frobnitz.
299version: "1.2.3"
300keywords:
301 - frobnitz
302 - sprocket
303 - dodad
304maintainers:
305 - name: The Helm Team
306 email: helm@example.com
307 - name: Someone Else
308 email: nobody@example.com
309sources:
310 - https://example.com/foo/bar
311home: http://example.com
312icon: https://example.com/64x64.png
313`),
314 },
315 }
316
317 // Capture stderr to make sure message about Chart.yaml handle dependencies
318 // is not present
319 r, w, err := os.Pipe()
320 if err != nil {
321 t.Fatalf("Unable to create pipe: %s", err)
322 }
323 stderr := log.Writer()
324 log.SetOutput(w)
325 defer func() {
326 log.SetOutput(stderr)

Callers

nothing calls this directly

Calls 6

NowMethod · 0.80
FatalfMethod · 0.80
CloseMethod · 0.80
CopyMethod · 0.80
LoadFilesFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…