CLOUDSTACK-3075: append module/suite name

If the test doesn't create the account within the testXxx method we miss
the trail of the accountname because the setUpClass() created the
account. Append the module name in advance in such cases to identify the
account that was created in the suite before any tests were executed.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-07-22 12:15:12 +05:30
parent 8a257fb07c
commit 77aa85d257
1 changed files with 9 additions and 2 deletions

View File

@ -110,12 +110,16 @@ class MarvinPlugin(Plugin):
return self.testrunner
def wantClass(self, cls):
if cls.__name__ == 'cloudstackTestCase':
return False
if issubclass(cls, cloudstackTestCase):
return True
return None
def loadTestsFromTestCase(self, cls):
self._injectClients(cls)
if cls.__name__ != 'cloudstackTestCase':
self.testclient.identifier = cls.__name__
self._injectClients(cls)
def setClient(self, client):
if client is not None:
@ -126,11 +130,14 @@ class MarvinPlugin(Plugin):
self.config = config
def beforeTest(self, test):
self.testclient.identifier = test.__str__().split()[0]
testname = test.__str__().split()[0]
self.testclient.identifier = '-'.join([self.testclient.identifier, testname])
def _injectClients(self, test):
testcaselogger = logging.getLogger("testclient.testcase.%s" %
test.__name__)
self.debug_stream. \
setFormatter(logging.
Formatter("%(asctime)s - %(levelname)s - %(name)s" +