From aafa63818f88c40286dc673abea872398c77d0b2 Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 26 Mar 2026 01:32:17 +0000 Subject: [PATCH] fix: remove dead client field from PrepSubsystem + test literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit client *http.Client removed — all HTTP routes through transport.go. 75 test struct literals cleaned, 3 test assertions updated. Co-Authored-By: Virgil --- pkg/agentic/commands_test.go | 3 --- pkg/agentic/dispatch_test.go | 1 - pkg/agentic/epic_test.go | 5 ----- pkg/agentic/ingest_test.go | 5 ----- pkg/agentic/pr_test.go | 10 ---------- pkg/agentic/prep_extra_test.go | 10 ---------- pkg/agentic/prep_test.go | 4 +--- pkg/agentic/scan_test.go | 17 ----------------- pkg/agentic/status_extra_test.go | 4 ---- pkg/agentic/verify_extra_test.go | 4 ---- pkg/agentic/verify_test.go | 18 ------------------ 11 files changed, 1 insertion(+), 80 deletions(-) diff --git a/pkg/agentic/commands_test.go b/pkg/agentic/commands_test.go index 7819bf6..767c1e0 100644 --- a/pkg/agentic/commands_test.go +++ b/pkg/agentic/commands_test.go @@ -26,10 +26,8 @@ func testPrepWithCore(t *testing.T, srv *httptest.Server) (*PrepSubsystem, *core c := core.New() var f *forge.Forge - var client *http.Client if srv != nil { f = forge.NewForge(srv.URL, "test-token") - client = srv.Client() } s := &PrepSubsystem{ @@ -37,7 +35,6 @@ func testPrepWithCore(t *testing.T, srv *httptest.Server) (*PrepSubsystem, *core forge: f, forgeURL: "", forgeToken: "test-token", - client: client, codePath: t.TempDir(), pokeCh: make(chan struct{}, 1), backoff: make(map[string]time.Time), diff --git a/pkg/agentic/dispatch_test.go b/pkg/agentic/dispatch_test.go index 6ec45f1..32cb6f5 100644 --- a/pkg/agentic/dispatch_test.go +++ b/pkg/agentic/dispatch_test.go @@ -411,7 +411,6 @@ func TestDispatch_Dispatch_Good(t *testing.T) { s := newPrepWithProcess() s.forge = forge.NewForge(forgeSrv.URL, "tok") s.codePath = filepath.Dir(filepath.Dir(srcRepo)) - s.client = forgeSrv.Client() _, out, err := s.dispatch(context.Background(), nil, DispatchInput{ Repo: "go-io", Task: "Fix stuff", Issue: 42, DryRun: true, diff --git a/pkg/agentic/epic_test.go b/pkg/agentic/epic_test.go index 30c8c3a..6e7969d 100644 --- a/pkg/agentic/epic_test.go +++ b/pkg/agentic/epic_test.go @@ -136,7 +136,6 @@ func newTestSubsystem(t *testing.T, srv *httptest.Server) *PrepSubsystem { brainURL: srv.URL, brainKey: "test-brain-key", codePath: t.TempDir(), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -183,7 +182,6 @@ func TestEpic_CreateIssue_Bad_ServerDown(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -202,7 +200,6 @@ func TestEpic_CreateIssue_Bad_Non201Response(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -250,7 +247,6 @@ func TestEpic_ResolveLabelIDs_Bad_ServerError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -286,7 +282,6 @@ func TestEpic_CreateLabel_Bad_ServerDown(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/ingest_test.go b/pkg/agentic/ingest_test.go index b4bf55a..fec745f 100644 --- a/pkg/agentic/ingest_test.go +++ b/pkg/agentic/ingest_test.go @@ -59,7 +59,6 @@ func TestIngest_IngestFindings_Good_WithFindings(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -210,7 +209,6 @@ func TestIngest_CreateIssueViaAPI_Good_Success(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -242,7 +240,6 @@ func TestIngest_CreateIssueViaAPI_Bad_NoAPIKey(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: "https://example.com", brainKey: "test-brain-key", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -268,7 +265,6 @@ func TestIngest_CreateIssueViaAPI_Bad_ServerError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -337,7 +333,6 @@ func TestIngest_CreateIssueViaAPI_Ugly(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/pr_test.go b/pkg/agentic/pr_test.go index 2d80261..bd2bd7d 100644 --- a/pkg/agentic/pr_test.go +++ b/pkg/agentic/pr_test.go @@ -69,7 +69,6 @@ func TestPr_ForgeCreatePR_Good_Success(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -97,7 +96,6 @@ func TestPr_ForgeCreatePR_Bad_ServerError(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -268,7 +266,6 @@ func TestPr_CommentOnIssue_Good_PostsComment(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -336,7 +333,6 @@ func TestPr_CommentOnIssue_Bad(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -363,7 +359,6 @@ func TestPr_CommentOnIssue_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -445,7 +440,6 @@ func TestPr_ForgeCreatePR_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -481,7 +475,6 @@ func TestPr_ListPRs_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -503,7 +496,6 @@ func TestPr_ListRepoPRs_Good(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -526,7 +518,6 @@ func TestPr_ListRepoPRs_Bad(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -547,7 +538,6 @@ func TestPr_ListRepoPRs_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/prep_extra_test.go b/pkg/agentic/prep_extra_test.go index 5fc2db1..119f8a2 100644 --- a/pkg/agentic/prep_extra_test.go +++ b/pkg/agentic/prep_extra_test.go @@ -149,7 +149,6 @@ func TestPrep_PullWikiContent_Good_WithPages(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -170,7 +169,6 @@ func TestPrep_PullWikiContent_Good_NoPages(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -194,7 +192,6 @@ func TestPrep_GetIssueBody_Good(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -212,7 +209,6 @@ func TestPrep_GetIssueBody_Bad_NotFound(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -266,7 +262,6 @@ func TestPrep_BuildPrompt_Good_WithIssue(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), codePath: t.TempDir(), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -350,7 +345,6 @@ func TestPrep_BuildPrompt_Ugly(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), codePath: t.TempDir(), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -429,7 +423,6 @@ func TestPrep_PullWikiContent_Bad(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -460,7 +453,6 @@ func TestPrep_PullWikiContent_Ugly(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -508,7 +500,6 @@ func TestPrep_BrainRecall_Ugly(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -594,7 +585,6 @@ func TestPrep_GetIssueBody_Ugly(t *testing.T) { s := &PrepSubsystem{ ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/prep_test.go b/pkg/agentic/prep_test.go index 3b49cd9..77a8a79 100644 --- a/pkg/agentic/prep_test.go +++ b/pkg/agentic/prep_test.go @@ -162,7 +162,7 @@ func TestPrep_NewPrep_Good_Defaults(t *testing.T) { s := NewPrep() assert.Equal(t, "https://forge.lthn.ai", s.forgeURL) assert.Equal(t, "https://api.lthn.sh", s.brainURL) - assert.NotNil(t, s.client) + assert.NotEmpty(t, s.codePath) } func TestPrep_NewPrep_Good_EnvOverrides(t *testing.T) { @@ -379,7 +379,6 @@ func TestPrep_NewPrep_Ugly(t *testing.T) { s := NewPrep() assert.NotNil(t, s.backoff, "backoff map must not be nil") assert.NotNil(t, s.failCount, "failCount map must not be nil") - assert.NotNil(t, s.client, "HTTP client must not be nil") assert.NotNil(t, s.forge, "Forge client must not be nil") } @@ -775,7 +774,6 @@ func TestPrep_PrepWorkspace_Good(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forge: forge.NewForge(srv.URL, "test-token"), codePath: filepath.Join(root, "src"), - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/scan_test.go b/pkg/agentic/scan_test.go index 9ed462c..f23e7c9 100644 --- a/pkg/agentic/scan_test.go +++ b/pkg/agentic/scan_test.go @@ -82,7 +82,6 @@ func TestScan_Scan_Good(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -106,7 +105,6 @@ func TestScan_Good_AllRepos(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -124,7 +122,6 @@ func TestScan_Good_WithLimit(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -142,7 +139,6 @@ func TestScan_Good_DefaultLabels(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -160,7 +156,6 @@ func TestScan_Good_CustomLabels(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -179,7 +174,6 @@ func TestScan_Good_Deduplicates(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -222,7 +216,6 @@ func TestScan_ListRepoIssues_Good_ReturnsIssues(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -241,7 +234,6 @@ func TestScan_ListRepoIssues_Good_EmptyResult(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -257,7 +249,6 @@ func TestScan_ListRepoIssues_Good_AssigneeExtracted(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -279,7 +270,6 @@ func TestScan_ListRepoIssues_Bad_ServerError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -302,7 +292,6 @@ func TestScan_Scan_Bad(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -327,7 +316,6 @@ func TestScan_Scan_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -347,7 +335,6 @@ func TestScan_ListOrgRepos_Good(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -372,7 +359,6 @@ func TestScan_ListOrgRepos_Bad(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -393,7 +379,6 @@ func TestScan_ListOrgRepos_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -425,7 +410,6 @@ func TestScan_ListRepoIssues_Ugly(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -454,7 +438,6 @@ func TestScan_ListRepoIssues_Good_URLRewrite(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/status_extra_test.go b/pkg/agentic/status_extra_test.go index 46b0f0f..0cc661c 100644 --- a/pkg/agentic/status_extra_test.go +++ b/pkg/agentic/status_extra_test.go @@ -254,7 +254,6 @@ func TestPrep_BrainRecall_Good_Success(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -277,7 +276,6 @@ func TestPrep_BrainRecall_Good_NoMemories(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -310,7 +308,6 @@ func TestPrep_BrainRecall_Bad_ServerError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), brainURL: srv.URL, brainKey: "test-brain-key", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -397,7 +394,6 @@ func TestPr_ListPRs_Good_SpecificRepo(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/verify_extra_test.go b/pkg/agentic/verify_extra_test.go index 386f07a..d5cb6b3 100644 --- a/pkg/agentic/verify_extra_test.go +++ b/pkg/agentic/verify_extra_test.go @@ -38,7 +38,6 @@ func TestPr_CommentOnIssue_Good_PostsCommentOnPR(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -87,7 +86,6 @@ func TestVerify_AutoVerifyAndMerge_Good_FullPipeline(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -121,7 +119,6 @@ func TestVerify_AttemptVerifyAndMerge_Good_TestsPassMergeSucceeds(t *testing.T) forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -148,7 +145,6 @@ func TestVerify_AttemptVerifyAndMerge_Bad_MergeFails(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } diff --git a/pkg/agentic/verify_test.go b/pkg/agentic/verify_test.go index 3c3c6a1..084ed67 100644 --- a/pkg/agentic/verify_test.go +++ b/pkg/agentic/verify_test.go @@ -39,7 +39,6 @@ func TestVerify_ForgeMergePR_Good_Success(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-forge-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -58,7 +57,6 @@ func TestVerify_ForgeMergePR_Good_204Response(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -80,7 +78,6 @@ func TestVerify_ForgeMergePR_Bad_ConflictResponse(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -103,7 +100,6 @@ func TestVerify_ForgeMergePR_Bad_ServerError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -121,7 +117,6 @@ func TestVerify_ForgeMergePR_Bad_NetworkError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -171,7 +166,6 @@ func TestVerify_EnsureLabel_Good_CreatesLabel(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -188,7 +182,6 @@ func TestVerify_EnsureLabel_Bad_NetworkError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -214,7 +207,6 @@ func TestVerify_GetLabelID_Good_Found(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -235,7 +227,6 @@ func TestVerify_GetLabelID_Bad_NotFound(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -252,7 +243,6 @@ func TestVerify_GetLabelID_Bad_NetworkError(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: &http.Client{}, backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -465,7 +455,6 @@ func TestVerify_FlagForReview_Good_AddsLabel(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -499,7 +488,6 @@ func TestVerify_FlagForReview_Good_MergeConflictMessage(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -587,7 +575,6 @@ func TestVerify_AttemptVerifyAndMerge_Ugly(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -624,7 +611,6 @@ func TestVerify_EnsureLabel_Ugly_AlreadyExists409(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -647,7 +633,6 @@ func TestVerify_GetLabelID_Ugly_EmptyArray(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -669,7 +654,6 @@ func TestVerify_ForgeMergePR_Ugly_EmptyBody200(t *testing.T) { ServiceRuntime: core.NewServiceRuntime(testCore, AgentOptions{}), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -703,7 +687,6 @@ func TestVerify_FlagForReview_Bad_AllAPICallsFail(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), } @@ -731,7 +714,6 @@ func TestVerify_FlagForReview_Ugly_LabelNotFoundZeroID(t *testing.T) { forge: forge.NewForge(srv.URL, "test-token"), forgeURL: srv.URL, forgeToken: "test-token", - client: srv.Client(), backoff: make(map[string]time.Time), failCount: make(map[string]int), }