From 54d1b81de9abfeb92b7775267ab8396187f712e1 Mon Sep 17 00:00:00 2001 From: Rafi Einstein Date: Tue, 20 Jun 2023 08:58:59 +0300 Subject: [PATCH] Compact print; default protocol; gdb with shards (#191) * Print tests in compact form * Added default protocol * Allow gdb (on master) on multiple shards/slaves * Version 0.7.1 --- RLTest/env.py | 5 +++-- RLTest/loader.py | 9 ++++----- RLTest/redis_std.py | 5 +---- pyproject.toml | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/RLTest/env.py b/RLTest/env.py index 2fb51cb0..c672f823 100644 --- a/RLTest/env.py +++ b/RLTest/env.py @@ -147,6 +147,7 @@ class Defaults: enable_debug_command=False terminate_retries=None terminate_retry_secs=None + protocol=2 def getKwargs(self): kwargs = { @@ -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: @@ -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 = [] diff --git a/RLTest/loader.py b/RLTest/loader.py index 4f67d644..6ba72c32 100644 --- a/RLTest/loader.py +++ b/RLTest/loader.py @@ -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') diff --git a/RLTest/redis_std.py b/RLTest/redis_std.py index a0e8e08b..b682f17f 100644 --- a/RLTest/redis_std.py +++ b/RLTest/redis_std.py @@ -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') @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 54356fec..70c802b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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. "] license = "BSD-3-Clause"