Skip to content

Commit

Permalink
Compact print; default protocol; gdb with shards (#191)
Browse files Browse the repository at this point in the history
* Print tests in compact form
* Added default protocol
* Allow gdb (on master) on multiple shards/slaves
* Version 0.7.1
  • Loading branch information
rafie authored Jun 20, 2023
1 parent 61a8468 commit 54d1b81
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 3 additions & 2 deletions RLTest/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Defaults:
enable_debug_command=False
terminate_retries=None
terminate_retry_secs=None
protocol=2

def getKwargs(self):
kwargs = {
Expand Down Expand Up @@ -192,7 +193,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
useAof=None, useRdbPreamble=None, forceTcp=False, useTLS=False, tlsCertFile=None, tlsKeyFile=None,
tlsCaCertFile=None, tlsPassphrase=None, logDir=None, redisBinaryPath=None, dmcBinaryPath=None,
redisEnterpriseBinaryPath=None, noDefaultModuleArgs=False, clusterNodeTimeout = None,
freshEnv=False, enableDebugCommand=None, protocol=2, terminateRetries=None, terminateRetrySecs=None):
freshEnv=False, enableDebugCommand=None, protocol=None, terminateRetries=None, terminateRetrySecs=None):

self.testName = testName if testName else Defaults.curr_test_name
if self.testName is None:
Expand Down Expand Up @@ -233,7 +234,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
self.terminateRetries = terminateRetries
self.terminateRetrySecs = terminateRetrySecs

self.protocol = protocol
self.protocol = protocol if protocol is not None else Defaults.protocol

self.assertionFailedSummary = []

Expand Down
9 changes: 4 additions & 5 deletions RLTest/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,11 @@ def __iter__(self):
return iter(self.tests)

def print_tests(self):
tests = []
for t in self.tests:
print("Test: ", t.name)
if t.is_class:
print("\tClass")
print("\tFunctions")
for m in t.functions:
print("\t\t", m)
tests.append(f"{t.name}.{m}")
else:
print("\tFunction")
tests.append(t.name)
print(*sorted(tests), sep='\n')
5 changes: 1 addition & 4 deletions RLTest/redis_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
raise ValueError('Unix sockets cannot be used with cluster mode')
self.port = -1

if self.has_interactive_debugger and serverId > 1:
assert self.noCatch and not self.useSlaves and not self.clusterEnabled

if self.useTLS:
if self.useUnix:
raise ValueError('Unix sockets cannot be used with TLS enabled mode')
Expand Down Expand Up @@ -171,7 +168,7 @@ def _getRedisVersion(self):

def createCmdArgs(self, role):
cmdArgs = []
if self.debugger:
if self.debugger and role == MASTER and self.masterServerId == 1:
cmdArgs += self.debugger.generate_command(self._getValgrindFilePath(role) if not self.noCatch else None)

cmdArgs += [self.redisBinaryPath]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "RLTest"
version = "0.7.0"
version = "0.7.1"
description="Redis Modules Test Framework, allow to run tests on redis and modules on a variety of environments"
authors = ["Redis, Inc. <[email protected]>"]
license = "BSD-3-Clause"
Expand Down

0 comments on commit 54d1b81

Please sign in to comment.