-
Notifications
You must be signed in to change notification settings - Fork 317
test: improve test coverage for pkg/datasource/sql/util #974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive test coverage for the SQL utility package, introducing test files for core functionality including row scanning, parameter conversion, lock key generation, context-aware operations, and type conversion utilities.
Key changes:
- Added extensive test coverage for ScanRows operations including iteration, scanning, context cancellation, and result set handling
- Implemented tests for parameter conversion between NamedValue and Value types
- Created tests for lock key generation with various primary key configurations
- Added tests for context-aware database operations (prepare, exec, query)
- Expanded test coverage for type conversion and database version parsing
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/datasource/sql/util/sql_test.go | Tests for ScanRows including Next, Scan, Close, context handling, and result sets |
| pkg/datasource/sql/util/params_test.go | Tests for NamedValue/Value conversion utilities |
| pkg/datasource/sql/util/lockkey_test.go | Tests for BuildLockKey with single/composite keys and edge cases |
| pkg/datasource/sql/util/ctxutil_test.go | Tests for context-aware driver operations (prepare, exec, query) |
| pkg/datasource/sql/util/convert_test.go | Expanded tests for type conversion and database version parsing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #974 +/- ##
==========================================
+ Coverage 48.49% 51.56% +3.06%
==========================================
Files 199 199
Lines 12329 12329
==========================================
+ Hits 5979 6357 +378
+ Misses 5880 5482 -398
- Partials 470 490 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Which issue(s) this PR fixes:
Fixes #946