MCPcopy
hub / github.com/roboll/helmfile / Test_BuildDeps

Function Test_BuildDeps

pkg/helmexec/exec_test.go:311–338  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func Test_BuildDeps(t *testing.T) {
312 var buffer bytes.Buffer
313 logger := NewLogger(&buffer, "debug")
314 helm := MockExecer(logger, "dev")
315 err := helm.BuildDeps("foo", "./chart/foo")
316 expected := `Building dependency release=foo, chart=./chart/foo
317exec: helm --kube-context dev dependency build ./chart/foo
318`
319 if err != nil {
320 t.Errorf("unexpected error: %v", err)
321 }
322 if buffer.String() != expected {
323 t.Errorf("helmexec.BuildDeps()\nactual = %v\nexpect = %v", buffer.String(), expected)
324 }
325
326 buffer.Reset()
327 helm.SetExtraArgs("--verify")
328 err = helm.BuildDeps("foo", "./chart/foo")
329 expected = `Building dependency release=foo, chart=./chart/foo
330exec: helm --kube-context dev dependency build ./chart/foo --verify
331`
332 if err != nil {
333 t.Errorf("unexpected error: %v", err)
334 }
335 if buffer.String() != expected {
336 t.Errorf("helmexec.BuildDeps()\nactual = %v\nexpect = %v", buffer.String(), expected)
337 }
338}
339
340func Test_DecryptSecret(t *testing.T) {
341 var buffer bytes.Buffer

Callers

nothing calls this directly

Calls 4

NewLoggerFunction · 0.85
MockExecerFunction · 0.70
BuildDepsMethod · 0.65
SetExtraArgsMethod · 0.65

Tested by

no test coverage detected