From c107db4d4f37d40997b699f2035caea332551503 Mon Sep 17 00:00:00 2001 From: sec-check Date: Mon, 29 Jun 2026 18:13:13 -0400 Subject: [PATCH] [quality] fix: remove duplicate TestGetProjectDashboards_KnownProject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove TestGetProjectDashboards_KnownProject from projects_test.go — it duplicates the function already declared in buildinfo_test.go (PR #17363), causing 'redeclared in this block' go vet failures on all open PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check --- pkg/api/projects_test.go | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/pkg/api/projects_test.go b/pkg/api/projects_test.go index b7f8019914..104b159aaf 100644 --- a/pkg/api/projects_test.go +++ b/pkg/api/projects_test.go @@ -2,29 +2,8 @@ package api import "testing" -func TestGetProjectDashboards_KnownProject(t *testing.T) { -dashboards := getProjectDashboards("kubestellar") -if dashboards == nil { -t.Fatal("expected non-nil dashboard list for 'kubestellar' project") -} -if len(dashboards) == 0 { -t.Fatal("expected non-empty dashboard list for 'kubestellar' project") -} -// Verify key dashboards are present -required := []string{"dashboard", "clusters", "compliance", "security", "workloads"} -for _, r := range required { -found := false -for _, d := range dashboards { -if d == r { -found = true -break -} -} -if !found { -t.Errorf("expected dashboard %q in kubestellar presets, not found", r) -} -} -} +// TestGetProjectDashboards_KnownProject lives in buildinfo_test.go (PR #17363). +// The additional cases below cover edge cases not in that test. func TestGetProjectDashboards_UnknownProject(t *testing.T) { dashboards := getProjectDashboards("nonexistent-project")