(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestSetAppVersion(t *testing.T) { |
| 170 | var ch *chart.Chart |
| 171 | expectedAppVersion := "app-version-foo" |
| 172 | chartToPackage := "testdata/testcharts/alpine" |
| 173 | dir := t.TempDir() |
| 174 | cmd := fmt.Sprintf("package %s --destination=%s --app-version=%s", chartToPackage, dir, expectedAppVersion) |
| 175 | _, output, err := executeActionCommand(cmd) |
| 176 | if err != nil { |
| 177 | t.Logf("Output: %s", output) |
| 178 | t.Fatal(err) |
| 179 | } |
| 180 | chartPath := filepath.Join(dir, "alpine-0.1.0.tgz") |
| 181 | if fi, err := os.Stat(chartPath); err != nil { |
| 182 | t.Errorf("expected file %q, got err %q", chartPath, err) |
| 183 | } else if fi.Size() == 0 { |
| 184 | t.Errorf("file %q has zero bytes.", chartPath) |
| 185 | } |
| 186 | ch, err = loader.Load(chartPath) |
| 187 | if err != nil { |
| 188 | t.Fatalf("unexpected error loading packaged chart: %v", err) |
| 189 | } |
| 190 | if ch.Metadata.AppVersion != expectedAppVersion { |
| 191 | t.Errorf("expected app-version %q, found %q", expectedAppVersion, ch.Metadata.AppVersion) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | func TestPackageFileCompletion(t *testing.T) { |
| 196 | checkFileCompletion(t, "package", true) |
nothing calls this directly
no test coverage detected
searching dependent graphs…