From 44739f6cff19b0fbaf4fbe1dfbf69edc14893107 Mon Sep 17 00:00:00 2001 From: Binbin Date: Wed, 24 Jan 2024 12:43:14 +0800 Subject: [PATCH] test --- src/commands/command.json | 179 ++++++++++++++++++++++++++++++++- tests/unit/introspection-2.tcl | 8 -- 2 files changed, 178 insertions(+), 9 deletions(-) diff --git a/src/commands/command.json b/src/commands/command.json index 9d15be2441c..4bb4818a8ef 100644 --- a/src/commands/command.json +++ b/src/commands/command.json @@ -16,6 +16,183 @@ ], "command_tips": [ "NONDETERMINISTIC_OUTPUT_ORDER" - ] + ], + "reply_schema": { + "type": "array", + "items": { + "oneOf": [ + { + "description": "command does not exist", + "type": "null" + }, + { + "description": "command info array output", + "type": "array", + "minItems": 10, + "maxItems": 10, + "items": [ + { + "description": "command name", + "type": "string" + }, + { + "description": "command arity", + "type": "integer" + }, + { + "description": "command flags", + "type": "array", + "items": { + "description": "command flag", + "type": "string" + } + }, + { + "description": "command first key index", + "type": "integer" + }, + { + "description": "command last key index", + "type": "integer" + }, + { + "description": "command key step index", + "type": "integer" + }, + { + "description": "command categories", + "type": "array", + "items": { + "description": "command category", + "type": "string" + } + }, + { + "description": "command tips", + "type": "array", + "items": { + "description": "command tip", + "type": "string" + } + }, + { + "description": "command key specs", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "notes": { + "type": "string" + }, + "flags": { + "type": "array", + "items": { + "type": "string" + } + }, + "begin_search": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "spec": { + "anyOf": [ + { + "description": "unknown type, empty map", + "type": "object", + "additionalProperties": false + }, + { + "description": "index type", + "type": "object", + "additionalProperties": false, + "properties": { + "index": { + "type": "integer" + } + } + }, + { + "description": "keyword type", + "type": "object", + "additionalProperties": false, + "properties": { + "keyword": { + "type": "string" + }, + "startfrom": { + "type": "integer" + } + } + } + ] + } + } + }, + "find_keys": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "spec": { + "anyOf": [ + { + "description": "unknown type", + "type": "object", + "additionalProperties": false + }, + { + "description": "range type", + "type": "object", + "additionalProperties": false, + "properties": { + "lastkey": { + "type": "integer" + }, + "keystep": { + "type": "integer" + }, + "limit": { + "type": "integer" + } + } + }, + { + "description": "keynum type", + "type": "object", + "additionalProperties": false, + "properties": { + "keynumidx": { + "type": "integer" + }, + "firstkey": { + "type": "integer" + }, + "keystep": { + "type": "integer" + } + } + } + ] + } + } + } + } + } + }, + { + "type": "array", + "description": "subcommands" + } + ] + } + ] + } + } } } diff --git a/tests/unit/introspection-2.tcl b/tests/unit/introspection-2.tcl index b9d855e7914..89cb4b122c4 100644 --- a/tests/unit/introspection-2.tcl +++ b/tests/unit/introspection-2.tcl @@ -118,14 +118,6 @@ start_server {tags {"introspection"}} { assert_match {*calls=1,*} [cmdstat geoadd] } {} {needs:config-resetstat} - test {COMMAND} { - set res [r command] - puts "====================" - puts "11111" - puts $res - puts "2222" - } - test {COMMAND COUNT get total number of Redis commands} { assert_morethan [r command count] 0 }