• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 19311403055 / 1
51%
main: 51%

Build:
DEFAULT BRANCH: main
Ran 12 Nov 2025 08:52PM UTC
Files 380
Run time 13s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Nov 2025 08:46PM UTC coverage: 48.921% (-0.001%) from 48.922%
19311403055.1

push

github

web-flow
Fix flaky TestGenerateUserAgent test using dependency injection (#2561)

The test was flaky due to race conditions from parallel subtests manipulating
the shared global environment variable KUBERNETES_SERVICE_HOST. This caused
intermittent failures when tests executed concurrently.

This fix refactors generateUserAgent() to use dependency injection with the
existing env.Reader interface, allowing tests to use isolated mock environment
readers instead of modifying global state. The tests now run reliably in
parallel without interference.

Changes:
- Add generateUserAgentWithEnv() that accepts an env.Reader parameter
- Keep generateUserAgent() as a wrapper using env.OSReader for production
- Update tests to use gomock-based environment readers
- Remove all os.Setenv/Unsetenv calls from tests
- Tests remain parallel and pass consistently with race detector

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

24163 of 49392 relevant lines covered (48.92%)

35.71 hits per line

Source Files on job 19311403055.1
  • Tree
  • List 380
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 19311403055
  • 2978ac65 on github
  • Prev Job for on main (#19309784474.1)
  • Next Job for on main (#19312047856.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc