test: Add missing unit tests in vtgate/cli#19439
test: Add missing unit tests in vtgate/cli#19439Devanshusharma2005 wants to merge 6 commits intovitessio:mainfrom
vtgate/cli#19439Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
go/cmd/vtgate/cli/cli.go
Outdated
| // testTopoOpener and testRunDefault are set by tests to inject a topo | ||
| // and skip servenv.RunDefault. Must be nil in production. Tests that set | ||
| // these must not call t.Parallel(). | ||
| testTopoOpener func() *topo.Server | ||
| testRunDefault func() |
There was a problem hiding this comment.
We should avoid adding test specific things to the production code if at all possible.
There was a problem hiding this comment.
Rolled back the cli changes. Will remember this for future test additions. ^^
14c89d7 to
e73477d
Compare
|
@mattlord ^^ |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #19439 +/- ##
===========================================
- Coverage 69.67% 57.40% -12.27%
===========================================
Files 1614 17 -1597
Lines 216793 439 -216354
===========================================
- Hits 151044 252 -150792
+ Misses 65749 187 -65562
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Devanshu Sharma <devanshusharma658@gmail.com>
Signed-off-by: Devanshu Sharma <devanshusharma658@gmail.com>
Signed-off-by: Devanshu Sharma <devanshusharma658@gmail.com>
f7d80f7 to
b7372da
Compare
mattlord
left a comment
There was a problem hiding this comment.
LGTM. Please see my note about using ErrorContains in a consistent way in these new tests. Please address that while we wait for the second reviewer. Thanks, @Devanshusharma2005 !
Signed-off-by: Devanshu Sharma <devanshusharma658@gmail.com>
Signed-off-by: Devanshu Sharma <devanshusharma658@gmail.com>
Description
This PR adds the missing unit tests for vtgate CLI (
go/cmd/vtgate/cli)Test command:
Result:

Related Issue(s)
Fixes part of #14931
Checklist
Deployment Notes