MCPcopy
hub / github.com/helm/helm / TestInstall

Function TestInstall

pkg/cmd/install_test.go:29–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestInstall(t *testing.T) {
30 srv := repotest.NewTempServer(
31 t,
32 repotest.WithChartSourceGlob("testdata/testcharts/*.tgz*"),
33 repotest.WithMiddleware(repotest.BasicAuthMiddleware(t)),
34 )
35 defer srv.Stop()
36
37 srv2 := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
38 http.FileServer(http.Dir(srv.Root())).ServeHTTP(w, r)
39 }))
40 defer srv2.Close()
41
42 if err := srv.LinkIndices(); err != nil {
43 t.Fatal(err)
44 }
45
46 repoFile := filepath.Join(srv.Root(), "repositories.yaml")
47
48 tests := []cmdTestCase{
49 // Install, base case
50 {
51 name: "basic install",
52 cmd: "install aeneas testdata/testcharts/empty --namespace default",
53 golden: "output/install.txt",
54 },
55
56 // Install, values from cli
57 {
58 name: "install with values",
59 cmd: "install virgil testdata/testcharts/alpine --set test.Name=bar",
60 golden: "output/install-with-values.txt",
61 },
62 // Install, values from cli via multiple --set
63 {
64 name: "install with multiple values",
65 cmd: "install virgil testdata/testcharts/alpine --set test.Color=yellow --set test.Name=banana",
66 golden: "output/install-with-multiple-values.txt",
67 },
68 // Install, values from yaml
69 {
70 name: "install with values file",
71 cmd: "install virgil testdata/testcharts/alpine -f testdata/testcharts/alpine/extra_values.yaml",
72 golden: "output/install-with-values-file.txt",
73 },
74 // Install, no hooks
75 {
76 name: "install without hooks",
77 cmd: "install aeneas testdata/testcharts/alpine --no-hooks --set test.Name=hello",
78 golden: "output/install-no-hooks.txt",
79 },
80 // Install, values from multiple yaml
81 {
82 name: "install with values",
83 cmd: "install virgil testdata/testcharts/alpine -f testdata/testcharts/alpine/extra_values.yaml -f testdata/testcharts/alpine/more_values.yaml",
84 golden: "output/install-with-multiple-values-files.txt",
85 },
86 // Install, no charts

Callers

nothing calls this directly

Calls 12

NewTempServerFunction · 0.92
WithChartSourceGlobFunction · 0.92
WithMiddlewareFunction · 0.92
BasicAuthMiddlewareFunction · 0.92
runTestCmdFunction · 0.85
StopMethod · 0.80
CloseMethod · 0.80
LinkIndicesMethod · 0.80
FatalMethod · 0.80
URLMethod · 0.80
DirMethod · 0.65
RootMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…