@@ -21,9 +21,9 @@ def __init__(self, url, environment):
21
21
'.gitignore'
22
22
]
23
23
24
- def run (self , operation , libraries = None ):
24
+ def run (self , operation , test = None , libraries = None ):
25
25
if operation == 'common' :
26
- self .common ()
26
+ self .common (test )
27
27
elif operation == 'libraries' :
28
28
self .libraries ()
29
29
elif operation == 'examples' :
@@ -79,8 +79,11 @@ def send_mail_with_logs(self, identifier):
79
79
def create_command (self , test_directory , * extra_arguments ):
80
80
return ['tox' , 'tests/' + test_directory , '--' , '--url={}' .format (TARGETS [self .url ])] + list (extra_arguments )
81
81
82
- def common (self , identifier = 'common' ):
83
- command = self .create_command ('common' , '--plugin' )
82
+ def common (self , test , identifier = 'common' ):
83
+ test_directory = 'common'
84
+ if test :
85
+ test_directory = os .path .join (test_directory , test )
86
+ command = self .create_command (test_directory , '--plugin' )
84
87
retval = self .run_command (command )
85
88
if retval != 0 :
86
89
self .send_mail_no_logs (identifier )
@@ -189,9 +192,12 @@ def main():
189
192
parser .add_argument ('--config' ,
190
193
default = 'config.cfg' ,
191
194
help = 'Configuration file to load (default: config.cfg).' )
195
+ parser .add_argument ('--test' ,
196
+ default = None ,
197
+ help = 'Common test to run when using operation: common (default: all)' )
192
198
parser .add_argument ('--libraries' ,
193
199
default = None ,
194
- help = 'Libraries to test (comma separated machine names) when using option : target' )
200
+ help = 'Libraries to test (comma separated machine names) when using operation : target' )
195
201
parser .add_argument ('--saucelabs' ,
196
202
action = 'store_true' ,
197
203
default = False ,
@@ -214,6 +220,8 @@ def main():
214
220
parser .print_help ()
215
221
sys .exit ()
216
222
223
+ test = args .test
224
+
217
225
libraries = args .libraries
218
226
if operation == 'target' and not libraries :
219
227
print ('No target libraries specified!\n ' )
@@ -258,7 +266,7 @@ def main():
258
266
259
267
# Run tests
260
268
tests = Tests (target , config )
261
- tests .run (operation , libraries = libraries )
269
+ tests .run (operation , test = test , libraries = libraries )
262
270
263
271
if __name__ == '__main__' :
264
272
main ()
0 commit comments