Commit 39b621a7 authored by Jérome Perrin's avatar Jérome Perrin

tests: make each SavedTestSuite instance use a different logfile

When using SavedTestSuite, the first step is to make testnode run --save for
each instance, by running the test referenced in _saved_test_id class
attributes.

Because log files are defined only by the test name, this was causing the
multiple concurrent runUnitTest executions with --save to all log in the same
file. That file was also reused when actually running this test later.

Override getLogDirectoryPath to use a different folder, one per instance, when
doing the initial --save
parent f5f322a5
...@@ -151,6 +151,11 @@ class SavedTestSuite(ERP5TypeTestSuite): ...@@ -151,6 +151,11 @@ class SavedTestSuite(ERP5TypeTestSuite):
self._portal_id = 'portal_%i' % (random.randint(0, sys.maxint), ) self._portal_id = 'portal_%i' % (random.randint(0, sys.maxint), )
super(SavedTestSuite, self).__init__(*args, **kw) super(SavedTestSuite, self).__init__(*args, **kw)
def getLogDirectoryPath(self, *args, **kw):
if '--save' in args:
args += ('{}_save_{}'.format(args[-1], self.instance), )
return super(SavedTestSuite, self).getLogDirectoryPath(*args, **kw)
def __runUnitTest(self, *args, **kw): def __runUnitTest(self, *args, **kw):
if self.__dict__.has_key("bt5_path"): if self.__dict__.has_key("bt5_path"):
args = ("--bt5_path=%s" % self.bt5_path,) + args args = ("--bt5_path=%s" % self.bt5_path,) + args
......
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