From 12843896522d5fbecaeee9bd587b2615f3344c70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:27:29 +0000 Subject: [PATCH 1/3] Initialize pull request for CI Optimization Coach From 9a1ba4b4155d18b4d7b254b4611233bbfac7bb7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:51:41 +0000 Subject: [PATCH 2/3] Initialize pull request for CI Optimization Coach From b732a9209b52d776f5b96a8c812a89ed1e9ed511 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:51:42 +0000 Subject: [PATCH 3/3] fix(test): mock GitHub API in TestHealthConfigValidation to avoid CI timeout TestHealthConfigValidation's 'valid days' subtests called RunHealth without mocking healthListWorkflowRuns, so each fell through to real GitHub API pagination (up to MaxIterations batches). This took 46-48s per subtest (141s total) in CI, pushing the whole pkg/cli unit test binary (which has a 3m timeout in the ci-coach validation step) over budget and causing 'panic: test timed out after 3m0s'. Stub healthListWorkflowRuns to return no runs immediately, since this test only exercises the Days validation branch in RunHealth, not GitHub API pagination (which is already covered by TestFetchWorkflowRunsPaginatesPastFilteredBatches and friends). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/cli/health_command_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/cli/health_command_test.go b/pkg/cli/health_command_test.go index 8f6e4990359..c98b14af344 100644 --- a/pkg/cli/health_command_test.go +++ b/pkg/cli/health_command_test.go @@ -66,6 +66,16 @@ func TestHealthConfigValidation(t *testing.T) { }, } + // Stub out the GitHub API call so valid-days cases don't fall through to + // real network access (which can take tens of seconds per case, or hang, + // in sandboxed/offline test environments). Only days validation is under + // test here; run listing itself is covered by dedicated tests elsewhere. + original := healthListWorkflowRuns + t.Cleanup(func() { healthListWorkflowRuns = original }) + healthListWorkflowRuns = func(opts ListWorkflowRunsOptions) ([]WorkflowRun, int, error) { + return nil, 0, nil + } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := RunHealth(tt.config)