Commit 34601253 authored by Jérome Perrin's avatar Jérome Perrin

testnode: pass --log_directory to runTestSuite

This way, test suite can place some log files in this directory, so that
we can inspect when tests are running.
parent 5b7c94b9
......@@ -75,9 +75,9 @@ class NodeTestSuite(SlapOSInstance):
while 1:
log_folder_name = '%s-%s' % (self.reference,
''.join(random.choice(alphabets) for i in range(10)))
log_folder_path = os.path.join(self.log_directory, log_folder_name)
self.log_folder_path = os.path.join(self.log_directory, log_folder_name)
try:
os.makedirs(log_folder_path)
os.makedirs(self.log_folder_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
......@@ -85,8 +85,8 @@ class NodeTestSuite(SlapOSInstance):
break
# XXX copy the whole content of the log viewer app
for fname in glob.glob(os.path.join(os.path.dirname(__file__), 'js-logtail', '*')):
shutil.copy(fname, log_folder_path)
self.suite_log_path = os.path.join(log_folder_path, 'suite.log')
shutil.copy(fname, self.log_folder_path)
self.suite_log_path = os.path.join(self.log_folder_path, 'suite.log')
return self.suite_log_path, log_folder_name
@property
......
......@@ -165,6 +165,7 @@ class UnitTestRunner(object):
node_test_suite.working_directory,
True
).shared_part_list)),
('--log_directory', lambda: node_test_suite.log_folder_path),
):
if option in supported_parameter_set:
invocation_list += option, value()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment