github-actions[bot]
published Aug 24, 2026, 1:27 PM · updated Aug 25, 2026, 5:09 AM
Summary
TestHealthConfigValidation in pkg/cli/health_command_test.go previously fell through to a real GitHub API call (healthListWorkflowRuns) for its "valid days" test cases, which could take tens of seconds or hang in sandboxed/offline CI environments and caused pkg/cli test timeouts. The fix stubs this call with a mock that returns an empty result, since the test only validates the days parameter and run-listing behavior is covered elsewhere.
Change Classification
- Type: test
- Scope: pkg/cli
- Breaking: No
Key Changes
| File | Change | Impact |
|---|---|---|
pkg/cli/health_command_test.go |
Stubs healthListWorkflowRuns with a mock returning (nil, 0, nil), restored via t.Cleanup, before running TestHealthConfigValidation cases |
Medium — removes real network dependency from a config-validation test, preventing CI timeouts/hangs |
Impact Assessment
- No production code or public API changes; the fix is confined to test setup.
- Improves
pkg/clitest suite reliability and speed in sandboxed/offline environments by eliminating unintended network calls. - Run-listing behavior itself remains covered by other dedicated tests, so test coverage is preserved.
Commits
b732a9209 fix(test): mock GitHub API in TestHealthConfigValidation to avoid CI timeout
9a1ba4b41 Initialize pull request for CI Optimization Coach
128438965 Initialize pull request for CI Optimization Coach
Generated by PR Description Updater for #55411 · copilot · auto · 43.5 AIC · ⌖ 5.26 AIC · ⊞ 7.7K · ◷