cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Manager WUI - Test Results.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncavailable from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncyou can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGeneral Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThe contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncof the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncYou may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncterms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Python imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuicontentbase import WuiContentBase, WuiListContentBase, WuiHtmlBase, WuiTmLink, WuiLinkBase, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiSvnLink, WuiSvnLinkWithTooltip, WuiBuildLogLink, WuiRawHtml;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.report import ReportGraphModel;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.testgroup import TestGroupData;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Display test case result"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiContentBase.__init__(self, fnDPrint = fnDPrint, oDisp = oDisp);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Cyclic import hacks.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Translate some object to HTML."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return webutils.escapeElem(self.formatTsShort(oObject));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Generate HTML code for table"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml = u' <table class="tmtbl-testresult-details" width="100%%">\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync continue; # Can happen if there is no testsuit.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync u' <tr class="tmtbl-result-details-caption">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync u' <td colspan="2">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync u' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += u' <tr class="%s">\n' % ('tmodd' if iRow & 1 else 'tmeven',);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += u' <td class="tmtbl-result-details-subcaption" colspan="2">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += u' <th scope="row">%s</th>\n' % (webutils.escapeElem(aoRow[0]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += u' <td>%s</td>\n' % (aoRow[2](aoRow[1]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += u' <td>%s</td>\n' % (self._toHtml(aoRow[1]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Return sStatus string surrounded by HTML highlight code """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ('red' if sStatus == 'failure' else 'green', webutils.escapeElem(sStatus.upper()))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _anchorAndAppendBinaries(self, sBinaries, aoRows):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Formats each binary (if any) into a row with a download link. """
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sBinaries is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoRows.append([WuiLinkBase(webutils.getFilename(sBinary), sBinary, fBracketed = False),]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _recursivelyGenerateEvents(self, oTestResult, sParentName, sLineage, iRow,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iFailure, oTestSet, iDepth): # pylint: disable=R0914
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Recursively generate event table rows for the result set.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oTestResult is an object of the type TestResultDataEx.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Hack: Replace empty outer test result name with (pretty) command line.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName = oTestResult.sName if sParentName == '' else '%s, %s' % (sParentName, oTestResult.sName,);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Format error count.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sErrCnt = ' (1 error)' if oTestResult.cErrors == 1 else ' (%d errors)' % oTestResult.cErrors;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Format the include in graph checkboxes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sResultGraph = '<input type="checkbox" name="%s" value="%s%s" title="Include result in graph."/>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (WuiMain.ksParamReportSubjectIds, ReportGraphModel.ksTypeResult, sLineage,);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sElapsedGraph = '<input type="checkbox" name="%s" value="%s%s" title="Include elapsed time in graph."/>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( WuiMain.ksParamReportSubjectIds, ReportGraphModel.ksTypeElapsed, sLineage);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Leaf - single row.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml = ' <tr class="%s tmtbl-events-leaf tmtbl-events-lvl%s tmstatusrow-%s">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td colspan="2"%s>%s%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(str(oTestResult.tsElapsed)) if oTestResult.tsElapsed is not None else '',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' id="failure-%u"' % (iFailure,) if oTestResult.isFailure() else '',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(oTestResult.enmStatus), webutils.escapeElem(sErrCnt),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Multiple rows.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml = ' <tr class="%s tmtbl-events-first tmtbl-events-lvl%s ">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td colspan="2">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(self.formatTsShort(oTestResult.tsCreated)), ## @todo more timeline stuff later.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'running' if oTestResult.tsElapsed is None else '', );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync (sChildHtml, iRow, iFailure) = self._recursivelyGenerateEvents(oChild, sName, sLineage,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Messages.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <tr class="%s tmtbl-events-message tmtbl-events-lvl%s">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td colspan="3">%s: %s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(self.formatTsShort(oMsg.tsCreated)),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <tr class="%s tmtbl-events-value tmtbl-events-lvl%s">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td class="tmtbl-events-number">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td class="tmtbl-events-unit">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td><input type="checkbox" name="%s" value="%s%s:%u" title="Include value in graph."></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(self.formatTsShort(oValue.tsCreated)),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync utils.formatNumber(oValue.lValue).replace(' ', ' '),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamReportSubjectIds, ReportGraphModel.ksTypeValue, sLineage, oValue.idStrName, );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink('%s (%s)' % (oFile.sFile, oFile.sKind), '',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self._oDisp.ksParamAction: self._oDisp.ksActionViewLog,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamLogFileId: oFile.idTestResultFile, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self._oDisp.ksParamAction: self._oDisp.ksActionGetFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileSetId: oTestSet.idTestSet,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileId: oFile.idTestResultFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink('%s (%s)' % (oFile.sFile, oFile.sKind), '',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self._oDisp.ksParamAction: self._oDisp.ksActionGetFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileSetId: oTestSet.idTestSet,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileId: oFile.idTestResultFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self._oDisp.ksParamAction: self._oDisp.ksActionGetFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileSetId: oTestSet.idTestSet,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._oDisp.ksParamGetFileId: oFile.idTestResultFile,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <tr class="%s tmtbl-events-file tmtbl-events-lvl%s">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(self.formatTsShort(oFile.tsCreated)),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <tr class="%s tmtbl-events-final tmtbl-events-lvl%s tmstatusrow-%s">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td colspan="2"%s>%s%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(self.formatTsShort(oTestResult.tsCreated + oTestResult.tsElapsed)),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' id="failure-%u"' % (iFailure,) if oTestResult.isFailure() else '',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync webutils.escapeElem(oTestResult.enmStatus), webutils.escapeElem(sErrCnt),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def showTestCaseResultDetails(self, # pylint: disable=R0914,R0915
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Show detailed result"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Get HTML <ul> list of Test Case name items"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTmp += '<li>%s</li>' % (webutils.escapeElem(oTestCaseData.sName),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Get HTML <ul> list of Global Resource name items"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTmp += '<li>%s</li>' % (webutils.escapeElem(oGlobalResourceData.sName),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Test result + test set details.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(oTestCaseEx.sName, self.oWuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self.oWuiAdmin.ksParamAction: self.oWuiAdmin.ksActionTestCaseDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync TestCaseData.ksParam_idTestCase: oTestCaseEx.idTestCase,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oWuiAdmin.ksParamEffectiveDate: oTestSet.tsConfig, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestCaseEx.sDescription is not None and len(oTestCaseEx.sDescription) > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Status:', WuiRawHtml('<span class="tmspan-status-%s">%s</span>'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (oTestResultTree.enmStatus, oTestResultTree.enmStatus,))]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append(( 'Errors:', oTestResultTree.cErrors ));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Elapsed:', oTestResultTree.tsElapsed ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cSecCfgTimeout = oTestCaseEx.cSecTimeout if oTestVarEx.cSecTimeout is None else oTestVarEx.cSecTimeout;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cSecEffTimeout = cSecCfgTimeout * oTestBox.pctScaleTimeout / 100;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '%s (%s sec)' % (utils.formatIntervalSeconds(cSecEffTimeout), cSecEffTimeout,) ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '%s (%s sec)' % (utils.formatIntervalSeconds(cSecCfgTimeout), cSecCfgTimeout,) ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Started:', WuiTmLink(self.formatTsShort(oTestSet.tsCreated), WuiMain.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiMain.ksParamAction: WuiMain.ksActionResultsUnGrouped,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamEffectiveDate: oTestSet.tsCreated, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(self.formatTsShort(oTestSet.tsDone), WuiMain.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiMain.ksParamAction: WuiMain.ksActionResultsUnGrouped,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows += [( 'Config:', oTestSet.tsConfig )];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Member No:', '#%s (of %s)' % (oTestSet.iGangMemberNo, oTestVarEx.cGangMembers) ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Test Group:', WuiTmLink(oTestGroup.sName, self.oWuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self.oWuiAdmin.ksParamAction: self.oWuiAdmin.ksActionTestGroupDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync TestGroupData.ksParam_idTestGroup: oTestGroup.idTestGroup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oWuiAdmin.ksParamEffectiveDate: oTestSet.tsConfig, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'TestBox reqs:', oTestVarEx.sTestBoxReqExpr ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif oTestCaseEx.sTestBoxReqExpr is not None or oTestVarEx.sTestBoxReqExpr is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'TestBox reqs:', oTestCaseEx.sTestBoxReqExpr ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Build reqs:', oTestVarEx.sBuildReqExpr ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync elif oTestCaseEx.sBuildReqExpr is not None or oTestVarEx.sBuildReqExpr is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Build reqs:', oTestCaseEx.sBuildReqExpr ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestCaseEx.sValidationKitZips is not None and oTestCaseEx.sValidationKitZips != '@VALIDATIONKIT_ZIP@':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Validation Kit:', oTestCaseEx.sValidationKitZips ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestCaseEx.aoDepTestCases is not None and len(oTestCaseEx.aoDepTestCases) > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Prereq. Test Cases:', oTestCaseEx.aoDepTestCases, getTcDepsHtmlList ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestCaseEx.aoDepGlobalResources is not None and len(oTestCaseEx.aoDepGlobalResources) > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoResultRows.append([ 'Global Resources:', oTestCaseEx.aoDepGlobalResources, getGrDepsHtmlList ]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oBuildEx is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self.oWuiAdmin.ksParamAction: self.oWuiAdmin.ksActionBuildDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oWuiAdmin.ksParamEffectiveDate: oTestSet.tsCreated, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._anchorAndAppendBinaries(oBuildEx.sBinaries, aoBuildRows);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Revision:', WuiSvnLinkWithTooltip(oBuildEx.iRevision, oBuildEx.oCat.sRepository,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoBuildRows += [ ( 'Author ID:', oBuildEx.uidAuthor ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoBuildRows += [ ( 'Log:', WuiBuildLogLink(oBuildEx.sLogUrl, fBracketed = False) ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oValidationKitEx is not None:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink('Validation Kit', self.oWuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self.oWuiAdmin.ksParamAction: self.oWuiAdmin.ksActionBuildDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildData.ksParam_idBuild: oValidationKitEx.idBuild,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.oWuiAdmin.ksParamEffectiveDate: oTestSet.tsCreated, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._anchorAndAppendBinaries(oValidationKitEx.sBinaries, aoValidationKitRows);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Revision:', WuiSvnLink(oValidationKitEx.iRevision, fBracketed = False) ) ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oValidationKitEx.oCat.sProduct != 'VBox TestSuite':
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Product:', oValidationKitEx.oCat.sProduct ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Product:', oValidationKitEx.oCat.sBranch ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Type:', oValidationKitEx.oCat.sType), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Version:', oValidationKitEx.sVersion ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Author ID:', oValidationKitEx.uidAuthor ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoValidationKitRows += [ ( 'Log:', WuiBuildLogLink(oValidationKitEx.sLogUrl, fBracketed = False) ), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(oTestBox.sName, self.oWuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { self.oWuiAdmin.ksParamAction: self.oWuiAdmin.ksActionTestBoxDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync TestBoxData.ksParam_idGenTestBox: oTestSet.idGenTestBox, },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestBox.sDescription is not None and len(oTestBox.sDescription) > 0:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #( 'UUID:', oTestBox.uuidSystem ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #( 'Enabled:', oTestBox.fEnabled ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #( 'Lom Kind:', oTestBox.enmLomKind ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #( 'Lom IP:', oTestBox.ipLom ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'OS/Arch:', '%s.%s' % (oTestBox.sOs, oTestBox.sCpuArch) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoTestBoxRows.append(['CPU Name', oTestBox.sCpuName.replace(' ', ' ')]);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # ASSUMING x86+AMD64 versioning scheme here.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'CPU Family', '%u (%#x)' % ( uFamily, uFamily, ) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'CPU Stepping', '%u (%#x)' % ( uStepping, uStepping, ) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestBox.fCpuHwVirt is True: asFeatures.append(u'HW\u2011Virt');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestBox.fCpuNestedPaging is True: asFeatures.append(u'Nested\u2011Paging');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestBox.fCpu64BitGuest is True: asFeatures.append(u'64\u2011bit\u2011Guest');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oTestBox.fChipsetIoMmu is True: asFeatures.append(u'I/O\u2011MMU');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Scratch Size:', '%s MB' % (oTestBox.cMbScratch,) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Scale Timeout:', '%s%%' % (oTestBox.pctScaleTimeout,) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ( 'Script Rev:', WuiSvnLink(oTestBox.iTestBoxScriptRev, fBracketed = False) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Convert the tree to a list of events, values, message and files.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtmlEvents += '<table class="tmtbl-events" id="tmtbl-events" width="100%">\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th>When</th>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th></th>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th>Elapsed</th>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th>Event name</th>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th colspan="2">Value (status)</th>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <th></th>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sPrettyCmdLine = ' \\<br> \n'.join(webutils.escapeElem(oTestCaseEx.sBaseCmd
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync (sTmp, _, cFailures) = self._recursivelyGenerateEvents(oTestResultTree, sPrettyCmdLine, '', 1, 0, oTestSet, 0);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Put it all together.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml = '<table class="tmtbl-testresult-details-base" width="100%">\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <td valign="top" width="20%%">\n%s\n</td>\n' % ' <br>\n'.join(asHtml);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <td valign="top" width="80%" style="padding-left:6px">\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <form action="#" method="get" id="graph-form">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <input type="hidden" name="%s" value="%s"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <input type="hidden" name="%s" value="%u"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <input type="hidden" name="%s" value="%u"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <input type="hidden" name="%s" value="%u"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <input type="hidden" name="%s" value="%u"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( WuiMain.ksParamAction, WuiMain.ksActionGraphWiz,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamGraphWizTestBoxIds, oTestBox.idTestBox,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamGraphWizBuildCatIds, oBuildEx.idBuildCategory,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamGraphWizTestCaseIds, oTestSet.idTestCase,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksParamGraphWizSrcTestSetId, oTestSet.idTestSet,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <input type="hidden" name="%s" value="%s"/>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( WuiMain.ksParamEffectiveDate, oTestSet.tsDone, );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFormButton = '<button type="submit" onclick="%s">Show graphs</button>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % ( webutils.escapeAttr('addDynamicGraphInputs("graph-form", "main", "%s", "%s");'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (WuiMain.ksParamGraphWizWidth, WuiMain.ksParamGraphWizDpi, )) );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' <p>%s</p>\n' % ( WuiTmLink('Jump to failure', '#failure-0'), )
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' ' + WuiTmLink('#%u' % (iFailure,), '#failure-%u' % (iFailure,)).toHtml();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' ' + WuiTmLink('#%u' % (iFailure,), '#failure-%u' % (iFailure,)).toHtml();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sHtml += ' ' + WuiTmLink('#%u' % (iFailure,), '#failure-%u' % (iFailure,)).toHtml();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WUI results content generator.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, aoEntries, cEntriesCount, iPage, cItemsPerPage, tsEffective, fnDPrint, oDisp):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Override initialization"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTitle = 'Ungrouped (%d)' % cEntriesCount, sId = 'results',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Product Build',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Validation Kit',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'TestBox OS',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'TestBox Name',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Test Case',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._asColumnAttribs = ['align="center"', 'align="center"', 'align="center"',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'align="center"', 'align="center"', 'align="center"',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'align="center"', 'align="center"', 'align="center"',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'align="center"', 'align="center"', 'align="center"' ]
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Prepare parameter lists.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestBoxLinkParams = self._oDisp.getParameters();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestBoxLinkParams[WuiMain.ksParamAction] = WuiMain.ksActionResultsGroupedByTestBox;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestCaseLinkParams = self._oDisp.getParameters();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestCaseLinkParams[WuiMain.ksParamAction] = WuiMain.ksActionResultsGroupedByTestCase;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dRevLinkParams = self._oDisp.getParameters();
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dRevLinkParams[WuiMain.ksParamAction] = WuiMain.ksActionResultsGroupedByBuildRev;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Format *show all* table entry
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oValidationKit = WuiTmLink('#%d - r%s' % (oEntry.idBuildTestSuite, oEntry.iRevisionTestSuite),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildData.ksParam_idBuild: oEntry.idBuildTestSuite },
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiMain.ksParamAction: WuiMain.ksActionTestResultDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoTestSetLinks.append(WuiTmLink('- %d error(s)' % (oEntry.cErrors, ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiMain.ksParamAction: WuiMain.ksActionTestResultDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestBoxLinkParams[WuiMain.ksParamGroupMemberId] = oEntry.idTestBox;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dTestCaseLinkParams[WuiMain.ksParamGroupMemberId] = oEntry.idTestCase;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._dRevLinkParams[WuiMain.ksParamGroupMemberId] = oEntry.iRevision;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxTitle += 'CPU vendor:\t%s\n' % ( oEntry.sCpuVendor, );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxTitle += 'CPU name:\t%s\n' % ( ' '.join(oEntry.sCpuName.split()), );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxTitle += 'OS version:\t%s\n' % ( oEntry.sOsVersion, );
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oEntry.fCpuHwVirt is True: asFeatures.append(u'HW\u2011Virt');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oEntry.fCpuNestedPaging is True: asFeatures.append(u'Nested\u2011Paging');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if oEntry.fCpu64BitGuest is True: asFeatures.append(u'64\u2011bit\u2011Guest');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #if oEntry.fChipsetIoMmu is True: asFeatures.append(u'I/O\u2011MMU');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxTitle += u'CPU features:\t' + u', '.join(asFeatures);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ WuiTmLink('#%d - %s %s (%s)' % (oEntry.idBuild, oEntry.sProduct, oEntry.sVersion, oEntry.sType,),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiMain.ksScriptName, self._dRevLinkParams, sTitle = '%s' % (oEntry.sBranch,), fBracketed = False),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiSvnLinkWithTooltip(oEntry.iRevision, 'vbox'), ## @todo add sRepository TestResultListingData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(self.ksShortDetailsLink, WuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ WuiTmLink(oEntry.sTestBoxName, WuiMain.ksScriptName, self._dTestBoxLinkParams, fBracketed = False,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(self.ksShortDetailsLink, WuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionTestBoxDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ WuiTmLink(oEntry.sTestCaseName, WuiMain.ksScriptName, self._dTestCaseLinkParams, fBracketed = False,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTitle = (oEntry.sBaseCmd + ' ' + oEntry.sArgs) if oEntry.sArgs else oEntry.sBaseCmd),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink(self.ksShortDetailsLink, WuiAdmin.ksScriptName,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionTestCaseDetails,