qa: Add --automate flag to smoke tests
This commit is contained in:
parent
4498eb26db
commit
5a577c7630
|
@ -150,6 +150,10 @@ def wait_for_balance(zcash, zaddr, expected=None):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
ttl -= 1
|
ttl -= 1
|
||||||
if ttl == 0:
|
if ttl == 0:
|
||||||
|
if zcash.automated:
|
||||||
|
# Reset timeout
|
||||||
|
ttl = 300
|
||||||
|
else:
|
||||||
# Ask user if they want to keep waiting
|
# Ask user if they want to keep waiting
|
||||||
print()
|
print()
|
||||||
print('Balance: %s Expected: %s' % (balance, expected))
|
print('Balance: %s Expected: %s' % (balance, expected))
|
||||||
|
@ -705,6 +709,7 @@ class ZcashNode(object):
|
||||||
self.__process = None
|
self.__process = None
|
||||||
self.__proxy = None
|
self.__proxy = None
|
||||||
|
|
||||||
|
self.automated = args.automate
|
||||||
self.use_faucet = args.faucet
|
self.use_faucet = args.faucet
|
||||||
|
|
||||||
def start(self, extra_args=None, timewait=None):
|
def start(self, extra_args=None, timewait=None):
|
||||||
|
@ -782,6 +787,7 @@ class ZcashNode(object):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--automate', action='store_true', help='Run the smoke tests without a user present')
|
||||||
parser.add_argument('--list-stages', dest='list', action='store_true')
|
parser.add_argument('--list-stages', dest='list', action='store_true')
|
||||||
parser.add_argument('--mainnet', action='store_true', help='Use mainnet instead of testnet')
|
parser.add_argument('--mainnet', action='store_true', help='Use mainnet instead of testnet')
|
||||||
parser.add_argument('--use-faucet', dest='faucet', action='store_true', help='Use testnet faucet as source of funds')
|
parser.add_argument('--use-faucet', dest='faucet', action='store_true', help='Use testnet faucet as source of funds')
|
||||||
|
@ -812,6 +818,15 @@ def main():
|
||||||
print('Cannot use testnet faucet when running mainnet tests.')
|
print('Cannot use testnet faucet when running mainnet tests.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Enforce correctly-configured automatic mode
|
||||||
|
if args.automate:
|
||||||
|
if args.mainnet:
|
||||||
|
print('Cannot yet automate mainnet tests.')
|
||||||
|
sys.exit(1)
|
||||||
|
if not args.faucet:
|
||||||
|
print('--automate requires --use-faucet')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Start zcashd
|
# Start zcashd
|
||||||
zcash = ZcashNode(args)
|
zcash = ZcashNode(args)
|
||||||
print('Start time: %s' % TIME_STARTED)
|
print('Start time: %s' % TIME_STARTED)
|
||||||
|
|
Loading…
Reference in New Issue