diff --git a/pkg/cmd/dependency_build_test.go b/pkg/cmd/dependency_build_test.go index a3473301d..7b99e910a 100644 --- a/pkg/cmd/dependency_build_test.go +++ b/pkg/cmd/dependency_build_test.go @@ -151,8 +151,20 @@ func TestDependencyBuildCmd(t *testing.T) { } func TestDependencyBuildCmdWithHelmV2Hash(t *testing.T) { + defer resetEnv()() + + // Set up test repository + helmHome := "testdata/helmhome/helm" + os.Setenv("HELM_HOME", helmHome) + chartName := "testdata/testcharts/issue-7233" + // Create test environment + repoFile := filepath.Join(helmHome, "repository/repositories.yaml") + if err := os.MkdirAll(filepath.Dir(repoFile), 0755); err != nil { + t.Fatal(err) + } + cmd := fmt.Sprintf("dependency build '%s'", chartName) _, out, err := executeActionCommand(cmd) diff --git a/pkg/cmd/testdata/helmhome/helm/repository/repositories.yaml b/pkg/cmd/testdata/helmhome/helm/repository/repositories.yaml new file mode 100644 index 000000000..9743cbb94 --- /dev/null +++ b/pkg/cmd/testdata/helmhome/helm/repository/repositories.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +repositories: +- name: test + url: https://example.com/charts \ No newline at end of file