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

stacklok / toolhive / 17578201311
59%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2025 09:33AM UTC
Jobs 1
Files 229
Run time 1min
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

09 Sep 2025 09:29AM UTC coverage: 38.686% (+0.3%) from 38.371%
17578201311

push

github

web-flow
Improve test coverage and fix label validation bug (#1788)

This commit addresses test coverage improvements and fixes a critical bug in label validation:

- **Label validation bug**: Fixed ParseLabel to properly reject labels with multiple equals signs (e.g., 'key=value=extra')
- **Unified label parsing**: Removed redundant ParseLabelWithValidation function and made ParseLabel always validate
- **Race condition fix**: Refactored version.go to extract testable functions without global state dependencies

- Added comprehensive tests for pkg/versions/version.go (100% coverage)
- Added tests for pkg/transport/types/transport.go utilities
- Added tests for pkg/networking/utilities.go functions (AddressReferencesPrivateIp, ValidateEndpointURL)
- Added tests for pkg/transport/ssecommon/sse_common.go SSE message utilities (100% coverage)
- Added tests for pkg/core/workload.go SortWorkloadsByName function
- Added tests for pkg/workloads/types/labels.go label filtering utilities

- Refactored validateEndpointURLWithSkip to be testable without environment variables
- Improved error handling and validation consistency across label parsing
- Added proper parallel test execution with t.Parallel()
- Fixed linting issues and import organization

- Systematically improved coverage for utility functions across multiple packages
- Focus on easy-to-test functions that provide good coverage gains
- All new tests include edge cases and error conditions

The label validation bug was discovered through testing - labels with multiple equals signs were incorrectly parsed as valid, which could lead to security and parsing issues.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>

20 of 28 new or added lines in 4 files covered. (71.43%)

24 existing lines in 3 files now uncovered.

11407 of 29486 relevant lines covered (38.69%)

17.34 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
57.62
0.0% pkg/runner/config_builder.go
3
86.36
41.2% pkg/networking/utilities.go
4
77.78
77.78% pkg/versions/version.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
77.78
77.78% pkg/versions/version.go
2
82.15
-0.62% pkg/transport/proxy/httpsse/http_proxy.go
21
48.94
-22.34% pkg/secrets/keyring/keyctl_linux.go
Jobs
ID Job ID Ran Files Coverage
1 17578201311.1 09 Sep 2025 09:33AM UTC 229
38.69
GitHub Action Run
Source Files on build 17578201311
  • Tree
  • List 229
  • Changed 10
  • Source Changed 4
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17578201311
  • 606c8c95 on github
  • Prev Build on main (#17578022708)
  • Next Build on main (#17578548608)
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