From 12f19b09e901bb178bc109eee7f74296291f9dcf Mon Sep 17 00:00:00 2001 From: Paige Rubendall Date: Wed, 6 Mar 2024 13:39:28 -0500 Subject: [PATCH] adding kwargs as orion variable --- orion.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/orion.py b/orion.py index d4cf39a..cf9a86b 100644 --- a/orion.py +++ b/orion.py @@ -28,7 +28,7 @@ def cli(): @click.option("--output", default="output.csv", help="Path to save the output csv file") @click.option("--debug", is_flag=True, help="log level ") @click.option("--hunter-analyze",is_flag=True, help="run hunter analyze") -def orion(uuid, baseline, config, debug, output, hunter_analyze): +def orion(**kwargs): """Orion is the cli tool to detect regressions over the runs Args: @@ -39,10 +39,11 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze): output (str): path to the output csv file hunter_analyze (bool): turns on hunter analysis of gathered uuid(s) data """ - level = logging.DEBUG if debug else logging.INFO + + level = logging.DEBUG if kwargs["debug"] else logging.INFO logger = logging.getLogger("Orion") logger = orion_funcs.set_logging(level, logger) - data = orion_funcs.load_config(config,logger) + data = orion_funcs.load_config(kwargs["config"],logger) ES_URL=None if "ES_SERVER" in data.keys(): @@ -55,8 +56,10 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze): sys.exit(1) for test in data["tests"]: + uuid = kwargs["uuid"] + baseline = kwargs["baseline"] match = Matcher(index="perf_scale_ci", level=level, ES_URL=ES_URL) - if uuid == "": + if kwargs["uuid"] == "": metadata = orion_funcs.get_metadata(test, logger) else: metadata = orion_funcs.get_uuid_metadata(uuid,match,logger) @@ -92,9 +95,9 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze): lambda left, right: pd.merge(left, right, on="uuid", how="inner"), dataframe_list, ) - match.save_results(merged_df, csv_file_path=output.split(".")[0]+"-"+test['name']+".csv") + match.save_results(merged_df, csv_file_path=kwargs["output"].split(".")[0]+"-"+test['name']+".csv") - if hunter_analyze: + if kwargs["hunter_analyze"]: orion_funcs.run_hunter_analyze(merged_df,test)