From c0e6439bb0337e8d5ba9086062459a120e374725 Mon Sep 17 00:00:00 2001 From: doomfrawen Date: Thu, 5 Nov 2026 17:53:47 -0800 Subject: [PATCH] Check artifact paths in storage deletion tests Strip the absence marker before constructing artifact paths in the storage test assertions, so negative checks inspect the intended files. Assisted-by: Codex/GPT-6 Signed-off-by: Ernesto Honigmann Signed-off-by: doomfrawen --- internal/controller/bucket_controller_test.go | 2 +- internal/controller/gitrepository_controller_test.go | 2 +- internal/controller/helmchart_controller_test.go | 2 +- internal/controller/helmrepository_controller_test.go | 2 +- internal/controller/ocirepository_controller_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/controller/bucket_controller_test.go b/internal/controller/bucket_controller_test.go index 6ec912dfe..4cf9cbc96 100644 --- a/internal/controller/bucket_controller_test.go +++ b/internal/controller/bucket_controller_test.go @@ -417,7 +417,7 @@ func TestBucketReconciler_reconcileStorage(t *testing.T) { g.Expect(obj.Status.Conditions).To(conditions.MatchConditions(tt.assertConditions)) for _, p := range tt.assertPaths { - absoluteP := filepath.Join(testStorage.BasePath, p) + absoluteP := filepath.Join(testStorage.BasePath, strings.TrimPrefix(p, "!")) if !strings.HasPrefix(p, "!") { g.Expect(absoluteP).To(BeAnExistingFile()) continue diff --git a/internal/controller/gitrepository_controller_test.go b/internal/controller/gitrepository_controller_test.go index 38aadca4d..da868b67d 100644 --- a/internal/controller/gitrepository_controller_test.go +++ b/internal/controller/gitrepository_controller_test.go @@ -1947,7 +1947,7 @@ func TestGitRepositoryReconciler_reconcileStorage(t *testing.T) { g.Expect(obj.Status.Conditions).To(conditions.MatchConditions(tt.assertConditions)) for _, p := range tt.assertPaths { - absoluteP := filepath.Join(testStorage.BasePath, p) + absoluteP := filepath.Join(testStorage.BasePath, strings.TrimPrefix(p, "!")) if !strings.HasPrefix(p, "!") { g.Expect(absoluteP).To(BeAnExistingFile()) continue diff --git a/internal/controller/helmchart_controller_test.go b/internal/controller/helmchart_controller_test.go index 94c6f7de4..e4f32971f 100644 --- a/internal/controller/helmchart_controller_test.go +++ b/internal/controller/helmchart_controller_test.go @@ -553,7 +553,7 @@ func TestHelmChartReconciler_reconcileStorage(t *testing.T) { g.Expect(obj.Status.Conditions).To(conditions.MatchConditions(tt.assertConditions)) for _, p := range tt.assertPaths { - absoluteP := filepath.Join(testStorage.BasePath, p) + absoluteP := filepath.Join(testStorage.BasePath, strings.TrimPrefix(p, "!")) if !strings.HasPrefix(p, "!") { g.Expect(absoluteP).To(BeAnExistingFile()) continue diff --git a/internal/controller/helmrepository_controller_test.go b/internal/controller/helmrepository_controller_test.go index 68f1e77f9..e5266d3af 100644 --- a/internal/controller/helmrepository_controller_test.go +++ b/internal/controller/helmrepository_controller_test.go @@ -407,7 +407,7 @@ func TestHelmRepositoryReconciler_reconcileStorage(t *testing.T) { } for _, p := range tt.assertPaths { - absoluteP := filepath.Join(testStorage.BasePath, p) + absoluteP := filepath.Join(testStorage.BasePath, strings.TrimPrefix(p, "!")) if !strings.HasPrefix(p, "!") { g.Expect(absoluteP).To(BeAnExistingFile()) continue diff --git a/internal/controller/ocirepository_controller_test.go b/internal/controller/ocirepository_controller_test.go index 8907d84d0..a3370f5dc 100644 --- a/internal/controller/ocirepository_controller_test.go +++ b/internal/controller/ocirepository_controller_test.go @@ -3472,7 +3472,7 @@ func TestOCIRepository_reconcileStorage(t *testing.T) { g.Expect(obj.Status.Conditions).To(conditions.MatchConditions(tt.assertConditions)) for _, p := range tt.assertPaths { - absoluteP := filepath.Join(testStorage.BasePath, p) + absoluteP := filepath.Join(testStorage.BasePath, strings.TrimPrefix(p, "!")) if !strings.HasPrefix(p, "!") { g.Expect(absoluteP).To(BeAnExistingFile()) continue