Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_runner.py
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | def main(): | ||||
parser.add_argument('--jobs', '-j', type=int, default=DEFAULT_JOBS, | parser.add_argument('--jobs', '-j', type=int, default=DEFAULT_JOBS, | ||||
help='how many test scripts to run in parallel.') | help='how many test scripts to run in parallel.') | ||||
parser.add_argument('--keepcache', '-k', action='store_true', | 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.') | 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', | parser.add_argument('--quiet', '-q', action='store_true', | ||||
help='only print results summary and failure logs') | help='only print results summary and failure logs') | ||||
parser.add_argument('--tmpdirprefix', '-t', | parser.add_argument('--tmpdirprefix', '-t', | ||||
default=tempfile.gettempdir(), help="Root directory for datadirs") | default=tempfile.gettempdir(), help="Root directory for datadirs") | ||||
parser.add_argument('--junitoutput', '-J', | parser.add_argument('--junitoutput', '-J', default='junit_results.xml', | ||||
default=os.path.join(build_dir, 'junit_results.xml'), help="file that will store JUnit formatted test results.") | help="File that will store JUnit formatted test results. If no absolute path is given it is treated as relative to the temporary directory.") | ||||
args, unknown_args = parser.parse_known_args() | args, unknown_args = parser.parse_known_args() | ||||
# args to be passed on always start with two dashes; tests are the | # args to be passed on always start with two dashes; tests are the | ||||
# remaining unknown args | # remaining unknown args | ||||
tests = [arg for arg in unknown_args if arg[:2] != "--"] | tests = [arg for arg in unknown_args if arg[:2] != "--"] | ||||
passon_args = [arg for arg in unknown_args if arg[:2] == "--"] | passon_args = [arg for arg in unknown_args if arg[:2] == "--"] | ||||
passon_args.append("--configfile={}".format(configfile)) | passon_args.append("--configfile={}".format(configfile)) | ||||
# Set up logging | # Set up logging | ||||
logging_level = logging.INFO if args.quiet else logging.DEBUG | logging_level = logging.INFO if args.quiet else logging.DEBUG | ||||
logging.basicConfig(format='%(message)s', level=logging_level) | logging.basicConfig(format='%(message)s', level=logging_level) | ||||
# Create base test directory | # Create base test directory | ||||
tmpdir = os.path.join("{}", "bitcoin_test_runner_{:%Y%m%d_%H%M%S}").format( | tmpdir = os.path.join("{}", "bitcoin_test_runner_{:%Y%m%d_%H%M%S}").format( | ||||
args.tmpdirprefix, datetime.datetime.now()) | args.tmpdirprefix, datetime.datetime.now()) | ||||
os.makedirs(tmpdir) | os.makedirs(tmpdir) | ||||
logging.debug("Temporary test directory at {}".format(tmpdir)) | logging.debug("Temporary test directory at {}".format(tmpdir)) | ||||
if not os.path.isabs(args.junitoutput): | |||||
args.junitoutput = os.path.join(tmpdir, args.junitoutput) | |||||
enable_wallet = config["components"].getboolean("ENABLE_WALLET") | enable_wallet = config["components"].getboolean("ENABLE_WALLET") | ||||
enable_utils = config["components"].getboolean("ENABLE_UTILS") | enable_utils = config["components"].getboolean("ENABLE_UTILS") | ||||
enable_bitcoind = config["components"].getboolean("ENABLE_BITCOIND") | enable_bitcoind = config["components"].getboolean("ENABLE_BITCOIND") | ||||
if config["environment"]["EXEEXT"] == ".exe" and not args.force: | if config["environment"]["EXEEXT"] == ".exe" and not args.force: | ||||
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9 | # https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9 | ||||
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964 | # https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964 | ||||
print( | print( | ||||
▲ Show 20 Lines • Show All 556 Lines • Show Last 20 Lines |