From 4b229cc2151cacd055c45331cab4160956b0c03a Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sat, 24 Oct 2020 05:04:43 -0400 Subject: [PATCH] add unittes for 'helm dep build' with --skip-refresh flag. Signed-off-by: yxxhero --- cmd/helm/dependency_build_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/helm/dependency_build_test.go b/cmd/helm/dependency_build_test.go index d6dfdabcb..8e5f24af7 100644 --- a/cmd/helm/dependency_build_test.go +++ b/cmd/helm/dependency_build_test.go @@ -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) {