Skip to content

Commit

Permalink
Merge pull request #511 from mxaddict/patch-22
Browse files Browse the repository at this point in the history
Added FAILFAST for functional test suite
  • Loading branch information
mxaddict committed Jul 22, 2019
2 parents 4337157 + 206c305 commit 85690b9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis/test_06_script_b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fi

if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
BEGIN_FOLD functional-tests
DOCKER_EXEC LOCAL_NTP=1 ./qa/pull-tester/rpc-tests.py -parallel=1 --coverage
DOCKER_EXEC LOCAL_NTP=1 ./qa/pull-tester/rpc-tests.py -parallel=3 --coverage --failfast
END_FOLD
fi
15 changes: 12 additions & 3 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
if 'ENABLE_ZMQ' not in vars():
ENABLE_ZMQ=0

ENABLE_COVERAGE=0
ENABLE_COVERAGE = False
FAILFAST = False

#Create a set to store arguments and create the passon string
opts = set()
Expand All @@ -66,7 +67,9 @@
print_help = True
break
if arg == '--coverage':
ENABLE_COVERAGE = 1
ENABLE_COVERAGE = True
elif arg == '--failfast':
FAILFAST = True
elif PASSON_REGEX.match(arg):
passon_args.append(arg)
elif PARALLEL_REGEX.match(arg):
Expand Down Expand Up @@ -181,7 +184,7 @@
'mnemonic.py',
'sendtoaddress.py',
'stakeimmaturebalance.py',
'rpc-help.py',
'rpc-help.py',
]
#if ENABLE_ZMQ:
# testScripts.append('zmq_test.py')
Expand Down Expand Up @@ -257,6 +260,12 @@ def runtests():
print('stderr:\n' if not stderr == '' else '', stderr)
results += "%s | %s | %s s\n" % (name.ljust(max_len_name), str(passed).ljust(6), duration)
print("Pass: %s%s%s, Duration: %s s\n" % (BOLD[1], passed, BOLD[0], duration))

# Check if we need to quit
if FAILFAST and not passed:
print("Early exiting after test failure")
break

results += BOLD[1] + "\n%s | %s | %s s (accumulated)" % ("ALL".ljust(max_len_name), str(all_passed).ljust(6), time_sum) + BOLD[0]
print(results)
print("\nRuntime: %s s" % (int(time.time() - time0)))
Expand Down
1 change: 1 addition & 0 deletions qa/rpc-tests/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def main(self):
help="The seed to use for assigning port numbers (default: current process id)")
parser.add_option("--coveragedir", dest="coveragedir",
help="Write tested RPC commands into this directory")

self.add_options(parser)
(self.options, self.args) = parser.parse_args()

Expand Down
3 changes: 1 addition & 2 deletions qa/rpc-tests/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PortSeed:

def enable_mocktime():
#For backwared compatibility of the python scripts
#with previous versions of the cache, set MOCKTIME
#with previous versions of the cache, set MOCKTIME
#to Jan 1, 2014 + (201 * 10 * 60)
global MOCKTIME
MOCKTIME = 1388534400 + (201 * 10 * 60)
Expand All @@ -68,7 +68,6 @@ def enable_coverage(dirname):
global COVERAGE_DIR
COVERAGE_DIR = dirname


def get_rpc_proxy(url, node_number, timeout=None):
"""
Args:
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/wallet-hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run_test (self):
non_hd_add = self.nodes[0].getnewaddress()
self.nodes[1].importprivkey(self.nodes[0].dumpprivkey(non_hd_add))

# This should be enough to keep the master key and the non-HD key
# This should be enough to keep the master key and the non-HD key
self.nodes[1].backupwallet(tmpdir + "hd.bak")
#self.nodes[1].dumpwallet(tmpdir + "hd.dump")

Expand Down

0 comments on commit 85690b9

Please sign in to comment.