summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Hui <wen.hui.ware@gmail.com>2023-04-19 02:08:11 -0400
committerGitHub <noreply@github.com>2023-04-19 09:08:11 +0300
commitb220e6b45015a4e06d385cb0ed30606e50968bf6 (patch)
treedb1fbe98caf72aa4825e03a5caa72812fdd7995c
parent528b0e691ed7f2c07b7bac29ea4234c1fb7df18a (diff)
downloadredis-b220e6b45015a4e06d385cb0ed30606e50968bf6.tar.gz
Updating reply_schema for sentinal commands (#12018)
Some sentinel subcommands are missing the reply_schema in the json file, so add the proper reply_schema part in json file as sentinel replicas commands. The schema validator was skipping coverage test for sentinel commands, this was initially done just in order to focus on redis commands and leave sentinel coverage for later, so this check is now removed. sentinel commands that were missing reply schema: * sentinel masters * sentinel myid * sentinel sentinels <master-name> * sentinel slaves (deprecated) <master-name>
-rw-r--r--src/commands/sentinel-masters.json12
-rw-r--r--src/commands/sentinel-myid.json6
-rw-r--r--src/commands/sentinel-sentinels.json10
-rw-r--r--src/commands/sentinel-slaves.json10
-rwxr-xr-xutils/req-res-log-validator.py4
5 files changed, 37 insertions, 5 deletions
diff --git a/src/commands/sentinel-masters.json b/src/commands/sentinel-masters.json
index 0b6e15b63..1e96b7105 100644
--- a/src/commands/sentinel-masters.json
+++ b/src/commands/sentinel-masters.json
@@ -11,6 +11,16 @@
"ADMIN",
"SENTINEL",
"ONLY_SENTINEL"
- ]
+ ],
+ "reply_schema": {
+ "type": "array",
+ "description": "List of monitored Redis masters, and their state.",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
}
}
diff --git a/src/commands/sentinel-myid.json b/src/commands/sentinel-myid.json
index a49c78bd9..4d366ebf3 100644
--- a/src/commands/sentinel-myid.json
+++ b/src/commands/sentinel-myid.json
@@ -11,6 +11,10 @@
"ADMIN",
"SENTINEL",
"ONLY_SENTINEL"
- ]
+ ],
+ "reply_schema": {
+ "description": "Node ID of the sentinel instance.",
+ "type": "string"
+ }
}
}
diff --git a/src/commands/sentinel-sentinels.json b/src/commands/sentinel-sentinels.json
index 3a2c7362a..fdaa5cb99 100644
--- a/src/commands/sentinel-sentinels.json
+++ b/src/commands/sentinel-sentinels.json
@@ -12,6 +12,16 @@
"SENTINEL",
"ONLY_SENTINEL"
],
+ "reply_schema": {
+ "type": "array",
+ "description": "List of sentinel instances, and their state.",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
"arguments": [
{
"name": "master-name",
diff --git a/src/commands/sentinel-slaves.json b/src/commands/sentinel-slaves.json
index 83ee44d16..c1fec41bb 100644
--- a/src/commands/sentinel-slaves.json
+++ b/src/commands/sentinel-slaves.json
@@ -17,6 +17,16 @@
"SENTINEL",
"ONLY_SENTINEL"
],
+ "reply_schema": {
+ "type": "array",
+ "description": "List of monitored replicas, and their state.",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
"arguments": [
{
"name": "master-name",
diff --git a/utils/req-res-log-validator.py b/utils/req-res-log-validator.py
index 2cb399b6a..b96e7f4dc 100755
--- a/utils/req-res-log-validator.py
+++ b/utils/req-res-log-validator.py
@@ -334,9 +334,7 @@ if __name__ == '__main__':
print("Hits per command:")
for k, v in sorted(command_counter.items()):
print(f" {k}: {v}")
- # We don't care about SENTINEL commands
- not_hit = set(filter(lambda x: not x.startswith("sentinel"),
- set(docs.keys()) - set(command_counter.keys()) - set(IGNORED_COMMANDS)))
+ not_hit = set(set(docs.keys()) - set(command_counter.keys()) - set(IGNORED_COMMANDS))
if not_hit:
if args.verbose:
print("WARNING! The following commands were not hit at all:")