@@ -64,13 +64,6 @@ def parse_args(args: list):
6464 parser .add_argument (
6565 "-l" , "--logs" , dest = "logs_path" , default = "output" , help = "-l /path/to/logs"
6666 )
67- parser .add_argument (
68- "-m" ,
69- "--mask" ,
70- dest = "mask" ,
71- action = "store_true" ,
72- help = "Enable mask parameter for sensitive information in logs" ,
73- )
7467
7568 return parser .parse_args (args )
7669
@@ -112,13 +105,14 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
112105 List[dict]: list of expanded tests
113106 """
114107 tests_list = {}
108+ disable_masking = False
115109 for test in tests_yaml :
116110 if re .search (r"\$\{([A-Za-z0-9_]*)\:\-(.*?)\}" , test ):
117111 if args .actions_path :
118112 with open (args .actions_path , "r" , encoding = "utf-8" ) as actions_file :
119113 for key , dval in json .load (actions_file ).items ():
120- if key == "mask" :
121- [ args . mask ] = dval
114+ if key == "mask" and dval == [ False ] :
115+ disable_masking = True
122116 if isinstance (dval , list ) and key != "experimental" :
123117 for _ , val in enumerate (dval ):
124118 os .environ [key ] = str (val )
@@ -141,7 +135,7 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
141135 logging .error ("Command not found for %s" , test )
142136 sys .exit (1 )
143137
144- return tests_list
138+ return tests_list , disable_masking
145139
146140
147141if __name__ == "__main__" :
@@ -173,15 +167,15 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
173167 except YAMLError as yaml_exc :
174168 logging .error (yaml_exc )
175169 sys .exit (1 )
176- tests_list = get_test_list (args , tests_json )
170+ tests_list , disable_masking = get_test_list (args , tests_json )
177171 logging .debug ("Creating Test Objects from: %s" , tests_list )
178172 # For each test, create a Test Object with the test name is the key of the test in yaml
179173 tests = [Test (name = test , ** tests_list [test ]) for test in tests_list ]
180174 logging .info ("Setup Completed - Running Tests" )
181175 summary = []
182176 ERROR = False
183177 for idx , test in enumerate (tests ):
184- if not args . mask :
178+ if disable_masking :
185179 test .mask = []
186180 # Set Context to test-runner.log
187181 set_log_filename (logging .getLogger (), "test-runner" , args .logs_path )
0 commit comments