Changeset 65077 in vbox for trunk/src/VBox/ValidationKit/testmanager/core
- Timestamp:
- Jan 3, 2017 1:14:29 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
r65074 r65077 1158 1158 """ 1159 1159 1160 def __init__(self, oValue, sDesc, fIrrelevant = False):1160 def __init__(self, oValue, sDesc, cTimes = None, sHover = None, fIrrelevant = False): 1161 1161 self.oValue = oValue; ##< Typically the ID of something in the database. 1162 1162 self.sDesc = sDesc; ##< What to display. 1163 self.cTimes = cTimes; ##< Number of times the value occurs in the result set. None if not given. 1164 self.sHover = sHover; ##< Optional hover/title string. 1163 1165 self.fIrrelevant = fIrrelevant; ##< Irrelevant filter option, only present because it's selected 1164 1166 -
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r65074 r65077 646 646 """ 647 647 648 kiTestStatus = 0; 649 kiBranches = 1; 650 kiSchedGroups = 2; 651 kiTestBoxes = 3; 652 kiTestCases = 4; 653 kiRevisions = 5; 654 kiCpuArches = 6; 655 kiCpuVendors = 7; 656 kiOses = 8; 657 kiOsVersions = 9; 658 kiFailReasons = 10; 648 kiTestStatus = 0; 649 kiBranches = 1; 650 kiSchedGroups = 2; 651 kiTestBoxes = 3; 652 kiTestCases = 4; 653 kiTestCaseVars = 5; 654 kiRevisions = 6; 655 kiCpuArches = 7; 656 kiCpuVendors = 8; 657 kiOses = 9; 658 kiOsVersions = 10; 659 kiFailReasons = 11; 659 660 660 661 def __init__(self): … … 681 682 self.aCriteria.append(oCrit); 682 683 assert self.aCriteria[self.kiTestCases] is oCrit; 684 685 oCrit = FilterCriterion('Test variations', sVarNm = 'tv', sTable = 'TestSets', sColumn = 'idTestCaseArgs'); 686 self.aCriteria.append(oCrit); 687 assert self.aCriteria[self.kiTestCaseVars] is oCrit; 683 688 684 689 oCrit = FilterCriterion('Revisions', sVarNm = 'rv', sTable = 'Builds', sColumn = 'iRevision'); … … 1458 1463 oReportModel = DummyReportModel(); 1459 1464 1460 def workerDoFetch(oMissingLogicType, sNameAttr = 'sName', fIdIsName = False ):1465 def workerDoFetch(oMissingLogicType, sNameAttr = 'sName', fIdIsName = False, idxHover = -1): 1461 1466 """ Does the tedious result fetching and handling of missing bits. """ 1462 1467 dLeft = { oValue: 1 for oValue in oCrit.aoSelected }; 1463 1468 oCrit.aoPossible = []; 1464 1469 for aoRow in self._oDb.fetchAll(): 1465 oCrit.aoPossible.append(FilterCriterionValueAndDescription(aoRow[0], aoRow[1])); 1470 oCrit.aoPossible.append(FilterCriterionValueAndDescription(aoRow[0], aoRow[1], aoRow[2], 1471 aoRow[idxHover] if idxHover >= 0 else None)); 1466 1472 if aoRow[0] in dLeft: 1467 1473 del dLeft[aoRow[0]]; … … 1493 1499 # Scheduling groups (see getSchedGroups). 1494 1500 oCrit = oFilter.aCriteria[TestResultFilter.kiSchedGroups]; 1495 self._oDb.execute('SELECT SchedGroups.idSchedGroup, SchedGroups.sName \n'1501 self._oDb.execute('SELECT SchedGroups.idSchedGroup, SchedGroups.sName, SchedGroupIDs.cTimes\n' 1496 1502 'FROM ( SELECT TestSets.idSchedGroup,\n' 1497 ' MAX(TestSets.tsCreated) AS tsNow\n' 1503 ' MAX(TestSets.tsCreated) AS tsNow,\n' 1504 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1498 1505 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiSchedGroups) + 1499 1506 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1512 1519 # Testboxes (see getTestBoxes). 1513 1520 oCrit = oFilter.aCriteria[TestResultFilter.kiTestBoxes]; 1514 self._oDb.execute('SELECT TestBoxesWithStrings.idTestBox, TestBoxesWithStrings.sName\n' 1521 self._oDb.execute('SELECT TestBoxesWithStrings.idTestBox,\n' 1522 ' TestBoxesWithStrings.sName,\n' 1523 ' TestBoxIDs.cTimes\n' 1515 1524 'FROM ( SELECT TestSets.idTestBox AS idTestBox,\n' 1516 ' MAX(TestSets.idGenTestBox) AS idGenTestBox\n' 1525 ' MAX(TestSets.idGenTestBox) AS idGenTestBox,\n' 1526 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1517 1527 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiTestBoxes) + 1518 1528 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1529 1539 # Testbox OSes. 1530 1540 oCrit = oFilter.aCriteria[TestResultFilter.kiOses]; 1531 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrOs, TestBoxesWithStrings.sOs\n' 1532 'FROM ( SELECT DISTINCT TestSets.idGenTestBox\n' 1541 self._oDb.execute('SELECT TestBoxesWithStrings.idStrOs,\n' 1542 ' TestBoxesWithStrings.sOs,\n' 1543 ' SUM(TestBoxGenIDs.cTimes)\n' 1544 'FROM ( SELECT TestSets.idGenTestBox,\n' 1545 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1533 1546 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiOses) + 1534 1547 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1536 1549 oFilter.getWhereConditions(iOmit = TestResultFilter.kiOses) + 1537 1550 oReportModel.getExtraSubjectWhereExpr() + 1551 ' GROUP BY TestSets.idGenTestBox\n' 1538 1552 ' ) AS TestBoxGenIDs\n' 1539 1553 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1540 1554 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1555 'GROUP BY TestBoxesWithStrings.idStrOs, TestBoxesWithStrings.sOs\n' 1541 1556 'ORDER BY TestBoxesWithStrings.sOs\n' ); 1542 1557 workerDoFetch(TestBoxLogic, 'sOs'); … … 1544 1559 # Testbox OS versions . 1545 1560 oCrit = oFilter.aCriteria[TestResultFilter.kiOsVersions]; 1546 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrOsVersion, TestBoxesWithStrings.sOsVersion\n' 1547 'FROM ( SELECT DISTINCT TestSets.idGenTestBox AS idGenTestBox\n' 1561 self._oDb.execute('SELECT TestBoxesWithStrings.idStrOsVersion,\n' 1562 ' TestBoxesWithStrings.sOsVersion,\n' 1563 ' SUM(TestBoxGenIDs.cTimes)\n' 1564 'FROM ( SELECT TestSets.idGenTestBox AS idGenTestBox,\n' 1565 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1548 1566 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiOsVersions) + 1549 1567 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1551 1569 oFilter.getWhereConditions(iOmit = TestResultFilter.kiOsVersions) + 1552 1570 oReportModel.getExtraSubjectWhereExpr() + 1571 ' GROUP BY TestSets.idGenTestBox\n' 1553 1572 ' ) AS TestBoxGenIDs\n' 1554 1573 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1555 1574 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1575 'GROUP BY TestBoxesWithStrings.idStrOsVersion, TestBoxesWithStrings.sOsVersion\n' 1556 1576 'ORDER BY TestBoxesWithStrings.sOsVersion\n' ); 1557 1577 workerDoFetch(TestBoxLogic, 'sOsVersion'); … … 1559 1579 # Testbox CPU/OS architectures. 1560 1580 oCrit = oFilter.aCriteria[TestResultFilter.kiCpuArches]; 1561 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrCpuArch, TestBoxesWithStrings.sCpuArch\n' 1562 'FROM ( SELECT DISTINCT TestSets.idGenTestBox\n' 1581 self._oDb.execute('SELECT TestBoxesWithStrings.idStrCpuArch,\n' 1582 ' TestBoxesWithStrings.sCpuArch,\n' 1583 ' SUM(TestBoxGenIDs.cTimes)\n' 1584 'FROM ( SELECT TestSets.idGenTestBox,\n' 1585 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1563 1586 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiCpuArches) + 1564 1587 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1566 1589 oFilter.getWhereConditions(iOmit = TestResultFilter.kiCpuArches) + 1567 1590 oReportModel.getExtraSubjectWhereExpr() + 1591 ' GROUP BY TestSets.idGenTestBox\n' 1568 1592 ' ) AS TestBoxGenIDs\n' 1569 1593 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1570 1594 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1595 'GROUP BY TestBoxesWithStrings.idStrCpuArch, TestBoxesWithStrings.sCpuArch\n' 1571 1596 'ORDER BY TestBoxesWithStrings.sCpuArch\n' ); 1572 1597 workerDoFetch(TestBoxLogic, 'sCpuArch'); … … 1574 1599 # Testbox CPU vendors. 1575 1600 oCrit = oFilter.aCriteria[TestResultFilter.kiCpuVendors]; 1576 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrCpuVendor, TestBoxesWithStrings.sCpuVendor\n' 1577 'FROM ( SELECT DISTINCT TestSets.idGenTestBox\n' 1601 self._oDb.execute('SELECT TestBoxesWithStrings.idStrCpuVendor,\n' 1602 ' TestBoxesWithStrings.sCpuVendor,\n' 1603 ' SUM(TestBoxGenIDs.cTimes)\n' 1604 'FROM ( SELECT TestSets.idGenTestBox,\n' 1605 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1578 1606 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiCpuVendors) + 1579 1607 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1581 1609 oFilter.getWhereConditions(iOmit = TestResultFilter.kiCpuVendors) + 1582 1610 oReportModel.getExtraSubjectWhereExpr() + 1611 ' GROUP BY TestSets.idGEnTestBox' 1583 1612 ' ) AS TestBoxGenIDs\n' 1584 1613 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1585 1614 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1615 'GROUP BY TestBoxesWithStrings.idStrCpuVendor, TestBoxesWithStrings.sCpuVendor\n' 1586 1616 'ORDER BY TestBoxesWithStrings.sCpuVendor\n' ); 1587 1617 workerDoFetch(TestBoxLogic, 'sCpuVendor'); … … 1589 1619 # Testcases (see getTestCases). 1590 1620 oCrit = oFilter.aCriteria[TestResultFilter.kiTestCases]; 1591 self._oDb.execute('SELECT TestCases.idTestCase, TestCases.sName \n'1621 self._oDb.execute('SELECT TestCases.idTestCase, TestCases.sName, TestCasesIDs.cTimes\n' 1592 1622 'FROM ( SELECT TestSets.idTestCase AS idTestCase,\n' 1593 ' MAX(TestSets.idGenTestCase) AS idGenTestCase\n' 1623 ' MAX(TestSets.idGenTestCase) AS idGenTestCase,\n' 1624 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1594 1625 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiTestCases) + 1595 1626 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1603 1634 workerDoFetch(TestCaseLogic); 1604 1635 1636 # Testcase variations. 1637 oCrit = oFilter.aCriteria[TestResultFilter.kiTestCaseVars]; 1638 self._oDb.execute('SELECT TestCaseArgsIDs.idTestCaseArgs,\n' 1639 ' CASE WHEN TestCaseArgs.sSubName IS NULL OR TestCaseArgs.sSubName = \'\' THEN\n' 1640 ' CONCAT(TestCases.sName, \' / #\', TestCaseArgs.idTestCaseArgs)\n' 1641 ' ELSE\n' 1642 ' CONCAT(TestCases.sName, \' / \', TestCaseArgs.sSubName)\n' 1643 ' END,' 1644 ' TestCaseArgsIDs.cTimes\n' 1645 'FROM ( SELECT TestSets.idTestCase AS idTestCase,\n' 1646 ' TestSets.idTestCaseArgs AS idTestCaseArgs,\n' 1647 ' MAX(TestSets.idGenTestCase) AS idGenTestCase,\n' 1648 ' MAX(TestSets.idGenTestCaseArgs) AS idGenTestCaseArgs,\n' 1649 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1650 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiTestCaseVars) + 1651 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1652 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1653 oFilter.getWhereConditions(iOmit = TestResultFilter.kiTestCaseVars) + 1654 oReportModel.getExtraSubjectWhereExpr() + 1655 ' GROUP BY TestSets.idTestCase, TestSets.idTestCaseArgs\n' 1656 ' ) AS TestCaseArgsIDs\n' 1657 ' LEFT OUTER JOIN TestCases ON TestCases.idGenTestCase = TestCaseArgsIDs.idGenTestCase\n' 1658 ' LEFT OUTER JOIN TestCaseArgs\n' 1659 ' ON TestCaseArgs.idGenTestCaseArgs = TestCaseArgsIDs.idGenTestCaseArgs\n' 1660 'ORDER BY TestCases.sName\n' ); 1661 workerDoFetch(TestCaseLogic); 1662 1605 1663 # Build revisions. 1606 1664 oCrit = oFilter.aCriteria[TestResultFilter.kiRevisions]; 1607 self._oDb.execute('SELECT Builds.iRevision, CONCAT(\'r\', Builds.iRevision) \n'1665 self._oDb.execute('SELECT Builds.iRevision, CONCAT(\'r\', Builds.iRevision), SUM(BuildIDs.cTimes)\n' 1608 1666 'FROM ( SELECT TestSets.idBuild AS idBuild,\n' 1609 ' MAX(TestSets.tsCreated) AS tsNow\n' 1667 ' MAX(TestSets.tsCreated) AS tsNow,\n' 1668 ' COUNT(TestSets.idBuild) AS cTimes\n' 1610 1669 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiRevisions) + 1611 1670 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1625 1684 # Build branches. 1626 1685 oCrit = oFilter.aCriteria[TestResultFilter.kiBranches]; 1627 self._oDb.execute('SELECT DISTINCT BuildCategories.sBranch, BuildCategories.sBranch\n' 1628 'FROM ( SELECT DISTINCT TestSets.idBuildCategory\n' 1686 self._oDb.execute('SELECT BuildCategories.sBranch, BuildCategories.sBranch, SUM(BuildCategoryIDs.cTimes)\n' 1687 'FROM ( SELECT TestSets.idBuildCategory,\n' 1688 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1629 1689 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiBranches) + 1630 1690 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + … … 1632 1692 oFilter.getWhereConditions(iOmit = TestResultFilter.kiBranches) + 1633 1693 oReportModel.getExtraSubjectWhereExpr() + 1694 ' GROUP BY TestSets.idBuildCategory\n' 1634 1695 ' ) AS BuildCategoryIDs\n' 1635 1696 ' INNER JOIN BuildCategories\n' 1636 1697 ' ON BuildCategories.idBuildCategory = BuildCategoryIDs.idBuildCategory\n' 1698 'GROUP BY BuildCategories.sBranch\n' 1637 1699 'ORDER BY BuildCategories.sBranch DESC\n' ); 1638 1700 workerDoFetch(None, fIdIsName = True); … … 1640 1702 # Failure reasons. 1641 1703 oCrit = oFilter.aCriteria[TestResultFilter.kiFailReasons]; 1642 self._oDb.execute('SELECT FailureReasons.idFailureReason, FailureReasons.sShort\n' 1643 'FROM ( SELECT TestResultFailures.idFailureReason\n' 1704 self._oDb.execute('SELECT FailureReasons.idFailureReason, FailureReasons.sShort, FailureReasonIDs.cTimes\n' 1705 'FROM ( SELECT TestResultFailures.idFailureReason,\n' 1706 ' COUNT(TestSets.idTestSet) as cTimes\n' 1644 1707 ' FROM TestSets\n' 1645 1708 ' INNER JOIN TestResultFailures\n'
Note:
See TracChangeset
for help on using the changeset viewer.