From 5261442b0961507c83ab1d724052b2009e17857f Mon Sep 17 00:00:00 2001 From: lsankar4033 Date: Wed, 19 Aug 2020 10:52:35 -0700 Subject: [PATCH] Remove start/stop fixture commands + reuse flag on test --- steth.py | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/steth.py b/steth.py index 2c38838..31b4973 100755 --- a/steth.py +++ b/steth.py @@ -10,33 +10,16 @@ from lib.runner import run_test_files, all_test_files, file_matches_filter from lib.logging_tests import all_logging_test_files - -def run_start_fixture_cmd(args): - client = args.client - - fixtures = extract_fixtures([client]) - - for fixture in fixtures: - setup_fixture(fixture) - - -def run_stop_fixture_cmd(args): - for client in SUPPORTED_CLIENTS: - stop_instance(client) - - def run_test_cmd(args): clients = SUPPORTED_CLIENTS if args.client is None else [args.client] - reuse_clients = args.reuse file_filter = args.only test_files = [file for file in all_test_files() if file_matches_filter(file, file_filter)] fixtures = extract_fixtures(clients) failed = False for fixture in fixtures: - if not reuse_clients: - setup_fixture(fixture) + setup_fixture(fixture) try: return_code = run_test_files(fixture.name, test_files, DEFAULT_ARGS) @@ -48,8 +31,7 @@ def run_test_cmd(args): failed = True finally: - if not reuse_clients: - teardown_fixture(fixture) + teardown_fixture(fixture) if failed: exit(1) @@ -70,22 +52,10 @@ def run_logging_test(args): steth = argparse.ArgumentParser(description='Stethoscope tool for running multi-client Eth2 scenarios') steth_sub = steth.add_subparsers() - fixture = steth_sub.add_parser('fixture', help='Manage fixtures of client instances') - fixture_sub = fixture.add_subparsers() - - start = fixture_sub.add_parser('start') - start.add_argument( - 'client', help=f'client to start. can only start 1 at a time until dynamic ENRs implemented. possible values: {SUPPORTED_CLIENTS}') - start.set_defaults(func=run_start_fixture_cmd) - - stop = fixture_sub.add_parser('stop') - stop.set_defaults(func=run_stop_fixture_cmd) - test = steth_sub.add_parser('test', help='Run stethoscope unit tests') test.add_argument('-c', '--client', help=f'run test(s) for a specific client. possible values: {SUPPORTED_CLIENTS}') test.add_argument('-o', '--only', help='run specific tests by name') - test.add_argument('-r', '--reuse', default=False, action='store_true', help='reuse running fixtures') test.set_defaults(func=run_test_cmd) test = steth_sub.add_parser('logging_test', help='Display example logs from ./steth.py test. Useful for testing CI integration')