tests: Print dots by default
This commit is contained in:
parent
29f429dc7d
commit
4bd125fff0
1 changed files with 10 additions and 14 deletions
|
@ -222,7 +222,7 @@ def main():
|
||||||
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
|
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
|
||||||
parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')
|
parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')
|
||||||
parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.')
|
parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.')
|
||||||
parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')
|
parser.add_argument('--quiet', '-q', action='store_true', help='only print dots, results summary and failure logs')
|
||||||
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
|
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
|
||||||
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
|
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
|
||||||
args, unknown_args = parser.parse_known_args()
|
args, unknown_args = parser.parse_known_args()
|
||||||
|
@ -321,11 +321,10 @@ def main():
|
||||||
enable_coverage=args.coverage,
|
enable_coverage=args.coverage,
|
||||||
args=passon_args,
|
args=passon_args,
|
||||||
combined_logs_len=args.combinedlogslen,
|
combined_logs_len=args.combinedlogslen,
|
||||||
failfast=args.failfast,
|
failfast=args.failfast
|
||||||
level=logging_level
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def run_tests(test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, level=logging.DEBUG):
|
def run_tests(test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False):
|
||||||
args = args or []
|
args = args or []
|
||||||
|
|
||||||
# Warn if bitcoind is already running (unix only)
|
# Warn if bitcoind is already running (unix only)
|
||||||
|
@ -360,7 +359,7 @@ def run_tests(test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=Fal
|
||||||
raise
|
raise
|
||||||
|
|
||||||
#Run Tests
|
#Run Tests
|
||||||
job_queue = TestHandler(jobs, tests_dir, tmpdir, test_list, flags, level)
|
job_queue = TestHandler(jobs, tests_dir, tmpdir, test_list, flags)
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
test_results = []
|
test_results = []
|
||||||
|
|
||||||
|
@ -441,14 +440,13 @@ class TestHandler:
|
||||||
Trigger the test scripts passed in via the list.
|
Trigger the test scripts passed in via the list.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None, logging_level=logging.DEBUG):
|
def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None):
|
||||||
assert(num_tests_parallel >= 1)
|
assert(num_tests_parallel >= 1)
|
||||||
self.num_jobs = num_tests_parallel
|
self.num_jobs = num_tests_parallel
|
||||||
self.tests_dir = tests_dir
|
self.tests_dir = tests_dir
|
||||||
self.tmpdir = tmpdir
|
self.tmpdir = tmpdir
|
||||||
self.test_list = test_list
|
self.test_list = test_list
|
||||||
self.flags = flags
|
self.flags = flags
|
||||||
self.logging_level = logging_level
|
|
||||||
self.num_running = 0
|
self.num_running = 0
|
||||||
self.jobs = []
|
self.jobs = []
|
||||||
|
|
||||||
|
@ -496,12 +494,10 @@ class TestHandler:
|
||||||
status = "Failed"
|
status = "Failed"
|
||||||
self.num_running -= 1
|
self.num_running -= 1
|
||||||
self.jobs.remove(job)
|
self.jobs.remove(job)
|
||||||
if self.logging_level == logging.DEBUG:
|
|
||||||
clearline = '\r' + (' ' * dot_count) + '\r'
|
clearline = '\r' + (' ' * dot_count) + '\r'
|
||||||
print(clearline, end='', flush=True)
|
print(clearline, end='', flush=True)
|
||||||
dot_count = 0
|
dot_count = 0
|
||||||
return TestResult(name, status, int(time.time() - start_time)), testdir, stdout, stderr
|
return TestResult(name, status, int(time.time() - start_time)), testdir, stdout, stderr
|
||||||
if self.logging_level == logging.DEBUG:
|
|
||||||
print('.', end='', flush=True)
|
print('.', end='', flush=True)
|
||||||
dot_count += 1
|
dot_count += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue