test(provider): cover ParseOptions branches - #1057
Open
devsy-app[bot] wants to merge 8 commits into
Open
Conversation
Add table-driven tests for ParseOptions in pkg/provider/parse.go, which previously had no test coverage despite being used by multiple client implementations. Covers empty input, value-with-equals preservation, key uppercasing and whitespace trimming, multiple-option collection, and rejection of options without an equals sign.
✅ Deploy Preview for images-devsy-sh canceled.
|
👷 Deploy Preview for devsydev processing.
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Signed-off-by: Samuel K <skevetter@pm.me>
skevetter
marked this pull request as ready for review
August 17, 2026 05:50
Signed-off-by: Samuel K <skevetter@pm.me>
Signed-off-by: Samuel K <skevetter@pm.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Package reviewed
pkg/provider— agent-runtime core category.Issue found
ParseOptionsinpkg/provider/parse.gohad no test coverage, despite being a shared helper consumed by multiple client implementations (e.g. the Docker/Colima provider clients parsekey=valueoption strings into typed option maps). The function performs several non-trivial transformations — key uppercasing, whitespace trimming, value-with-equals preservation, and rejection of malformed entries — none of which were exercised by tests, leaving regressions undetectable.Change
Add a focused, table-driven test (
pkg/provider/parse_options_test.go) that covers every branch ofParseOptions:key=value=is preserved verbatim (port=8080=foo)name=devsy→NAME)=is rejected with an errorNo behavioral change — this is purely added test coverage for existing, exercised production code. The function's resolution semantics (it operates on raw option strings, independent of the
DEVSY_AGENT_URL/AGENT_URL/ GitHub-release resolution order inpkg/options/resolve.go) are unchanged.Verification performed
task cli:format— clean, no formatting changestask cli:lint:ci— 0 issuestask cli:test— passes; the only failures are the known pre-existingpkg/gittests (TestRepoCloneArgsThroughRunner,TestRepoCloneFromInfoBranch,TestRepoCloneFromInfoHelper), which fail onorigin/mainalready and are unrelated to this change (this change does not touchpkg/git)pkg/providertests:ok github.com/devsy-org/devsy/pkg/provider— all new subcases passThis PR was created by an AI agent as part of an automated daily package review job.