From ab7efd1664deefcee1af471ae5963992544d4313 Mon Sep 17 00:00:00 2001 From: "meir@redislabs.com" Date: Tue, 16 Nov 2021 16:12:00 +0200 Subject: [PATCH 1/2] added progress indication --- RLTest/__main__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/RLTest/__main__.py b/RLTest/__main__.py index 7427e8c4..1b7b3c9f 100644 --- a/RLTest/__main__.py +++ b/RLTest/__main__.py @@ -516,10 +516,10 @@ def handleFailure(self, exception=None, prefix='', testname=None, env=None): else: self.addFailure(testname, '') - def _runTest(self, test, numberOfAssertionFailed=0, prefix='', before=None, after=None): + def _runTest(self, test, index, totalTests, numberOfAssertionFailed=0, prefix='', before=None, after=None): msgPrefix = test.name - print(Colors.Cyan(prefix + test.name)) + print(Colors.Cyan('%d/%d) %s' % (index, totalTests, prefix + test.name))) if len(inspect.getargspec(test.target).args) > 0 and not test.is_method: try: @@ -623,7 +623,9 @@ def execute(self): print(Colors.Bred('only one test can be run on interactive-debugger use -t')) sys.exit(1) - for test in self.loader: + tests = [t for t in self.loader] + testCount = len(tests) + for i, test in enumerate(tests): with self.envScopeGuard(): if test.is_class: try: @@ -638,19 +640,19 @@ def execute(self): self.addFailure(test.name + " [__init__]") continue - print(Colors.Cyan(test.name)) + print(Colors.Cyan('%d/%d) %s' %(i, testCount, test.name))) failures = 0 before = getattr(obj, 'setUp', None) after = getattr(obj, 'tearDown', None) for subtest in test.get_functions(obj): - failures += self._runTest(subtest, prefix='\t', + failures += self._runTest(subtest, i, testCount, prefix='\t', numberOfAssertionFailed=failures, before=before, after=after) done += 1 else: - self._runTest(test) + self._runTest(test, i, testCount) done += 1 self.takeEnvDown(fullShutDown=True) From bec86439f0a0230d7dc98d2a1cb4bd9b42d015bf Mon Sep 17 00:00:00 2001 From: "meir@redislabs.com" Date: Tue, 16 Nov 2021 16:27:59 +0200 Subject: [PATCH 2/2] test commit --- RLTest/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RLTest/__main__.py b/RLTest/__main__.py index 1b7b3c9f..a54aab92 100644 --- a/RLTest/__main__.py +++ b/RLTest/__main__.py @@ -11,6 +11,7 @@ import time import shlex + from RLTest.env import Env, TestAssertionFailure, Defaults from RLTest.utils import Colors, fix_modules, fix_modulesArgs from RLTest.loader import TestLoader