diff --git a/pyproject.toml b/pyproject.toml index 6505790..1ead50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.11.41" +version = "0.11.52" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 ","Redis Performance Group "] readme = "README.md" diff --git a/redisbench_admin/cli.py b/redisbench_admin/cli.py index a8647e0..c916a2e 100644 --- a/redisbench_admin/cli.py +++ b/redisbench_admin/cli.py @@ -42,7 +42,7 @@ def populate_with_project_data(): project_description = None try: pyproject_toml = toml.load("pyproject.toml") - if 'project' in pyproject_toml: + if "project" in pyproject_toml: project_data = pyproject_toml["project"] project_name = project_data["name"] project_version = project_data["version"] diff --git a/redisbench_admin/run/args.py b/redisbench_admin/run/args.py index 993591a..f09a39c 100644 --- a/redisbench_admin/run/args.py +++ b/redisbench_admin/run/args.py @@ -23,6 +23,7 @@ TRIGGERING_ENV = os.getenv("TRIGGERING_ENV", DEFAULT_TRIGGERING_ENV) ENV = os.getenv("ENV", "oss-standalone,oss-cluster") SETUP = os.getenv("SETUP", "") +BENCHMARK = os.getenv("BENCHMARK", "") BENCHMARK_GLOB = os.getenv("BENCHMARK_GLOB", "*.yml") BENCHMARK_REGEX = os.getenv("BENCHMARK_REGEX", ".*") BENCHMARK_RUNNER_GROUP_TOTAL = int(os.getenv("BENCHMARK_RUNNER_GROUP_TOTAL", "1")) @@ -94,7 +95,7 @@ def common_run_args(parser): parser.add_argument( "--test", type=str, - default="", + default=BENCHMARK, help="specify a test to run. By default will run all of them.", ) parser.add_argument( diff --git a/redisbench_admin/run/run.py b/redisbench_admin/run/run.py index 30659b0..b3e0a5f 100644 --- a/redisbench_admin/run/run.py +++ b/redisbench_admin/run/run.py @@ -117,6 +117,15 @@ def define_benchmark_plan(benchmark_definitions, default_specs): test_benchmark_config["dbconfig"] = {} setup_dbconfig = setup_settings["dbconfig"] benchmark_dbconfig = test_benchmark_config["dbconfig"] + + # Handle legacy list format - convert to dict by merging all entries + if isinstance(benchmark_dbconfig, list): + converted_dbconfig = {} + for entry in benchmark_dbconfig: + if isinstance(entry, dict): + converted_dbconfig.update(entry) + benchmark_dbconfig = converted_dbconfig + logging.info( f"Merging setup dbconfig: {setup_dbconfig}, with benchmark dbconfig {test_benchmark_config}" ) diff --git a/redisbench_admin/run_local/run_local.py b/redisbench_admin/run_local/run_local.py index 4c7d46f..8300eb3 100644 --- a/redisbench_admin/run_local/run_local.py +++ b/redisbench_admin/run_local/run_local.py @@ -307,9 +307,10 @@ def run_local_command_logic(args, project_name, project_version): None, args.password, ) + # get the pids redis_pids = [ - redis_process.pid - for redis_process in redis_processes + redis_conn.info("server")["process_id"] + for redis_conn in redis_conns ] # start the profile ( @@ -556,6 +557,14 @@ def run_local_command_logic(args, project_name, project_version): "Keeping environment and topology active upon request." ) + except KeyboardInterrupt: + logging.critical( + "Detected Keyboard interrupt...Tearing down and exiting!" + ) + teardown_local_setup( + redis_conns, redis_processes, setup_name + ) + exit(1) except: return_code |= 1 logging.critical(