Skip to content

Commit

Permalink
Fix rename redis to valkey to pass reply-schemas-validator job (#133)
Browse files Browse the repository at this point in the history
Signed-off-by: Vitah Lin <[email protected]>
  • Loading branch information
vitahlin authored and madolson committed Apr 9, 2024
1 parent ad5d81f commit 184f32a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions utils/req-res-log-validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
1. Goes over req-res files, generated by redis-servers, spawned by the testsuite (see logreqres.c)
2. For each request-response pair, it validates the response against the request's reply_schema (obtained from COMMAND DOCS)
This script spins up a redis-server and a redis-cli in order to obtain COMMAND DOCS.
This script spins up a valkey-server and a valkey-cli in order to obtain COMMAND DOCS.
In order to use this file you must run the redis testsuite with the following flags:
./runtest --dont-clean --force-resp3 --log-req-res
Expand Down Expand Up @@ -241,7 +241,7 @@ def fetch_schemas(cli, port, args, docs):

while True:
try:
print('Connecting to Redis...')
print('Connecting to Valkey...')
r = redis.Redis(port=port)
r.ping()
break
Expand Down Expand Up @@ -271,9 +271,9 @@ def fetch_schemas(cli, port, args, docs):
testdir = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../tests")

parser = argparse.ArgumentParser()
parser.add_argument('--server', type=str, default='%s/redis-server' % srcdir)
parser.add_argument('--server', type=str, default='%s/valkey-server' % srcdir)
parser.add_argument('--port', type=int, default=6534)
parser.add_argument('--cli', type=str, default='%s/redis-cli' % srcdir)
parser.add_argument('--cli', type=str, default='%s/valkey-cli' % srcdir)
parser.add_argument('--module', type=str, action='append', default=[])
parser.add_argument('--verbose', action='store_true')
parser.add_argument('--fail-commands-not-all-hit', action='store_true')
Expand All @@ -282,16 +282,16 @@ def fetch_schemas(cli, port, args, docs):

docs = dict()

# Fetch schemas from a Redis instance
print('Starting Redis server')
# Fetch schemas from a Valkey instance
print('Starting Valkey server')
redis_args = [args.server, '--port', str(args.port)]
for module in args.module:
redis_args += ['--loadmodule', 'tests/modules/%s.so' % module]

fetch_schemas(args.cli, args.port, redis_args, docs)

# Fetch schemas from a sentinel
print('Starting Redis sentinel')
print('Starting Valkey sentinel')

# Sentinel needs a config file to start
config_file = "tmpsentinel.conf"
Expand Down Expand Up @@ -347,4 +347,3 @@ def fetch_schemas(cli, port, args, docs):
if args.fail_commands_not_all_hit:
print("ERROR! at least one command was not hit by the tests")
sys.exit(1)

0 comments on commit 184f32a

Please sign in to comment.