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
| | |
| | | if isWindows: |
| | | fileExt='.bat' |
| | | fileFolder='bat' |
| | | pathSeparator=';' |
| | | else: |
| | | fileExt='' |
| | | fileFolder='bin' |
| | | pathSeparator=':' |
| | | </script> |
| | | |
| | | <!-- Set the signal handlers --> |
| | | <!-- Set the signal handlers --> |
| | | <call function="'signals'"/> |
| | | |
| | | <!-- Initialize any global variables --> |
| | |
| | | <sequence> |
| | | <script> |
| | | testcaseStartTime=strftime("%Y%m%d@%H:%M:%S",localtime()) |
| | | issuesList=[] |
| | | </script> |
| | | <call function="'testCase_StartBanner'" /> |
| | | </sequence> |
| | |
| | | </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 |
| | |
| | | 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 = ' <test>\n' |
| | |
| | | xml += ' <stop>%s</stop>\n' % self.stop |
| | | xml += ' <result>%s</result>\n' % self.result |
| | | xml += ' <duration>%d</duration>\n' % self.duration |
| | | xml += ' <issues>\n' |
| | | for issue in self.issues: |
| | | xml += ' <issue>%s</issue>\n' % issue |
| | | xml += ' </issues>\n' |
| | | xml += ' <log>\n<![CDATA[' |
| | | xml += '%s' % self.log |
| | | xml += ' ]]></log>\n' |
| | |
| | | return xml |
| | | |
| | | def appendLog(self, log): |
| | | #log=log.replace('<','') |
| | | #log=log.replace('>','') |
| | | #log=log.replace('&','&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') |
| | |
| | | </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 |
| | |
| | | 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) |
| | |
| | | |
| | | <!-- table of contents --> |
| | | <center><h2>Table of Contents</h2></center> |
| | | <table width="100%"> |
| | | <tr> |
| | | <td>Description</td> |
| | | <td width="5%">Success Rate</td> |
| | | <td width="5%">Pass</td> |
| | | <td width="5%">Fail</td> |
| | | <td width="5%">Inc.</td> |
| | | <td width="5%">Cov.</td> |
| | | </tr> |
| | | </table> |
| | | <ul class="myCollapsible"> |
| | | <xsl:for-each select="$tests"> |
| | | <xsl:sort select="group" order="ascending"/> |
| | |
| | | </tr> |
| | | </table> |
| | | <ul> |
| | | <xsl:for-each select="$tests[group=$group][suite=$suite][result='fail' or result='inconclusive']"> |
| | | <xsl:for-each select="$tests[group=$group][suite=$suite][result='fail' or result='inconclusive' or result='known']"> |
| | | <xsl:variable name="name" select="name"/> |
| | | <li> |
| | | <a> |
| | | <xsl:attribute name="href"> |
| | | <xsl:value-of select="concat(concat(concat(concat(concat('#',$group),'-'),$suite),'-'),$name)"/> |
| | | </xsl:attribute> |
| | | <xsl:value-of select="name"/> |
| | | </a> |
| | | <table> |
| | | <tr> |
| | | <xsl:attribute name="class"> |
| | | <xsl:choose> |
| | | <xsl:when test="result='fail'"> |
| | | <xsl:value-of select="'unacceptable'" /> |
| | | </xsl:when> |
| | | <xsl:when test="result='known'"> |
| | | <xsl:value-of select="'acceptable'" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:value-of select="'perfect'" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:attribute> |
| | | <td> |
| | | <a> |
| | | <xsl:attribute name="href"> |
| | | <xsl:value-of select="concat(concat(concat(concat(concat('#',$group),'-'),$suite),'-'),$name)"/> |
| | | </xsl:attribute> |
| | | <xsl:value-of select="name"/> |
| | | </a> |
| | | </td> |
| | | <td width="10%"> |
| | | <xsl:for-each select="./issues"> |
| | | <xsl:variable name="issue" select="issue" /> |
| | | <a target="issue"> |
| | | <xsl:attribute name="href"> |
| | | <xsl:value-of select="concat('https://opends.dev.java.net/issues/show_bug.cgi?id=',$issue)" /> |
| | | </xsl:attribute> |
| | | <xsl:value-of select="$issue" /> |
| | | </a><br /> |
| | | </xsl:for-each> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <ul> |
| | | <li> |
| | | <pre><xsl:value-of select="log" /></pre> |
| | |
| | | </fileset> |
| | | </copy> |
| | | <echo>You may access the tests report at</echo> |
| | | <echo>${tests.run.dir}/${tests.run.time}/report/results.html</echo> |
| | | <echo>${tests.run.dir}/${tests.run.time}/report/my-report.html</echo> |
| | | <antcall target="send-mail"/> |
| | | </target> |
| | | |
| | |
| | | |
| | | <target name="send-mail-prepare"> |
| | | <condition property="test.successful"> |
| | | <available file="${staf.tmp.dir}/results.html"/> |
| | | <available file="${staf.tmp.dir}/my-report.html"/> |
| | | </condition> |
| | | <condition property="email.send"> |
| | | <equals arg1="${email.enabled}" arg2="y" |
| | |
| | | <target name="send-mail-get-percentage" depends="send-mail-prepare" if="test.successful"> |
| | | <echo>test report found.Proceeding...</echo> |
| | | <delete file="${staf.tmp.dir}/percentage.properties"/> |
| | | <copy file="${staf.tmp.dir}/results.html" tofile="${staf.tmp.dir}/percentage.properties"> |
| | | <copy file="${staf.tmp.dir}/my-report.html" tofile="${staf.tmp.dir}/percentage.properties"> |
| | | <filterchain> |
| | | <linecontains> |
| | | <contains value='font size="+2'/> |
| | |
| | | </or> |
| | | </condition> |
| | | <condition property="email.file" |
| | | value="${staf.tmp.dir}/results.html" |
| | | value="${staf.tmp.dir}/my-report.html" |
| | | else="staf-installer/failure.html"> |
| | | <available file="${staf.tmp.dir}/results.html"/> |
| | | <available file="${staf.tmp.dir}/my-report.html"/> |
| | | </condition> |
| | | <condition property="email.subject" |
| | | value="FT - Run - ${daily.date} - ${os.name} - ${os.arch} - ${test.percentage}%" |
| | | else="FT - Failed -${daily.date} - ${os.name} - ${os.arch}"> |
| | | <available file="${staf.tmp.dir}/results.html"/> |
| | | <available file="${staf.tmp.dir}/my-report.html"/> |
| | | </condition> |
| | | <antcall target="send-mail-noauth"/> |
| | | <antcall target="send-mail-withauth"/> |
| | |
| | | <java jar="${staf.install.dir}/services/stax/STAXDoc.jar" fork="true"> |
| | | <arg value="-d"/> |
| | | <arg value="${staf.home}/doc"/> |
| | | <arg value="testcases"/> |
| | | <!--<arg value="testcases"/> |
| | | <arg value="testcases/aci"/> |
| | | <arg value="testcases/backends"/> |
| | | <arg value="testcases/core"/> |
| | |
| | | <arg value="testcases/security/pwd_storage"/> |
| | | <arg value="testcases/security/pwd_validator"/> |
| | | <arg value="testcases/security/sasl"/> |
| | | <arg value="testcases/security/startTLS"/> |
| | | <arg value="testcases/security/startTLS"/>--> |
| | | <arg value="shared/functions"/> |
| | | <arg value="testcases/sample" /> |
| | | </java> |
| | | </target> |
| | | |
| | |
| | | 'dsPath' : '%s/server2/%s' % (DIRECTORY_INSTANCE_DIR, OPENDSNAME) |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | knownIssue(2173) |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult |
| | |
| | | #@TestResult |
| | | --> |
| | | |
| | | <!-- Not clear how to create a second backend |
| | | <!-- Not clear how to create a second backend |
| | | <testcase name="getTestCaseName('LDIF Non Default')"> |
| | | |
| | | <sequence> |
| | |
| | | 'dsBackEnd' : 'userRoot' |
| | | } |
| | | </call> |
| | | |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | <message log="1" level="'Error'"> |
| | | 'Error: Known bug. Issue 839: Encrypted LDIF export is not implemented' |
| | | </message> |
| | | <script> |
| | | knownIssue(839) |
| | | </script> |
| | | |
| | | <call function="'testCase_Postamble'"/> |
| | | |
| | |
| | | </script> |
| | | |
| | | <call function="'testGroup_Preamble'" /> |
| | | <iterate var="_test" in="['setup','rotation','properties','writer','retention','cleanup']" > |
| | | <!--<iterate var="_test" in="['setup','rotation','properties','writer','retention','cleanup']" >--> |
| | | <iterate var="_test" in="['setup','properties','cleanup']" > |
| | | <sequence> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/logging/logging_%s.xml' % (TESTS_DIR,_test)"/> |
| | |
| | | </message> |
| | | |
| | | <!-- DESACTRIVATED : bug 2107]--> |
| | | <call function="'testFailed'"/> |
| | | <!--<call function="'testFailed'"/>--> |
| | | <script> |
| | | knownIssue(2107) |
| | | bug=2107 |
| | | </script> |
| | | <if expr="bug == 0"> |
| | |
| | | # this function return a well-formatted testcase name |
| | | def getTestCaseName(name): |
| | | return '%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],name) |
| | | |
| | | # this functions adds a known issue to a testcase's known issues list |
| | | issuesList=[] |
| | | def knownIssue(issue): |
| | | issuesList.append(issue) |
| | | |
| | | class functionToRun: |
| | | def __init__(self, name): |
| | |
| | | </if> |
| | | </sequence> |
| | | </if> |
| | | |
| | | <!-- fixMe: Copy the html results file to TMPDIR for Hudson --> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : htmlfile, |
| | | 'destfile' : '%s/results.html' % TMPDIR |
| | | } |
| | | </call> |
| | | </sequence> |
| | | |
| | | </function> |
| | |
| | | 'optionsString' : '--set enabled:false' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | knownIssue(2046) |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | 'attributeValue' : 'false' , |
| | | 'modifyType' : 'set' } |
| | | </call> |
| | | |
| | | <script> |
| | | knownIssue(2081) |
| | | </script> |
| | | <call function="'testCase_Postamble'"/> |
| | | |
| | | </sequence> |
| | |
| | | 'newAttributeValue' : 'sbbad' , |
| | | 'changetype' : 'replace' } |
| | | </call> |
| | | <script> |
| | | knownIssue(2081) |
| | | </script> |
| | | <!-- Uncomment when Issue 2081 is resolved. |
| | | <message> |
| | | 'Security: Pwd Validator: Dictionary: user binding with valid password' |