Description
Currently, utils/utils_test.go only contains a single test (TestContainerNameFromDockerRun). Several exported pure utility functions in utils/utils.go (such as JSON parsing helpers, IP conversion, and string sanitization utilities) lack dedicated table-driven unit tests.
Adding unit tests for these helper functions will prevent regressions and increase overall test coverage without touching core runtime or proxy logic.
Affected Files
- utils/utils.go
- utils/utils_test.go
Proposed Solution / Acceptance Criteria
- Add table-driven unit tests using
github.com/stretchr/testify/assert or require in utils/utils_test.go.
- Cover edge cases (e.g., empty strings, malformed inputs, valid/invalid inputs) for:
- JSON string validation helpers (e.g.,
IsJSONString, ContainsValidJSON)
- IP conversion / network formatting helpers
- Time / timestamp parsing functions
- Ensure all tests run and pass cleanly via
go test ./utils/....
Labels
good first issue, unit-tests, help wanted
Description
Currently, utils/utils_test.go only contains a single test (
TestContainerNameFromDockerRun). Several exported pure utility functions in utils/utils.go (such as JSON parsing helpers, IP conversion, and string sanitization utilities) lack dedicated table-driven unit tests.Adding unit tests for these helper functions will prevent regressions and increase overall test coverage without touching core runtime or proxy logic.
Affected Files
Proposed Solution / Acceptance Criteria
github.com/stretchr/testify/assertorrequirein utils/utils_test.go.IsJSONString,ContainsValidJSON)go test ./utils/....Labels
good first issue,unit-tests,help wanted