[asterisk-scf-commits] asterisk-scf/release/bamboo.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Jul 23 09:53:56 CDT 2012


branch "master" has been updated
       via  1b0e58ec1be935991c45a23a8fb4a4f1bd92f931 (commit)
      from  13ceb90905277a0b4b63786c7642b7620fc23d02 (commit)

Summary of changes:
 bin/tests.py |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 1b0e58ec1be935991c45a23a8fb4a4f1bd92f931
Author: Darren Sessions <dsessions at digium.com>
Date:   Mon Jul 23 09:53:51 2012 -0500

    Updated the testing pythong script to account for a name change in the boost xml test output files. Added support in the system call function to ignore return codes so that when specific things like unit tests fail, instead of failing the whole bamboo run, it continues so that the boost xml files can be properly converted to junit and parsed by bamboo.

diff --git a/bin/tests.py b/bin/tests.py
index 6909c97..5c29749 100644
--- a/bin/tests.py
+++ b/bin/tests.py
@@ -33,7 +33,7 @@ class test_asterisk_scf:
         
         if self._unittests:
             self.__unit_tests(component)
-            self.__write_results_xml(component)
+            #self.__write_results_xml(component)
             self.__convert_boost_to_junit()
 
     def __convert_boost_to_junit(self):
@@ -42,9 +42,12 @@ class test_asterisk_scf:
         for root, dirs, files in tree:
             if len(files)>0:
                 for f in files:
-                    if re.match(r"^(?!converted).*result.xml", f):
+                    if re.match(r"^(?!converted).*.xml", f):
+			print >> sys.stderr, "%s /opt/bamboo/boost_to_junit.xsl %s >> ../converted_%s" % (which("xsltproc"), f, f)
                         os.system("%s /opt/bamboo/boost_to_junit.xsl %s >> ../converted_%s" % (which("xsltproc"), f, f))
                         os.remove(f)
+                    else:
+			print >> sys.stderr, "Skipped %s", f
 
     def __unit_tests(self, component):
         self.total_failures = 0
@@ -59,7 +62,7 @@ class test_asterisk_scf:
 
         os.chdir("./build/%s" % component)
         start_time = time.time()
-        self.passed = uni_make(None, None, 'test')
+        self.passed = uni_make(None, None, 'test', True)
         self.total_time = time.time() - start_time
 
         if self.passed != 0:
@@ -148,12 +151,13 @@ class test_asterisk_scf:
             system_call(["/bin/bash","./cmake/init-cmake.sh"])
             system_call(["/usr/bin/cmake","--build","./build"])
 
-def system_call(cmd):
+def system_call(cmd, ignore_res=False):
     if os.path.exists(cmd[0]) and os.access(cmd[0], os.X_OK):
         p = subprocess.Popen(cmd)
         p.wait()
-        if p.returncode != 0:
-            errorout("Error detected during system call! '%s' returned with exit code: %d" % (cmd[0], p.returncode))
+	if ignore_res == False:
+       	    if p.returncode != 0:
+                errorout("Error detected during system call! '%s' returned with exit code: %d" % (cmd[0], p.returncode))
         return p.returncode
     else:
         errorout("FAILED TO EXECUTE %s, it must exist and be executable" % cmd)
@@ -185,26 +189,26 @@ def test_slice_plugins():
     uni_make(None, None, 'install')
     sys.exit(0)
 
-def uni_make(makefile=None,makeargs=None,makesubtype=None):
+def uni_make(makefile=None,makeargs=None,makesubtype=None,ignore_res=False):
     sc = []
     if plat == "Windows":
         if makefile:
             sc = ["%s" % make,"-F","Makefile.mak"]
         else:
             sc = ["%s" % make]
-        rc = system_call(sc)
+        rc = system_call(sc, ignore_res)
     elif plat == "SunOS":
         if makeargs:
             sc = ["%s" % make,"MCPP_HOME=/usr/local EXPAT_HOME=/usr/sfw OPENSSL_HOME=/usr/sfw DB_HOME=/usr/local/BerkeleyDB.4.8"]
         else:
             sc = ["%s" % make]
-        rc = system_call(sc)
+        rc = system_call(sc, ignore_res)
     else:
         sc = ["%s" % make] 
-        rc = system_call(sc)
+        rc = system_call(sc, ignore_res)
     if makesubtype and rc == 0:
         sc.append(makesubtype)
-        rc = system_call(sc)
+        rc = system_call(sc, ignore_res)
     return rc
 
 def readinfile(file):

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


-- 
asterisk-scf/release/bamboo.git



More information about the asterisk-scf-commits mailing list