Commit ae043d7
authored
feat: improve CLI help text accuracy and add comprehensive test coverage (#444)
* fix(redis-enterprise): remove non-existent database action methods
Remove three database action methods that call non-existent API endpoints:
- BdbHandler::start() - /v1/bdbs/{uid}/actions/start (404)
- BdbHandler::stop() - /v1/bdbs/{uid}/actions/stop (404)
- BdbHandler::restart() - /v1/bdbs/{uid}/actions/restart (404)
Testing against Docker cluster and comprehensive documentation search of
redis.io REST API docs confirms these endpoints do not exist. The complete
list of documented database action endpoints is:
- stop_traffic / resume_traffic (NOT the same as stop/start)
- export / import / recover
- optimize_shards_placement / rebalance
- backup_reset_status / import_reset_status / export_reset_status
Also removed associated tests and updated documentation to use correct
endpoints (stop_traffic/resume_traffic instead of restart).
Closes #421
* feat(cli): improve profile command clarity with --type flag
BREAKING CHANGE: Changed --deployment flag to --type for profile set command
- Renamed --deployment to --type for better clarity (cloud vs enterprise)
- Added --deployment as a visible alias for backward compatibility
- Updated all help text examples to use --type consistently
- Changed help text from 'Deployment type' to 'Platform type: cloud or enterprise'
- Fixed incorrect examples that showed positional argument syntax
The --type flag more clearly indicates this is selecting between Redis Cloud
and Redis Enterprise platforms, reducing confusion with deployment environments.
The --deployment alias maintains backward compatibility for existing scripts.
* fix(cli): standardize slow-log command help text and add comprehensive tests
- Fixed slow-log description inconsistency ('View' vs 'Get slow query log')
- Added default values (100, 0) for limit/offset in fixed-database slow-log
- Standardized offset description to 'Offset for pagination'
- Changed limit/offset from Option<i32> to i32 with defaults for consistency
Added comprehensive assert_cmd tests to ensure documentation accuracy:
- 14 new tests for profile --type flag and backward compatibility
- 8 new tests for slow-log command consistency
- Updated existing test to check for --type instead of --deployment
- All tests verify help text matches actual command behavior
These tests will catch documentation drift and ensure users can rely on
our help text and examples.
* test(cli): add comprehensive help text coverage for all major commands
Added 36 new help text tests to ensure documentation accuracy:
Files-key commands (4 tests):
- Verify all subcommands have accurate help text
- Covers set, get, remove operations
API command (2 tests):
- Verify examples show correct syntax
- Verify completions command help
Cloud subcommands (13 tests):
- account, subscription, database, user, acl operations
- task, connectivity, fixed-database, fixed-subscription
- workflow operations
- All verify help text matches actual command behavior
Enterprise subcommands (17 tests):
- cluster, database, node, user, role, acl operations
- license, support-package, workflow, crdb operations
- proxy, module management
- Covers most common user-facing commands
Total test count increased from 34 to 70 tests in cli_basic_tests.rs.
This ensures users can rely on --help output being accurate and prevents
documentation drift as commands evolve.
* chore: trigger CI re-run
* fix(clippy): use derive for Default impl on OutputFormat
Rust 1.91 introduced a new lint 'derivable_impls' that flags manual
Default implementations that can be derived. Changed OutputFormat to
use #[derive(Default)] with #[default] attribute on the Json variant.
Fixes CI clippy failure on Rust 1.91.0.1 parent f48c252 commit ae043d7
File tree
5 files changed
+815
-32
lines changed- crates/redisctl
- src
- commands
- tests
5 files changed
+815
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
| 987 | + | |
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
998 | 998 | | |
999 | 999 | | |
1000 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 17 | | |
23 | 18 | | |
24 | 19 | | |
| |||
0 commit comments