Skip to content

Commit 8f9725c

Browse files
author
MarcoFalke
committed
Merge #16390: qa: Add --filter option to test_runner.py
1a62425 qa: Add --filter option to test_runner.py (João Barbosa) Pull request description: Allows to run functional tests like: ```sh test/functional/test_runner.py --filter wallet ``` ACKs for top commit: jonatack: ACK 1a62425 Tree-SHA512: 53199e01da3b2e0112843c1c68c69d8fd7fc9bb6a6cb45a81c324973c4824ebf5fef574f9efab81a64d52e397e25d979ae40f0eaba35afb771e80012768f0b08
2 parents 29082e8 + 1a62425 commit 8f9725c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/test_runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def main():
234234
parser.add_argument('--quiet', '-q', action='store_true', help='only print dots, results summary and failure logs')
235235
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
236236
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
237+
parser.add_argument('--filter', help='filter scripts to run by regular expression')
237238
args, unknown_args = parser.parse_known_args()
238239

239240
# args to be passed on always start with two dashes; tests are the remaining unknown args
@@ -294,6 +295,9 @@ def main():
294295
if not exclude_list:
295296
print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], exclude_test))
296297

298+
if args.filter:
299+
test_list = list(filter(re.compile(args.filter).search, test_list))
300+
297301
if not test_list:
298302
print("No valid test scripts specified. Check that your test is in one "
299303
"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests")

0 commit comments

Comments
 (0)