Skip to content

Commit c578408

Browse files
committed
Add exclude option to rpc-tests.py
1 parent 7639d38 commit c578408

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

qa/pull-tester/rpc-tests.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def main():
133133
Help text and arguments for individual test script:''',
134134
formatter_class=argparse.RawTextHelpFormatter)
135135
parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')
136+
parser.add_argument('--exclude', '-x', help='specify a comma-seperated-list of scripts to exclude. Do not include the .py extension in the name.')
136137
parser.add_argument('--extended', action='store_true', help='run the extended test suite in addition to the basic tests')
137138
parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).')
138139
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
@@ -179,13 +180,6 @@ def main():
179180
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
180181
test_list = [t for t in ALL_SCRIPTS if
181182
(t in tests or re.sub(".py$", "", t) in tests)]
182-
if not test_list:
183-
print("No valid test scripts specified. Check that your test is in one "
184-
"of the test lists in rpc-tests.py or run rpc-tests.py with no arguments to run all tests")
185-
print("Scripts not found:")
186-
print(tests)
187-
sys.exit(0)
188-
189183
else:
190184
# No individual tests have been specified. Run base tests, and
191185
# optionally ZMQ tests and extended tests.
@@ -198,6 +192,17 @@ def main():
198192
# (for parallel running efficiency). This combined list will is no
199193
# longer sorted.
200194

195+
# Remove the test cases that the user has explicitly asked to exclude.
196+
if args.exclude:
197+
for exclude_test in args.exclude.split(','):
198+
if exclude_test + ".py" in test_list:
199+
test_list.remove(exclude_test + ".py")
200+
201+
if not test_list:
202+
print("No valid test scripts specified. Check that your test is in one "
203+
"of the test lists in rpc-tests.py, or run rpc-tests.py with no arguments to run all tests")
204+
sys.exit(0)
205+
201206
if args.help:
202207
# Print help for rpc-tests.py, then print help of the first script and exit.
203208
parser.print_help()

0 commit comments

Comments
 (0)