Unverified Commit b220e6b4 authored by Wen Hui's avatar Wen Hui Committed by GitHub
Browse files

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> 
parent 528b0e69
...@@ -11,6 +11,16 @@ ...@@ -11,6 +11,16 @@
"ADMIN", "ADMIN",
"SENTINEL", "SENTINEL",
"ONLY_SENTINEL" "ONLY_SENTINEL"
] ],
"reply_schema": {
"type": "array",
"description": "List of monitored Redis masters, and their state.",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
} }
} }
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
"ADMIN", "ADMIN",
"SENTINEL", "SENTINEL",
"ONLY_SENTINEL" "ONLY_SENTINEL"
] ],
"reply_schema": {
"description": "Node ID of the sentinel instance.",
"type": "string"
}
} }
} }
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
"SENTINEL", "SENTINEL",
"ONLY_SENTINEL" "ONLY_SENTINEL"
], ],
"reply_schema": {
"type": "array",
"description": "List of sentinel instances, and their state.",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"arguments": [ "arguments": [
{ {
"name": "master-name", "name": "master-name",
......
...@@ -17,6 +17,16 @@ ...@@ -17,6 +17,16 @@
"SENTINEL", "SENTINEL",
"ONLY_SENTINEL" "ONLY_SENTINEL"
], ],
"reply_schema": {
"type": "array",
"description": "List of monitored replicas, and their state.",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"arguments": [ "arguments": [
{ {
"name": "master-name", "name": "master-name",
......
...@@ -334,9 +334,7 @@ if __name__ == '__main__': ...@@ -334,9 +334,7 @@ if __name__ == '__main__':
print("Hits per command:") print("Hits per command:")
for k, v in sorted(command_counter.items()): for k, v in sorted(command_counter.items()):
print(f" {k}: {v}") print(f" {k}: {v}")
# We don't care about SENTINEL commands not_hit = set(set(docs.keys()) - set(command_counter.keys()) - set(IGNORED_COMMANDS))
not_hit = set(filter(lambda x: not x.startswith("sentinel"),
set(docs.keys()) - set(command_counter.keys()) - set(IGNORED_COMMANDS)))
if not_hit: if not_hit:
if args.verbose: if args.verbose:
print("WARNING! The following commands were not hit at all:") print("WARNING! The following commands were not hit at all:")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment