Skip to content

Commit

Permalink
Merge bitcoin#2016: [Tests] Add --all option to test_runner for compl…
Browse files Browse the repository at this point in the history
…ete functional tests coverage

9c0c944 Tests: Add --all option to test_runner for complete coverage (random-zebra)

Pull request description:

  Trivial, as per title.
  ```
  ./test_runner.py --all
  ```
  for the complete run of all the 62 (!) scripts in our suite.

ACKs for top commit:
  Fuzzbawls:
    ACK 9c0c944

Tree-SHA512: 8b23c1923711d6c9081e27368f507e1231354e0f48a19370a7501b1a471c4be69e8c1fe7dcdd4a3a7a656b46009e581692e03169176fa60d3a5b9987f83c5f01
  • Loading branch information
random-zebra committed Dec 3, 2020
2 parents b01a1bb + 9c0c944 commit 564dce8
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def main():
epilog='''
Help text and arguments for individual test script:''',
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--all', '-a', action='store_true', help='run all available tests (overrides other flags)')
parser.add_argument('--combinedlogslen', '-c', type=int, default=0, help='print a combined log (of length n lines) from all test nodes and test framework to the console on failure.')
parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')
parser.add_argument('--exclude', '-x', help='specify a comma-separated-list of scripts to exclude.')
Expand Down Expand Up @@ -285,30 +286,33 @@ def main():
sys.exit(0)

# Build list of tests
if tests:
# Individual tests have been specified. Run specified tests that exist
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
tests = [re.sub("\.py$", "", t) + ".py" for t in tests]
test_list = []
for t in tests:
if t in ALL_SCRIPTS:
test_list.append(t)
else:
print("{}WARNING!{} Test '{}' not found in full test list.".format(BOLD[1], BOLD[0], t))
if args.all:
test_list = ALL_SCRIPTS
else:
test_list = []
if args.tiertwo:
test_list += TIERTWO_SCRIPTS
if args.sapling:
test_list += SAPLING_SCRIPTS
if len(test_list) == 0:
# No individual tests (or sub-list) have been specified.
# Run all base tests, and optionally run extended tests.
test_list = BASE_SCRIPTS
if args.extended:
# place the EXTENDED_SCRIPTS first since the three longest ones
# are there and the list is shorter
test_list = EXTENDED_SCRIPTS + test_list
if tests:
# Individual tests have been specified. Run specified tests that exist
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
tests = [re.sub("\.py$", "", t) + ".py" for t in tests]
test_list = []
for t in tests:
if t in ALL_SCRIPTS:
test_list.append(t)
else:
print("{}WARNING!{} Test '{}' not found in full test list.".format(BOLD[1], BOLD[0], t))
else:
test_list = []
if args.tiertwo:
test_list += TIERTWO_SCRIPTS
if args.sapling:
test_list += SAPLING_SCRIPTS
if len(test_list) == 0:
# No individual tests (or sub-list) have been specified.
# Run all base tests, and optionally run extended tests.
test_list = BASE_SCRIPTS
if args.extended:
# place the EXTENDED_SCRIPTS first since the three longest ones
# are there and the list is shorter
test_list = EXTENDED_SCRIPTS + test_list

# Remove the test cases that the user has explicitly asked to exclude.
if args.exclude:
Expand Down

0 comments on commit 564dce8

Please sign in to comment.