Updated Branches:
  refs/heads/4.2 8a257fb07 -> 77aa85d25

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 <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/77aa85d2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/77aa85d2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/77aa85d2

Branch: refs/heads/4.2
Commit: 77aa85d257fea40902c2475008f4b361e69e662b
Parents: 8a257fb
Author: Prasanna Santhanam <[email protected]>
Authored: Mon Jul 22 12:15:12 2013 +0530
Committer: Prasanna Santhanam <[email protected]>
Committed: Mon Jul 22 12:20:36 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/marvinPlugin.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77aa85d2/tools/marvin/marvin/marvinPlugin.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/marvinPlugin.py 
b/tools/marvin/marvin/marvinPlugin.py
index a0ec3d5..19930d4 100644
--- a/tools/marvin/marvin/marvinPlugin.py
+++ b/tools/marvin/marvin/marvinPlugin.py
@@ -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" +

Reply via email to