Skip to content

Commit

Permalink
add unittes for 'helm dep build' with --skip-refresh flag.
Browse files Browse the repository at this point in the history
Signed-off-by: yxxhero <[email protected]>
(cherry picked from commit 4b229cc)
  • Loading branch information
yxxhero authored and mattfarina committed Nov 11, 2020
1 parent 5522ce9 commit c4e7485
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/helm/dependency_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ func TestDependencyBuildCmd(t *testing.T) {
if v := reqver.Version; v != "0.1.0" {
t.Errorf("mismatched versions. Expected %q, got %q", "0.1.0", v)
}

skipRefreshCmd := fmt.Sprintf("dependency build '%s' --skip-refresh --repository-config %s --repository-cache %s", filepath.Join(rootDir, chartname), repoFile, rootDir)
_, out, err = executeActionCommand(skipRefreshCmd)

// In this pass, we check --skip-refresh option becomes effective.
if err != nil {
t.Logf("Output: %s", out)
t.Fatal(err)
}

if strings.Contains(out, `update from the "test" chart repository`) {
t.Errorf("Repo did get updated\n%s", out)
}
}

func TestDependencyBuildCmdWithHelmV2Hash(t *testing.T) {
Expand Down

0 comments on commit c4e7485

Please sign in to comment.