Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override module args #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions RLTest/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def compareEnvs(self, env):
return True

def __init__(self, testName=None, testDescription=None, module=None,
moduleArgs=None, env=None, useSlaves=None, shardsCount=None, decodeResponses=None,
moduleArgs=None, overrideModuleArgs=None, env=None, useSlaves=None, shardsCount=None, decodeResponses=None,
useAof=None, forceTcp=False, useTLS=False, tlsCertFile=None, tlsKeyFile=None,
tlsCaCertFile=None, logDir=None, redisBinaryPath=None, dmcBinaryPath=None,
redisEnterpriseBinaryPath=None):
Expand All @@ -172,18 +172,21 @@ def __init__(self, testName=None, testDescription=None, module=None,
print(Colors.Gray('\tdescription: ' + testDescription))

self.module = module if module else Defaults.module
self.moduleArgs = copy.deepcopy(Defaults.module_args)
if moduleArgs:
if self.moduleArgs is None or len(self.moduleArgs) == 0:
self.moduleArgs = ['']
argsToAdd = moduleArgs.split(' ')
for i in range(0, len(argsToAdd) - 1, 2):
# join module args
if argsToAdd[i] not in self.moduleArgs[0]:
self.moduleArgs[0] += ' %s %s' % (argsToAdd[i], argsToAdd[i + 1])
if self.moduleArgs is not None:
for i in range(0, len(self.moduleArgs)):
self.moduleArgs[i] = self.moduleArgs[i].strip()
if overrideModuleArgs:
self.moduleArgs = copy.deepcopy(overrideModuleArgs)
else:
self.moduleArgs = copy.deepcopy(Defaults.module_args)
if moduleArgs:
if self.moduleArgs is None or len(self.moduleArgs) == 0:
self.moduleArgs = ['']
argsToAdd = moduleArgs.split(' ')
for i in range(0, len(argsToAdd) - 1, 2):
# join module args
if argsToAdd[i] not in self.moduleArgs[0]:
self.moduleArgs[0] += ' %s %s' % (argsToAdd[i], argsToAdd[i + 1])
if self.moduleArgs is not None:
for i in range(0, len(self.moduleArgs)):
self.moduleArgs[i] = self.moduleArgs[i].strip()
self.env = env if env else Defaults.env
self.useSlaves = useSlaves if useSlaves else Defaults.use_slaves
self.shardsCount = shardsCount if shardsCount else Defaults.num_shards
Expand Down