(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…