From b99ac388ed0a2282371fa7887142678dd7297b06 Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Mon, 27 Aug 2007 22:29:10 +0000
Subject: [PATCH] 1 - runCommand wraps output lines longer than 100 characters 2 - fix in runTestJob: removed copy of results.html in tmp folder 3 - fix in staf-installer.xml removed references to results.html     only rely on my-report.html now 4 - attach my-report.html to the in place of results.html 5 - added knowIssue facility to allow to tag tests failing because of known issues 6 - updated the XSL style sheet to show known issue 7 - added testcase coloring based on status pass/fail/unknown/known 8 - added table of contents title row to make it easier for newcomers to read the     report 9 - added known bugs calls in backends group 10- added known bugs calls in security group 11- added known bugs call in logging group 12- fix in utils for default windows environment variables

---
 opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
index 9a2b0b6..a6ad166 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
@@ -554,6 +554,7 @@
       <sequence>
         <script>
           testcaseStartTime=strftime("%Y%m%d@%H:%M:%S",localtime())
+          issuesList=[]
         </script>
         <call function="'testCase_StartBanner'" />
     </sequence>
@@ -616,7 +617,7 @@
       </call>
       <script>
         class Test:
-          def __init__(self, group, suite, fullname, start, stop, failures, successes):
+          def __init__(self, group, suite, fullname, start, stop, failures, successes, issues):
             self.log=''
             self.group=group
             self.suite=suite
@@ -630,13 +631,18 @@
             else:
               self.name=fullname
             self.duration = 0
-            if failures == 0:
-              if successes == 0:
-                self.result='inconclusive'
+            if len(issues) == 0:
+              if failures == 0:
+                if successes == 0:
+                  self.result='inconclusive'
+                else:
+                  self.result='pass'
               else:
-                self.result='pass'
+                self.result='fail'
             else:
-              self.result='fail'
+              self.result='known'
+            self.issues=issues
+              
             
           def toXML(self):
             xml  = '      &lt;test&gt;\n'
@@ -647,6 +653,10 @@
             xml += '        &lt;stop&gt;%s&lt;/stop&gt;\n'         % self.stop
             xml += '        &lt;result&gt;%s&lt;/result&gt;\n'     % self.result
             xml += '        &lt;duration&gt;%d&lt;/duration&gt;\n' % self.duration
+            xml += '        &lt;issues&gt;\n'
+            for issue in self.issues:
+              xml += '          &lt;issue&gt;%s&lt;/issue&gt;\n' % issue
+            xml += '        &lt;/issues&gt;\n'
             xml += '        &lt;log&gt;\n&lt;![CDATA['
             xml += '%s' % self.log
             xml += '        ]]&gt;&lt;/log&gt;\n'
@@ -654,15 +664,18 @@
             return xml
             
           def appendLog(self, log):
-            #log=log.replace('&lt;','')
-            #log=log.replace('&gt;','')
-            #log=log.replace('&amp;','&amp;amp;')
-            self.log +='%s\n' % log
+            _leftPadding=''
+            while len(log)>100:
+              _logChunk=log[:100]
+              log=log[100:]
+              self.log+='%s%s\n' % (_leftPadding,_logChunk)
+              _leftPadding='...    '
+            self.log += '%s%s\n' % (_leftPadding,log)
             
           def getName(self):
             return self.name
          
-        thisTest = Test(CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentTestcase, testcaseStartTime,testcaseEndTime,numFail,numPass)
+        thisTest = Test(CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentTestcase, testcaseStartTime,testcaseEndTime,numFail,numPass,issuesList)
             
         doLog = False
         testlog=open('%s/tests-log.xml' % TMPDIR,'a')
@@ -1243,8 +1256,7 @@
         </function-arg-description>
       </function-arg-def>
       <function-arg-def name="env" 
-                        type="optional" 
-                        default="['PATH=/bin:/usr/bin:%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]">
+                        type="optional">
         <function-arg-description>
           the environment variables to set. The default set here should just
           work for OpenDS commands
@@ -1286,6 +1298,12 @@
         import java.util.Date
         random.seed(java.util.Date().getTime())
         _id = '%s#%d' % (strftime('%Y-%m-%d %H:%M:%S',localtime()),random.randint(0,999))
+        
+        if not env:
+          if isWindows:
+            env=['PATH=C:\Windows;C:\Windows\system32;%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          else:
+            env=['PATH=/bin:/usr/bin:%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
       </script>
       <message>
         '%s: Running command:\n %s %s\nlocation: %s\nenv: %s\nworkdir: %s' % (_id,command,arguments,location,env,path)

--
Gitblit v1.10.0