test: improve coverage - #155
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds and refactors tests across five internal packages ( ChangesTest Coverage Expansion and Constant Extraction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
+ Coverage 81.88% 82.40% +0.51%
==========================================
Files 284 284
Lines 22128 22128
==========================================
+ Hits 18120 18234 +114
+ Misses 2827 2754 -73
+ Partials 1181 1140 -41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/provider/client_complete_internal_test.go (1)
93-133: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winStrengthen dispatch assertions to verify route selection, not only output.
On Line 93, this test proves provider parsers can return
"ok", but it doesn’t assert which endpoint/headers were used per API case. A routing regression between OpenAI responses and Codex could still pass with identical stubbed bodies. Capture request path (and Codex-specific headers) in the test HTTP stub and assert per case.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/provider/client_complete_internal_test.go` around lines 93 - 133, The test TestHTTPCompletionClientCompleteDispatchesProviderAPIs only verifies that response parsing returns the expected output text, but does not verify that the correct endpoint or headers were used for each API type. Enhance the testProviderHTTPClient stub to capture the actual HTTP request details (path and headers) instead of just returning a predefined response, then add assertions within each test case iteration to verify that the correct endpoint path and API-specific headers (particularly Codex-specific headers for the apiOpenAICodexResponses case) were used when client.Complete was called. This ensures routing regressions between the different API providers cannot be masked by identical stubbed response bodies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/assistant/runtime_slash_internal_test.go`:
- Line 187: The assert.JSONEq call on line 187 directly interpolates the
skillPath variable into a JSON literal string, which fails on Windows because
backslashes in file paths are not properly escaped as JSON. Instead of string
interpolation, construct the expected payload using a struct or map and marshal
it to JSON using json.Marshal, which will properly escape all special characters
including backslashes, ensuring the assertion works correctly across all
platforms.
---
Nitpick comments:
In `@internal/provider/client_complete_internal_test.go`:
- Around line 93-133: The test
TestHTTPCompletionClientCompleteDispatchesProviderAPIs only verifies that
response parsing returns the expected output text, but does not verify that the
correct endpoint or headers were used for each API type. Enhance the
testProviderHTTPClient stub to capture the actual HTTP request details (path and
headers) instead of just returning a predefined response, then add assertions
within each test case iteration to verify that the correct endpoint path and
API-specific headers (particularly Codex-specific headers for the
apiOpenAICodexResponses case) were used when client.Complete was called. This
ensures routing regressions between the different API providers cannot be masked
by identical stubbed response bodies.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5d4b236a-bdc5-4e72-a17f-77c02890baf5
📒 Files selected for processing (15)
internal/assistant/runtime_slash_internal_test.gointernal/extension/lifecycle_internal_test.gointernal/extension/lua_schema_internal_test.gointernal/extension/lua_values_internal_test.gointernal/extension/manager_test.gointernal/provider/client_complete_internal_test.gointernal/provider/test_helpers_internal_test.gointernal/provider/tool_schema_internal_test.gointernal/terminal/running_tools_internal_test.gointernal/terminal/test_constants_internal_test.gointernal/terminal/tool_display_internal_test.gointernal/tool/arguments_internal_test.gointernal/tool/input_validation_internal_test.gointernal/tool/registry_test.gointernal/tool/schema_test.go
|



No description provided.