diff --git a/README.md b/README.md index 474e25b..f9db4ea 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,12 @@ Instead of testing the raw performance of an RPC node, `flood` can be used to te `flood all reth=91.91.91.91 erigon=92.92.92.92 --equality` +There is a possibility to run only specific test or a subset of tests using regular expression like this: + +`flood debug_* reth=91.91.91.91 erigon=92.92.92.92 --equality` + +Above will run all the test scenarios which contain prefix "debug_". + ### From python All of `flood`'s functionality can be used from python instead of the CLI. Some functions: diff --git a/flood/tests/equality_tests/equality_test_runs.py b/flood/tests/equality_tests/equality_test_runs.py index 4340556..410a66e 100644 --- a/flood/tests/equality_tests/equality_test_runs.py +++ b/flood/tests/equality_tests/equality_test_runs.py @@ -18,6 +18,7 @@ def run_equality_test( import os import requests import toolstr + import re nodes = flood.user_io.parse_nodes(nodes, request_metadata=True) for node in nodes.values(): @@ -30,7 +31,8 @@ def run_equality_test( # get tests if test_name != 'all': - equality_tests = [t for t in equality_tests if t[0] == test_name] + pattern = f"^{test_name}" # Creates a regex pattern starting with test_name + equality_tests = [t for t in equality_tests if re.match(pattern, t[0])] if not equality_tests: raise NotImplementedError( 'no matching test found for name "' + test_name + '"'