- Timestamp:
- Jan 5, 2017 2:59:42 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
r65154 r65155 1193 1193 1194 1194 def __init__(self, sName, sVarNm = None, sType = ksType_UInt, sState = ksState_NotSelected, sKind = ksKind_ElementOfOrNot, 1195 sTable = None, sColumn = None, oSub = None):1195 sTable = None, sColumn = None, asTables = None, oSub = None): 1196 1196 assert len(sVarNm) == 2; # required by wuimain.py for filtering. 1197 1197 self.sName = sName; … … 1204 1204 self.fInverted = False; ##< User input from sInvVarNm. Inverts the operation (-> not an element of). 1205 1205 self.aoPossible = []; ##< type: list[FilterCriterionValueAndDescription] 1206 self.sTable = sTable; 1207 self.sColumn = sColumn; 1206 assert (sTable is None and asTables is None) or ((sTable is not None) != (asTables is not None)), \ 1207 '%s %s' % (sTable, asTables); 1208 self.asTables = [sTable,] if sTable is not None else asTables; 1209 assert sColumn is None or len(self.asTables) == 1, '%s %s' % (self.asTables, sColumn); 1210 self.sColumn = sColumn; ##< Normally only applicable if one table. 1208 1211 self.fExpanded = None; ##< Tristate (None, False, True) 1209 1212 self.oSub = oSub; ##< type: FilterCriterion -
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r65154 r65155 44 44 from testmanager.core.failurereason import FailureReasonLogic; 45 45 from testmanager.core.testbox import TestBoxData, TestBoxLogic; 46 from testmanager.core.testcase import TestCaseData , TestCaseLogic;46 from testmanager.core.testcase import TestCaseData; 47 47 from testmanager.core.schedgroup import SchedGroupData, SchedGroupLogic; 48 48 from testmanager.core.systemlog import SystemLogData, SystemLogLogic; … … 651 651 kiTestBoxes = 3; 652 652 kiTestCases = 4; 653 kiRevisions = 5; 654 kiCpuArches = 6; 655 kiCpuVendors = 7; 656 kiCpuCounts = 8; 657 kiMemory = 9; 658 kiMisc = 10; 659 kiOses = 11; 660 kiPythonVersions = 12; 661 kiFailReasons = 13; 662 663 kiMisc_NestedPaging = 0; 664 kiMisc_NoNestedPaging = 1; 665 kiMisc_RawMode = 2; 666 kiMisc_NoRawMode = 3; 667 kiMisc_64BitGuest = 4; 668 kiMisc_No64BitGuest = 5; 669 kiMisc_HwVirt = 6; 670 kiMisc_NoHwVirt = 7; 671 kiMisc_IoMmu = 8; 672 kiMisc_NoIoMmu = 9; 653 kiTestCaseMisc = 5; 654 kiRevisions = 6; 655 kiCpuArches = 7; 656 kiCpuVendors = 8; 657 kiCpuCounts = 9; 658 kiMemory = 10; 659 kiTestboxMisc = 11; 660 kiOses = 12; 661 kiPythonVersions = 13; 662 kiFailReasons = 14 663 664 ## Misc test case / variation name filters. 665 ## Presented in table order. The first sub element is the presistent ID. 666 kaTcMisc = ( 667 ( 1, 'x86', ), 668 ( 2, 'amd64', ), 669 ( 3, 'uni', ), 670 ( 4, 'smp', ), 671 ( 5, '-raw', ), 672 ( 6, '-hw', ), 673 ( 7, '-np', ), 674 ( 8, 'Install', ), 675 ( 8, 'Benchmark', ), 676 ( 8, 'USB', ), 677 ( 9, 'Debian', ), 678 ( 10, 'Fedora', ), 679 ( 11, 'Oracle', ), 680 ( 12, 'RHEL', ), 681 ( 13, 'SUSE', ), 682 ( 14, 'Ubuntu', ), 683 ( 15, 'Win', ), 684 ); 685 686 kiTbMisc_NestedPaging = 0; 687 kiTbMisc_NoNestedPaging = 1; 688 kiTbMisc_RawMode = 2; 689 kiTbMisc_NoRawMode = 3; 690 kiTbMisc_64BitGuest = 4; 691 kiTbMisc_No64BitGuest = 5; 692 kiTbMisc_HwVirt = 6; 693 kiTbMisc_NoHwVirt = 7; 694 kiTbMisc_IoMmu = 8; 695 kiTbMisc_NoIoMmu = 9; 673 696 674 697 def __init__(self): … … 698 721 assert self.aCriteria[self.kiTestCases] is oCrit; 699 722 723 oCrit = FilterCriterion('Test case name', sVarNm = 'cm', sKind = FilterCriterion.ksKind_Special, 724 asTables = ('TestCases', 'TestCaseArgs')); 725 oCrit.aoPossible = [ 726 FilterCriterionValueAndDescription(aoCur[0], 'Include %s' % (aoCur[1],)) for aoCur in self.kaTcMisc 727 ]; 728 oCrit.aoPossible.extend([ 729 FilterCriterionValueAndDescription(aoCur[0] + 32, 'Exclude %s' % (aoCur[1],)) for aoCur in self.kaTcMisc 730 ]); 731 self.aCriteria.append(oCrit); 732 assert self.aCriteria[self.kiTestCaseMisc] is oCrit; 733 700 734 oCrit = FilterCriterion('Revisions', sVarNm = 'rv', sTable = 'Builds', sColumn = 'iRevision'); 701 735 self.aCriteria.append(oCrit); … … 720 754 assert self.aCriteria[self.kiMemory] is oCrit; 721 755 722 oCrit = FilterCriterion(' Misc', sVarNm = 'cf', sKind = FilterCriterion.ksKind_Special,723 sTable = 'TestBoxesWithStrings' , sColumn = 'it_is_complicated');756 oCrit = FilterCriterion('Testbox misc', sVarNm = 'tm', sKind = FilterCriterion.ksKind_Special, 757 sTable = 'TestBoxesWithStrings'); 724 758 oCrit.aoPossible = [ 725 FilterCriterionValueAndDescription(self.ki Misc_NestedPaging, "req nested paging"),726 FilterCriterionValueAndDescription(self.ki Misc_NoNestedPaging, "w/o nested paging"),727 #FilterCriterionValueAndDescription(self.ki Misc_RawMode, "req raw-mode"), - not implemented yet.728 #FilterCriterionValueAndDescription(self.ki Misc_NoRawMode, "w/o raw-mode"), - not implemented yet.729 FilterCriterionValueAndDescription(self.ki Misc_64BitGuest, "req 64-bit guests"),730 FilterCriterionValueAndDescription(self.ki Misc_No64BitGuest, "w/o 64-bit guests"),731 FilterCriterionValueAndDescription(self.ki Misc_HwVirt, "req VT-x / AMD-V"),732 FilterCriterionValueAndDescription(self.ki Misc_NoHwVirt, "w/o VT-x / AMD-V"),733 #FilterCriterionValueAndDescription(self.ki Misc_IoMmu, "req I/O MMU"), - not implemented yet.734 #FilterCriterionValueAndDescription(self.ki Misc_NoIoMmu, "w/o I/O MMU"), - not implemented yet.759 FilterCriterionValueAndDescription(self.kiTbMisc_NestedPaging, "req nested paging"), 760 FilterCriterionValueAndDescription(self.kiTbMisc_NoNestedPaging, "w/o nested paging"), 761 #FilterCriterionValueAndDescription(self.kiTbMisc_RawMode, "req raw-mode"), - not implemented yet. 762 #FilterCriterionValueAndDescription(self.kiTbMisc_NoRawMode, "w/o raw-mode"), - not implemented yet. 763 FilterCriterionValueAndDescription(self.kiTbMisc_64BitGuest, "req 64-bit guests"), 764 FilterCriterionValueAndDescription(self.kiTbMisc_No64BitGuest, "w/o 64-bit guests"), 765 FilterCriterionValueAndDescription(self.kiTbMisc_HwVirt, "req VT-x / AMD-V"), 766 FilterCriterionValueAndDescription(self.kiTbMisc_NoHwVirt, "w/o VT-x / AMD-V"), 767 #FilterCriterionValueAndDescription(self.kiTbMisc_IoMmu, "req I/O MMU"), - not implemented yet. 768 #FilterCriterionValueAndDescription(self.kiTbMisc_NoIoMmu, "w/o I/O MMU"), - not implemented yet. 735 769 ]; 736 770 self.aCriteria.append(oCrit); 737 assert self.aCriteria[self.ki Misc] is oCrit;771 assert self.aCriteria[self.kiTestboxMisc] is oCrit; 738 772 739 773 oCrit = FilterCriterion('OS / version', sVarNm = 'os', sTable = 'TestBoxesWithStrings', sColumn = 'idStrOs', … … 753 787 ## @todo Add build type, error count, gang counts (if any > 1)... 754 788 755 kd MiscConditions = {756 ki Misc_NestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS TRUE',757 ki Misc_NoNestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS FALSE',758 ki Misc_RawMode: 'TestBoxesWithStrings.fRawMode IS TRUE',759 ki Misc_NoRawMode: 'TestBoxesWithStrings.fRawMode IS NOT TRUE',760 ki Misc_64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS TRUE',761 ki Misc_No64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS FALSE',762 ki Misc_HwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS TRUE',763 ki Misc_NoHwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS FALSE',764 ki Misc_IoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS TRUE',765 ki Misc_NoIoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS FALSE',789 kdTbMiscConditions = { 790 kiTbMisc_NestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS TRUE', 791 kiTbMisc_NoNestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS FALSE', 792 kiTbMisc_RawMode: 'TestBoxesWithStrings.fRawMode IS TRUE', 793 kiTbMisc_NoRawMode: 'TestBoxesWithStrings.fRawMode IS NOT TRUE', 794 kiTbMisc_64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS TRUE', 795 kiTbMisc_No64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS FALSE', 796 kiTbMisc_HwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS TRUE', 797 kiTbMisc_NoHwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS FALSE', 798 kiTbMisc_IoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS TRUE', 799 kiTbMisc_NoIoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS FALSE', 766 800 }; 767 801 … … 770 804 sQuery = ''; 771 805 if oCrit.sState == FilterCriterion.ksState_Selected and iCrit != iOmit: 772 if iCrit == self.kiMisc: 806 if iCrit == self.kiTestCaseMisc: 807 for iValue, sLike in self.kaTcMisc: 808 if iValue in oCrit.aoSelected: sNot = ''; 809 elif iValue + 32 in oCrit.aoSelected: sNot = 'NOT '; 810 else: continue; 811 sQuery += '%s AND %s (TestCases.sName LIKE \'%%%s%%\' OR TestCaseArgs.sSubName LIKE \'%%%s%%\')\n' \ 812 % (sExtraIndent, sNot, sLike, sLike,); 813 elif iCrit == self.kiTestboxMisc: 814 dConditions = self.kdTbMiscConditions; 773 815 for iValue in oCrit.aoSelected: 774 if iValue in self.kdMiscConditions:775 sQuery += '%s AND %s\n' % (sExtraIndent, self.kdMiscConditions[iValue],);816 if iValue in dConditions: 817 sQuery += '%s AND %s\n' % (sExtraIndent, dConditions[iValue],); 776 818 else: 819 assert len(oCrit.asTables) == 1; 777 820 if iCrit == self.kiMemory: 778 sQuery += '%s AND (%s.%s / 1024)' % (sExtraIndent, oCrit. sTable, oCrit.sColumn,);821 sQuery += '%s AND (%s.%s / 1024)' % (sExtraIndent, oCrit.asTables[0], oCrit.sColumn,); 779 822 else: 780 sQuery += '%s AND %s.%s' % (sExtraIndent, oCrit. sTable, oCrit.sColumn,);823 sQuery += '%s AND %s.%s' % (sExtraIndent, oCrit.asTables[0], oCrit.sColumn,); 781 824 if not oCrit.fInverted: 782 825 sQuery += ' IN ('; … … 813 856 for iCrit, oCrit in enumerate(self.aCriteria): 814 857 if oCrit.sState == FilterCriterion.ksState_Selected \ 815 and oCrit.sTable not in afDone \816 858 and iCrit != iOmit: 817 afDone[oCrit.sTable] = True; 818 if oCrit.sTable == 'Builds': 819 sQuery += '%sINNER JOIN Builds\n' \ 820 '%s ON Builds.idBuild = TestSets.idBuild\n' \ 821 '%s AND Builds.tsExpire > TestSets.tsCreated\n' \ 822 '%s AND Builds.tsEffective <= TestSets.tsCreated\n' \ 823 % ( sExtraIndent, sExtraIndent, sExtraIndent, sExtraIndent, ); 824 elif oCrit.sTable == 'TestResultFailures': 825 sQuery += '%sLEFT OUTER JOIN TestResultFailures\n' \ 826 '%s ON TestResultFailures.idTestSet = TestSets.idTestSet\n' \ 827 '%s AND TestResultFailures.tsExpire = \'infinity\'::TIMESTAMP\n' \ 828 % ( sExtraIndent, sExtraIndent, sExtraIndent, ); 829 elif oCrit.sTable == 'TestBoxesWithStrings': 830 sQuery += '%sLEFT OUTER JOIN TestBoxesWithStrings\n' \ 831 '%s ON TestBoxesWithStrings.idGenTestBox = TestSets.idGenTestBox\n' \ 832 % ( sExtraIndent, sExtraIndent, ); 833 elif oCrit.sTable == 'BuildCategories': 834 sQuery += '%sINNER JOIN BuildCategories\n' \ 835 '%s ON BuildCategories.idBuildCategory = TestSets.idBuildCategory\n' \ 836 % ( sExtraIndent, sExtraIndent, ); 837 else: 838 assert False, oCrit.sTable; 859 for sTable in oCrit.asTables: 860 if sTable not in afDone: 861 afDone[sTable] = True; 862 if sTable == 'Builds': 863 sQuery += '%sINNER JOIN Builds\n' \ 864 '%s ON Builds.idBuild = TestSets.idBuild\n' \ 865 '%s AND Builds.tsExpire > TestSets.tsCreated\n' \ 866 '%s AND Builds.tsEffective <= TestSets.tsCreated\n' \ 867 % ( sExtraIndent, sExtraIndent, sExtraIndent, sExtraIndent, ); 868 elif sTable == 'TestResultFailures': 869 sQuery += '%sLEFT OUTER JOIN TestResultFailures\n' \ 870 '%s ON TestResultFailures.idTestSet = TestSets.idTestSet\n' \ 871 '%s AND TestResultFailures.tsExpire = \'infinity\'::TIMESTAMP\n' \ 872 % ( sExtraIndent, sExtraIndent, sExtraIndent, ); 873 elif sTable == 'TestBoxesWithStrings': 874 sQuery += '%sLEFT OUTER JOIN TestBoxesWithStrings\n' \ 875 '%s ON TestBoxesWithStrings.idGenTestBox = TestSets.idGenTestBox\n' \ 876 % ( sExtraIndent, sExtraIndent, ); 877 elif sTable == 'BuildCategories': 878 sQuery += '%sINNER JOIN BuildCategories\n' \ 879 '%s ON BuildCategories.idBuildCategory = TestSets.idBuildCategory\n' \ 880 % ( sExtraIndent, sExtraIndent, ); 881 elif sTable == 'TestCases': 882 sQuery += '%sINNER JOIN TestCases\n' \ 883 '%s ON TestCases.idGenTestCase = TestSets.idGenTestCase\n' \ 884 % ( sExtraIndent, sExtraIndent, ); 885 elif sTable == 'TestCaseArgs': 886 sQuery += '%sINNER JOIN TestCaseArgs\n' \ 887 '%s ON TestCaseArgs.idGenTestCaseArgs = TestSets.idGenTestCaseArgs\n' \ 888 % ( sExtraIndent, sExtraIndent, ); 889 else: 890 assert False, sTable; 839 891 return sQuery; 840 892 … … 842 894 """ Checks whether getTableJoins already joins with TestResultFailures. """ 843 895 for oCrit in self.aCriteria: 844 if oCrit.s Table == sTable and oCrit.sState == FilterCriterion.ksState_Selected:896 if oCrit.sState == FilterCriterion.ksState_Selected and sTable in oCrit.asTables: 845 897 return True; 846 898 return False
Note:
See TracChangeset
for help on using the changeset viewer.