@@ -28,7 +28,7 @@ def cli():
28
28
@click .option ("--output" , default = "output.csv" , help = "Path to save the output csv file" )
29
29
@click .option ("--debug" , is_flag = True , help = "log level " )
30
30
@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 ):
32
32
"""Orion is the cli tool to detect regressions over the runs
33
33
34
34
Args:
@@ -39,10 +39,11 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
39
39
output (str): path to the output csv file
40
40
hunter_analyze (bool): turns on hunter analysis of gathered uuid(s) data
41
41
"""
42
- level = logging .DEBUG if debug else logging .INFO
42
+
43
+ level = logging .DEBUG if kwargs ["debug" ] else logging .INFO
43
44
logger = logging .getLogger ("Orion" )
44
45
logger = orion_funcs .set_logging (level , logger )
45
- data = orion_funcs .load_config (config ,logger )
46
+ data = orion_funcs .load_config (kwargs [ " config" ] ,logger )
46
47
ES_URL = None
47
48
48
49
if "ES_SERVER" in data .keys ():
@@ -55,8 +56,10 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
55
56
sys .exit (1 )
56
57
57
58
for test in data ["tests" ]:
59
+ uuid = kwargs ["uuid" ]
60
+ baseline = kwargs ["baseline" ]
58
61
match = Matcher (index = "perf_scale_ci" , level = level , ES_URL = ES_URL )
59
- if uuid == "" :
62
+ if kwargs [ " uuid" ] == "" :
60
63
metadata = orion_funcs .get_metadata (test , logger )
61
64
else :
62
65
metadata = orion_funcs .get_uuid_metadata (uuid ,match ,logger )
@@ -92,9 +95,9 @@ def orion(uuid, baseline, config, debug, output, hunter_analyze):
92
95
lambda left , right : pd .merge (left , right , on = "uuid" , how = "inner" ),
93
96
dataframe_list ,
94
97
)
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" )
96
99
97
- if hunter_analyze :
100
+ if kwargs [ " hunter_analyze" ] :
98
101
orion_funcs .run_hunter_analyze (merged_df ,test )
99
102
100
103
0 commit comments