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>
This commit is contained in:
Wen Hui 2023-04-19 02:08:11 -04:00 committed by GitHub
parent 528b0e691e
commit b220e6b450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 5 deletions

View File

@ -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"
}
}
}
}
}

View File

@ -11,6 +11,10 @@
"ADMIN",
"SENTINEL",
"ONLY_SENTINEL"
]
],
"reply_schema": {
"description": "Node ID of the sentinel instance.",
"type": "string"
}
}
}

View File

@ -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",

View File

@ -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",

View File

@ -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:")