From 940fbade2056ae59eed3d7361f7657253b4d242f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 06:19:27 +0000 Subject: [PATCH] test: remove duplicate benchmark and dead code in test files - pkg/repoutil/repoutil_test.go: Remove BenchmarkSplitRepoSlug which is an exact duplicate of BenchmarkSplitRepoSlug_Valid (both benchmark the same valid slug 'github/gh-aw'). Keep the descriptively-named _Valid variant which pairs clearly with BenchmarkSplitRepoSlug_Invalid. - pkg/constants/constants_test.go: Remove dead-code variable block in TestTypeSafetyBetweenSemanticTypes. The jobStr/stepStr variables were assigned and immediately discarded via '_ =' assignments with no assertions, providing no test coverage. String conversion is already tested by the preceding assertions in the same function. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/constants/constants_test.go | 8 -------- pkg/repoutil/repoutil_test.go | 7 ------- 2 files changed, 15 deletions(-) diff --git a/pkg/constants/constants_test.go b/pkg/constants/constants_test.go index c0639112464..9f666e24485 100644 --- a/pkg/constants/constants_test.go +++ b/pkg/constants/constants_test.go @@ -511,14 +511,6 @@ func TestTypeSafetyBetweenSemanticTypes(t *testing.T) { if string(step1) != "check_membership" { t.Errorf("StepID string conversion failed: got %q, want %q", step1, "check_membership") } - - // Verify that different semantic types have different underlying types - // (this is a compile-time check, but we verify the values are correct) - jobStr := string(AgentJobName) - stepStr := string(CheckMembershipStepID) - _ = jobStr // Used for demonstration - _ = stepStr // Used for demonstration - // Different semantic types prevent accidental mixing even if string values match } // TestHelperMethods tests the helper methods on semantic types diff --git a/pkg/repoutil/repoutil_test.go b/pkg/repoutil/repoutil_test.go index 4ad4aa23634..868b0a38c7b 100644 --- a/pkg/repoutil/repoutil_test.go +++ b/pkg/repoutil/repoutil_test.go @@ -67,13 +67,6 @@ func TestSplitRepoSlug(t *testing.T) { } } -func BenchmarkSplitRepoSlug(b *testing.B) { - slug := "github/gh-aw" - for b.Loop() { - _, _, _ = SplitRepoSlug(slug) - } -} - // Additional edge case tests func TestSplitRepoSlug_Whitespace(t *testing.T) {