[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Jun 3 21:08:45 CDT 2011


branch "review" has been updated
       via  6e01aa75b336219cde43f84debc30edad547ed75 (commit)
      from  c53af7266375b9f4b690ceaa1dd0aea0ad6fe97d (commit)

Summary of changes:
 lib/python/TestSuite.py |    3 ---
 remote.py               |    6 +++---
 testsuite.py            |    5 ++++-
 3 files changed, 7 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 6e01aa75b336219cde43f84debc30edad547ed75
Author: Darren Sessions <dsessions at digium.com>
Date:   Fri Jun 3 21:08:40 2011 -0500

    removed the system call tar commands from the utility base class used by the plugins as it has been replaced by the native python tar module. fixed a the artifact path in the remote script as it was missing the tmp prefix. also fixed the logArtifactFile file handler open as it was missing the "w". added the test category, name, and subtest name to the global variable so that plugins can use that information when processing artifacts for bamboo.

diff --git a/lib/python/TestSuite.py b/lib/python/TestSuite.py
index 145db9b..2d328b1 100644
--- a/lib/python/TestSuite.py
+++ b/lib/python/TestSuite.py
@@ -46,9 +46,6 @@ class utils():
         tar = tarfile.open('%s/tmp/%s' % (cwd, fn), "r:gz")
         tar.extractall(path="%s" % installPath)
         tar.close()
-        #results = self.execute(['tar', '-xvf', '%s/tmp/%s' % (cwd, fn), '-C', '%s' % installPath], cwd, True)
-        #if results['success'] == False:
-        #    return results
         return {'success':'True'}
 
     def rpc(self, host):
diff --git a/remote.py b/remote.py
index 8caaed0..e43fc2b 100755
--- a/remote.py
+++ b/remote.py
@@ -33,8 +33,8 @@ class RemoteManagement(object):
     def __init__(self):
         if not os.path.exists('%s/tmp' % cwd):
             os.makedirs('%s/tmp' % cwd)
-        if not os.path.exists('%s/artifacts' % cwd):
-            os.makedirs('%s/artifacts' % cwd)
+        if not os.path.exists('%s/tmp/artifacts' % cwd):
+            os.makedirs('%s/tmp/artifacts' % cwd)
 
     def listProcesses(self):
         list = {}
@@ -62,7 +62,7 @@ class RemoteManagement(object):
         execCmd[0] = self._which(execCmd[0])
 
         try:
-            logArtifactFile = open('%s/tmp/artifacts/%s_%s.log' % (cwd, plugin, label))
+            logArtifactFile = open('%s/tmp/artifacts/%s_%s.log' % (cwd, plugin, label), 'w')
         except:
             return {'success':False,'msg':"Unable to open '%s/tmp/artifacts/%s_%s.log' for writing." % (cwd, plugin, label)}
 
diff --git a/testsuite.py b/testsuite.py
index 53d5a12..562d6a4 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -43,7 +43,7 @@ class __main__:
         except:
             pass
 
-        self.globalVars = {'cwd':cwd, 'hostname':hostname}
+        self.globalVars = {'cwd':cwd, 'hostname':hostname, 'testInfo':{}}
         self.yamlData = yaml_parser.testcases().returnData
         self.testsuite()
 
@@ -56,14 +56,17 @@ class __main__:
 
         for list in self.yamlData:
             for testCategory in list:
+                self.globalVars['testInfo']['testCategory'] = testCategory
                 x, categoryElement = xml().addTestSuite(x, testCategory)
                 print >> sys.stderr, "\n Starting '%s' tests . . \n ---------------------------------" % testCategory
             
                 for testData in list[testCategory]:
+                    self.globalVars['testInfo']['testCase'] = testData['name']
                     categoryElement, testElement = xml().addTestSuite(categoryElement, testData['name'])
                     print >> sys.stderr, ' |- Testcase "%s" ' % testData['name']
                     for subTestCase in testData['tests']:
                         for testName in subTestCase:
+                            self.globalVars['testInfo']['testName'] = testName
                             testElement, subTestElement = xml().addTestCase(testElement, testName)
                             if subTestCase[testName]:
                                 success = True

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list