Skip to content

Commit 12f19b0

Browse files
committed
adding kwargs as orion variable
1 parent f74bea2 commit 12f19b0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

orion.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def cli():
2828
@click.option("--output", default="output.csv", help="Path to save the output csv file")
2929
@click.option("--debug", is_flag=True, help="log level ")
3030
@click.option("--hunter-analyze",is_flag=True, help="run hunter analyze")
31-
def orion(uuid, baseline, config, debug, output, hunter_analyze):
31+
def orion(**kwargs):
3232
"""Orion is the cli tool to detect regressions over the runs
3333
3434
Args:
@@ -39,10 +39,11 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
3939
output (str): path to the output csv file
4040
hunter_analyze (bool): turns on hunter analysis of gathered uuid(s) data
4141
"""
42-
level = logging.DEBUG if debug else logging.INFO
42+
43+
level = logging.DEBUG if kwargs["debug"] else logging.INFO
4344
logger = logging.getLogger("Orion")
4445
logger = orion_funcs.set_logging(level, logger)
45-
data = orion_funcs.load_config(config,logger)
46+
data = orion_funcs.load_config(kwargs["config"],logger)
4647
ES_URL=None
4748

4849
if "ES_SERVER" in data.keys():
@@ -55,8 +56,10 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
5556
sys.exit(1)
5657

5758
for test in data["tests"]:
59+
uuid = kwargs["uuid"]
60+
baseline = kwargs["baseline"]
5861
match = Matcher(index="perf_scale_ci", level=level, ES_URL=ES_URL)
59-
if uuid == "":
62+
if kwargs["uuid"] == "":
6063
metadata = orion_funcs.get_metadata(test, logger)
6164
else:
6265
metadata = orion_funcs.get_uuid_metadata(uuid,match,logger)
@@ -92,9 +95,9 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
9295
lambda left, right: pd.merge(left, right, on="uuid", how="inner"),
9396
dataframe_list,
9497
)
95-
match.save_results(merged_df, csv_file_path=output.split(".")[0]+"-"+test['name']+".csv")
98+
match.save_results(merged_df, csv_file_path=kwargs["output"].split(".")[0]+"-"+test['name']+".csv")
9699

97-
if hunter_analyze:
100+
if kwargs["hunter_analyze"]:
98101
orion_funcs.run_hunter_analyze(merged_df,test)
99102

100103

0 commit comments

Comments
 (0)