From 5fdbb2eda024be9aa5ab40bb23d7cf25c3e8a519 Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Fri, 04 Jan 2008 11:22:05 +0000
Subject: [PATCH] test report group and test suite view
---
opends/tests/functional-tests/testcases/runTestJob.xml | 86 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 77 insertions(+), 9 deletions(-)
diff --git a/opends/tests/functional-tests/testcases/runTestJob.xml b/opends/tests/functional-tests/testcases/runTestJob.xml
index 63666e1..0260a54 100644
--- a/opends/tests/functional-tests/testcases/runTestJob.xml
+++ b/opends/tests/functional-tests/testcases/runTestJob.xml
@@ -36,10 +36,6 @@
STAXLogMessage = 1
</script>
- <script>
- import os
- </script>
-
<if expr="not STAXJobScriptFiles">
<sequence>
<message>'No script file (config.py) is specified. Unable to run the tests.'</message>
@@ -49,7 +45,7 @@
<!-- Load in the local shared python objects -->
<script>
- import sys
+ import sys,os
sys.path.append("%s/shared/python" % TESTS_ROOT )
from common import *
</script>
@@ -73,6 +69,15 @@
ServerJVMString='Unknown JVM'
except NameError,details:
ServerJVMString='Unknown JVM'
+
+ try:
+ if LOGS_URI:
+ logsURI=LOGS_URI
+ else:
+ logsURI=''
+ except NameError,details:
+ logsURI=''
+
</script>
<job name="'Job: %s %s' % (STAF_REMOTE_HOSTNAME,ServerOsString) " monitor="1" clearlogs="'Enabled'" logtcstartstop="'Enabled'">
@@ -419,6 +424,9 @@
xmlfh.write(' <tests-dir>\n')
xmlfh.write(' %s\n' % logsDir)
xmlfh.write(' </tests-dir>\n')
+ xmlfh.write(' <tests-url>\n')
+ xmlfh.write(' %s\n' % logsURI)
+ xmlfh.write(' </tests-url>\n')
xmlfh.write(' </identification>\n')
xmlfh.write(' <results>\n')
</script>
@@ -513,7 +521,45 @@
_message='Unable to generate standard test report %s.' % details
</script>
<message>_message</message>
-
+
+ <!-- Generate the test report by test groups-->
+ <script>
+ _message='Generated groups test report.'
+ xslfile= '%s/xsl/gen-groups-report.xsl' % TESTS_SHARED_DIR
+ htmlfile= '%s/groups.html' % logsReportDir
+ groupsReport=report_generation()
+
+ try:
+ groupsReport.transformReport(xslfile,xmlfile,htmlfile)
+ except IOError,details:
+ _message='Unable to generate groups test report %s.' % details
+ </script>
+ <message>_message</message>
+
+ <!-- Generate the test report by test suites -->
+ <script>
+ _message='Generated suites test reports.'
+ testGroupDirsList=os.listdir(logsTestsDir)
+ for testGroupName in testGroupDirsList:
+
+ groupDir='%s/%s' % (logsTestsDir,testGroupName)
+
+ if os.path.isdir(groupDir):
+
+ xmlfile='%s/results.xml' % logsReportDir
+ htmlfile='%s/%s.html' % (groupDir,testGroupName)
+ xslfile= '%s/xsl/gen-suites-report.xsl' % TESTS_SHARED_DIR
+
+ suitesReport=report_generation()
+ stringParamsDict={ 'group' : testGroupName }
+
+ try:
+ suitesReport.transformSuitesReport(xslfile,xmlfile,htmlfile,stringParamsDict)
+ except IOError,details:
+ _message='Unable to generate suites test report %s.' % details
+ </script>
+ <message>_message</message>
+
<!-- Generate the drill down test report -->
<script>
_message='Generated the drill down test report.'
@@ -577,8 +623,30 @@
</message>
<script>
- MailToList= SEND_MAIL_TO.split(",")
- MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
+ try:
+ if SEND_MAIL_REPORT:
+ MailSendReport=SEND_MAIL_REPORT
+ else:
+ MailSendReport='%s/groups.html' % logsReportDir
+ except NameError,details:
+ MailSendReport='%s/groups.html' % logsReportDir
+
+ try:
+ if SEND_MAIL_TO:
+ MailToList= SEND_MAIL_TO.split(",")
+ else:
+ MailToList=[]
+ except NameError,details:
+ MailToList=[]
+
+ try:
+ if SEND_MAIL_SUBJECT:
+ MailSubject= SEND_MAIL_SUBJECT
+ else:
+ MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
+ except NameError,details:
+ MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
+
MailSendTo= ' '
</script>
@@ -592,7 +660,7 @@
<location>'%s' % STAF_LOCAL_HOSTNAME </location>
<service>'email'</service>
<request>
- 'send %s contenttype "text/html" file %s subject "%s" noheader' % (MailSendTo,htmlfile,MailSubject)
+ 'send %s contenttype "text/html" file %s subject "%s" noheader' % (MailSendTo,MailSendReport,MailSubject)
</request>
</stafcmd>
--
Gitblit v1.10.0