@@ -64,13 +64,6 @@ def parse_args(args: list):
64
64
parser .add_argument (
65
65
"-l" , "--logs" , dest = "logs_path" , default = "output" , help = "-l /path/to/logs"
66
66
)
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
- )
74
67
75
68
return parser .parse_args (args )
76
69
@@ -112,13 +105,14 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
112
105
List[dict]: list of expanded tests
113
106
"""
114
107
tests_list = {}
108
+ disable_masking = False
115
109
for test in tests_yaml :
116
110
if re .search (r"\$\{([A-Za-z0-9_]*)\:\-(.*?)\}" , test ):
117
111
if args .actions_path :
118
112
with open (args .actions_path , "r" , encoding = "utf-8" ) as actions_file :
119
113
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
122
116
if isinstance (dval , list ) and key != "experimental" :
123
117
for _ , val in enumerate (dval ):
124
118
os .environ [key ] = str (val )
@@ -141,7 +135,7 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
141
135
logging .error ("Command not found for %s" , test )
142
136
sys .exit (1 )
143
137
144
- return tests_list
138
+ return tests_list , disable_masking
145
139
146
140
147
141
if __name__ == "__main__" :
@@ -173,15 +167,15 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
173
167
except YAMLError as yaml_exc :
174
168
logging .error (yaml_exc )
175
169
sys .exit (1 )
176
- tests_list = get_test_list (args , tests_json )
170
+ tests_list , disable_masking = get_test_list (args , tests_json )
177
171
logging .debug ("Creating Test Objects from: %s" , tests_list )
178
172
# For each test, create a Test Object with the test name is the key of the test in yaml
179
173
tests = [Test (name = test , ** tests_list [test ]) for test in tests_list ]
180
174
logging .info ("Setup Completed - Running Tests" )
181
175
summary = []
182
176
ERROR = False
183
177
for idx , test in enumerate (tests ):
184
- if not args . mask :
178
+ if disable_masking :
185
179
test .mask = []
186
180
# Set Context to test-runner.log
187
181
set_log_filename (logging .getLogger (), "test-runner" , args .logs_path )
0 commit comments