Changeset 65157 in vbox
- Timestamp:
- Jan 5, 2017 4:29:05 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/base.py
r65155 r65157 1188 1188 ## @name The value type. 1189 1189 ## @{ 1190 ksType_UInt = 'uint'; ##< unsigned integer value. 1191 ksType_String = 'string'; ##< string value. 1190 ksType_UInt = 'uint'; ##< unsigned integer value. 1191 ksType_UIntNil = 'uint-nil'; ##< unsigned integer value, with nil. 1192 ksType_String = 'string'; ##< string value. 1192 1193 ## @} 1193 1194 … … 1245 1246 if oCriterion.sType == FilterCriterion.ksType_UInt: 1246 1247 oCriterion.aoSelected = oDisp.getListOfIntParams(oCriterion.sVarNm, iMin = 0, aiDefaults = []); 1248 elif oCriterion.sType == FilterCriterion.ksType_UIntNil: 1249 oCriterion.aoSelected = oDisp.getListOfIntParams(oCriterion.sVarNm, iMin = -1, aiDefaults = []); 1247 1250 elif oCriterion.sType == FilterCriterion.ksType_String: 1248 1251 oCriterion.aoSelected = oDisp.getListOfStrParams(oCriterion.sVarNm, asDefaults = []); -
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r65156 r65157 729 729 730 730 # Failure reasons 731 oCrit = FilterCriterion('Failure reasons', sVarNm = 'fr', sTable = 'TestResultFailures', sColumn = 'idFailureReason'); 731 oCrit = FilterCriterion('Failure reasons', sVarNm = 'fr', sType = FilterCriterion.ksType_UIntNil, 732 sTable = 'TestResultFailures', sColumn = 'idFailureReason'); 732 733 self.aCriteria.append(oCrit); 733 734 assert self.aCriteria[self.kiFailReasons] is oCrit; … … 846 847 else: 847 848 assert len(oCrit.asTables) == 1; 848 if iCrit == self.kiMemory: 849 sQuery += '%s AND (%s.%s / 1024)' % (sExtraIndent, oCrit.asTables[0], oCrit.sColumn,); 850 else: 851 sQuery += '%s AND %s.%s' % (sExtraIndent, oCrit.asTables[0], oCrit.sColumn,); 852 if not oCrit.fInverted: 853 sQuery += ' IN ('; 854 else: 855 sQuery += ' NOT IN ('; 856 if oCrit.sType == FilterCriterion.ksType_String: 857 sQuery += ', '.join('\'%s\'' % (sValue,) for sValue in oCrit.aoSelected) + ')\n'; 858 else: 859 sQuery += ', '.join(str(iValue) for iValue in oCrit.aoSelected) + ')\n'; 849 sQuery += '%s AND (' % (sExtraIndent,); 850 851 if oCrit.sType != FilterCriterion.ksType_UIntNil or max(oCrit.aoSelected) != -1: 852 if iCrit == self.kiMemory: 853 sQuery += '(%s.%s / 1024)' % (oCrit.asTables[0], oCrit.sColumn,); 854 else: 855 sQuery += '%s.%s' % (oCrit.asTables[0], oCrit.sColumn,); 856 if not oCrit.fInverted: 857 sQuery += ' IN ('; 858 else: 859 sQuery += ' NOT IN ('; 860 if oCrit.sType == FilterCriterion.ksType_String: 861 sQuery += ', '.join('\'%s\'' % (sValue,) for sValue in oCrit.aoSelected) + ')'; 862 else: 863 sQuery += ', '.join(str(iValue) for iValue in oCrit.aoSelected if iValue != -1) + ')'; 864 865 if oCrit.sType == FilterCriterion.ksType_UIntNil \ 866 and -1 in oCrit.aoSelected: 867 if sQuery[-1] != '(': sQuery += ' OR '; 868 sQuery += '%s.%s IS NULL' % (oCrit.asTables[0], oCrit.sColumn,); 869 870 if iCrit == self.kiFailReasons: 871 sQuery += '%s AND TestSets.enmStatus >= \'failure\'::TestStatus_T\n' % (sExtraIndent,); 872 sQuery += ')\n'; 860 873 if oCrit.oSub is not None: 861 874 sQuery += self._getWhereWorker(iCrit | (((iCrit >> 8) + 1) << 8), oCrit.oSub, sExtraIndent, iOmit); … … 1621 1634 oReportModel = DummyReportModel(); 1622 1635 1623 def workerDoFetch(oMissingLogicType, sNameAttr = 'sName', fIdIsName = False, idxHover = -1): 1636 def workerDoFetch(oMissingLogicType, sNameAttr = 'sName', fIdIsName = False, idxHover = -1, 1637 idNull = -1, sNullDesc = '<NULL>'): 1624 1638 """ Does the tedious result fetching and handling of missing bits. """ 1625 1639 dLeft = { oValue: 1 for oValue in oCrit.aoSelected }; 1626 1640 oCrit.aoPossible = []; 1627 1641 for aoRow in self._oDb.fetchAll(): 1628 oCrit.aoPossible.append(FilterCriterionValueAndDescription(aoRow[0], aoRow[1], aoRow[2], 1642 oCrit.aoPossible.append(FilterCriterionValueAndDescription(aoRow[0] if aoRow[0] is not None else idNull, 1643 aoRow[1] if aoRow[1] is not None else sNullDesc, 1644 aoRow[2], 1629 1645 aoRow[idxHover] if idxHover >= 0 else None)); 1630 1646 if aoRow[0] in dLeft: … … 1955 1971 ' COUNT(TestSets.idTestSet) as cTimes\n' 1956 1972 ' FROM TestSets\n' 1957 ' INNER JOIN TestResultFailures\n'1973 ' LEFT OUTER JOIN TestResultFailures\n' 1958 1974 ' ON TestResultFailures.idTestSet = TestSets.idTestSet\n' 1959 1975 ' AND TestResultFailures.tsExpire = \'infinity\'::TIMESTAMP\n' + … … 1961 1977 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1962 1978 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1979 ' AND TestSets.enmStatus >= \'failure\'::TestStatus_T\n' + 1963 1980 oFilter.getWhereConditions(iOmit = TestResultFilter.kiFailReasons) + 1964 1981 oReportModel.getExtraSubjectWhereExpr() + 1965 1982 ' GROUP BY TestResultFailures.idFailureReason\n' 1966 1983 ' ) AS FailureReasonIDs\n' 1967 ' INNER JOIN FailureReasons\n'1984 ' LEFT OUTER JOIN FailureReasons\n' 1968 1985 ' ON FailureReasons.idFailureReason = FailureReasonIDs.idFailureReason\n' 1969 1986 ' AND FailureReasons.tsExpire = \'infinity\'::TIMESTAMP\n' 1970 'ORDER BY FailureReasons.sShort\n' ); 1971 workerDoFetch(FailureReasonLogic, 'sShort'); 1987 'ORDER BY FailureReasons.idFailureReason IS NULL DESC,\n' 1988 ' FailureReasons.sShort\n' ); 1989 workerDoFetch(FailureReasonLogic, 'sShort', sNullDesc = 'Not given'); 1972 1990 1973 1991 # Error counts.
Note:
See TracChangeset
for help on using the changeset viewer.