From 9063fd3c46acede2403075bb8d19e03945ffa90b Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Wed, 1 Oct 2025 17:58:20 +0200 Subject: [PATCH] Reflect downloader changes in dependency_update Signed-off-by: Benoit Tigeot --- pkg/cmd/dependency_update_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/dependency_update_test.go b/pkg/cmd/dependency_update_test.go index 3eaa51df1..7ce37e34f 100644 --- a/pkg/cmd/dependency_update_test.go +++ b/pkg/cmd/dependency_update_test.go @@ -242,15 +242,14 @@ func TestDependencyUpdateCmd_WithRepoThatWasNotAdded(t *testing.T) { dir("repositories.yaml"), dir(), contentCache), ) - if err != nil { - t.Logf("Output: %s", out) - t.Fatal(err) + // In Helm v4, using a repository that hasn't been explicitly configured should fail + if err == nil { + t.Fatalf("expected error for unconfigured repository, got nil. Output: %s", out) } - // This is written directly to stdout, so we have to capture as is - if !strings.Contains(out, `Getting updates for unmanaged Helm repositories...`) { - t.Errorf("No ‘unmanaged’ Helm repo used in test chartdependency or it doesn’t cause the creation "+ - "of an ‘ad hoc’ repo index cache file\n%s", out) + missingRepoURL := srvForUnmanagedRepo.URL() + if !strings.Contains(out, fmt.Sprintf("repository \"%s\" is not configured.", missingRepoURL)) { + t.Fatalf("expected error to mention unconfigured repo URL %s. Output:\n%s", missingRepoURL, out) } }