Skip to content

Commit

Permalink
adding kwargs as orion variable
Browse files Browse the repository at this point in the history
  • Loading branch information
paigerube14 committed Mar 6, 2024
1 parent f74bea2 commit 12f19b0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions orion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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():
Expand All @@ -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)
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit 12f19b0

Please sign in to comment.