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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Apr 13 07:41:34 CDT 2011


branch "master" has been updated
       via  d9d8f483731bfb3512f5a79c1328f470da3747b0 (commit)
      from  8583ee347123d3df8bff87b7082a8ab4ef687876 (commit)

Summary of changes:
 bamboo/bin/tests.py |   42 +++++++++++++++++++++++-------------------
 1 files changed, 23 insertions(+), 19 deletions(-)


- Log -----------------------------------------------------------------
commit d9d8f483731bfb3512f5a79c1328f470da3747b0
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Apr 13 07:41:30 2011 -0500

    Fixed the boost to junit xml search regex to not search for already converted files. Made the unit tests a command line argument so that they can be turned off for a component known to have unit tests that hang.

diff --git a/bamboo/bin/tests.py b/bamboo/bin/tests.py
index a599118..3fe91e5 100644
--- a/bamboo/bin/tests.py
+++ b/bamboo/bin/tests.py
@@ -24,26 +24,24 @@ import subprocess
 from xml.dom.minidom import Document
 
 class test_asterisk_scf:
-    def __init__(self, component):
+    def __init__(self, component, unittests=None):
         self._component = component
+        self._unittests = unittests
         self._msbuild_path = "/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
         self.__build()
         
-        logger_names = {'logger/server':'logger_server','logger/client':'logger_client'}
-
-        if component == "logger":
-            for comp in logger_names:
-                self.__unit_tests(comp)
-                self.__write_results_xml(logger_names[comp])
-                os.chdir("../../../..")
-                print os.getcwd()
-            os.chdir("build/logger/server")
-        else:
-            print os.getcwd()
-            self.__unit_tests(component)
-            self.__write_results_xml(component)
-
-        self.__convert_boost_to_junit()
+        if self._unittests:
+            logger_names = {'logger/server':'logger_server','logger/client':'logger_client'}
+            if component == "logger":
+                for comp in logger_names:
+                    self.__unit_tests(comp)
+                    self.__write_results_xml(logger_names[comp])
+                    os.chdir("../../../..")
+                os.chdir("build/logger/server")
+            else:
+                self.__unit_tests(component)
+                self.__write_results_xml(component)
+            self.__convert_boost_to_junit()
 
     def __convert_boost_to_junit(self):
         os.chdir("../..")
@@ -51,7 +49,7 @@ class test_asterisk_scf:
         for root, dirs, files in tree:
             if len(files)>0:
                 for f in files:
-                    if re.search(".*?_test-result.xml", f):
+                    if re.match(r"^(?!converted).*test-result.xml", f):
                         os.system("%s /opt/bamboo/boost_to_junit.xsl %s >> converted_%s" % (which("xsltproc"), f, f))
                         os.remove(f)
 
@@ -253,7 +251,13 @@ def main(argv=None):
     try:
         args[1]
     except:
-        errorout("Usage: ./tests.py [component]")
+        errorout("Usage: ./tests.py [component] [unittests]")
+
+    try:
+        args[2]
+        unittests = 'unittests'
+    except:
+        unittests = ''
 
     arch = platform.machine()
     plat = platform.system()
@@ -286,7 +290,7 @@ def main(argv=None):
         update_build_env()        
     else:
         crev = readinfile(".git/refs/heads/master").rstrip('\n')
-        test_asterisk_scf(args[1])
+        test_asterisk_scf(args[1], unittests)
 
     return 0
 

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


-- 
asterisk-scf/release/testsuite.git



More information about the asterisk-scf-commits mailing list