Changeset 64951 in vbox
- Timestamp:
- Dec 18, 2016 2:50:33 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r62484 r64951 40 40 TMTooManyRows, TMRowNotFound; 41 41 from testmanager.core.testgroup import TestGroupData; 42 from testmanager.core.build import BuildDataEx ;42 from testmanager.core.build import BuildDataEx, BuildCategoryData; 43 43 from testmanager.core.failurereason import FailureReasonLogic; 44 44 from testmanager.core.testbox import TestBoxData; … … 651 651 ksResultsGroupingTypeNone = 'ResultsGroupingTypeNone'; 652 652 ksResultsGroupingTypeTestGroup = 'ResultsGroupingTypeTestGroup'; 653 ksResultsGroupingTypeBuildRev = 'ResultsGroupingTypeBuild'; 653 ksResultsGroupingTypeBuildCat = 'ResultsGroupingTypeBuildCat'; 654 ksResultsGroupingTypeBuildRev = 'ResultsGroupingTypeBuildRev'; 654 655 ksResultsGroupingTypeTestBox = 'ResultsGroupingTypeTestBox'; 655 656 ksResultsGroupingTypeTestCase = 'ResultsGroupingTypeTestCase'; 657 ksResultsGroupingTypeOS = 'ResultsGroupingTypeOS'; 658 ksResultsGroupingTypeArch = 'ResultsGroupingTypeArch'; 656 659 ksResultsGroupingTypeSchedGroup = 'ResultsGroupingTypeSchedGroup'; 657 660 … … 793 796 ksResultsGroupingTypeTestBox: ('', 'TestSets.idTestBox', None, {},), 794 797 ksResultsGroupingTypeTestCase: ('', 'TestSets.idTestCase', None, {},), 798 ksResultsGroupingTypeOS: ( 799 ', TestBoxes', 800 'TestBoxes.idStrOs', 801 ' AND TestBoxes.idGenTestBox = TestSets.idGenTestBox', 802 {}, 803 ), 804 ksResultsGroupingTypeArch: ( 805 ', TestBoxes', 806 'TestBoxes.idStrCpuArch', 807 ' AND TestBoxes.idGenTestBox = TestSets.idGenTestBox', 808 {}, 809 ), 810 ksResultsGroupingTypeBuildCat: ('', 'TestSets.idBuildCategory', None, {},), 795 811 ksResultsGroupingTypeBuildRev: ( 796 812 ', Builds', … … 1186 1202 return aoRet 1187 1203 1204 def getOSes(self, tsNow, sPeriod): 1205 """ 1206 Get a list of [idStrOs, sOs] tuples of the OSes that appears in the specified result period. 1207 """ 1208 1209 # Note! INNER JOIN TestBoxesWithStrings performs miserable compared to LEFT OUTER JOIN. Doesn't matter for the result 1210 # because TestSets.idGenTestBox is a foreign key and unique in TestBoxes. So, let's do what ever is faster. 1211 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrOs, TestBoxesWithStrings.sOs\n' 1212 'FROM ( SELECT idTestBox AS idTestBox,\n' 1213 ' MAX(idGenTestBox) AS idGenTestBox\n' 1214 ' FROM TestSets\n' 1215 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1216 ' GROUP BY idTestBox\n' 1217 ' ) AS TestBoxIDs\n' 1218 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1219 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxIDs.idGenTestBox\n' 1220 'ORDER BY TestBoxesWithStrings.sOs\n' ); 1221 return self._oDb.fetchAll(); 1222 1223 def getArchitectures(self, tsNow, sPeriod): 1224 """ 1225 Get a list of [idStrCpuArch, sCpuArch] tuples of the architecutres 1226 that appears in the specified result period. 1227 """ 1228 1229 # Note! INNER JOIN TestBoxesWithStrings performs miserable compared to LEFT OUTER JOIN. Doesn't matter for the result 1230 # because TestSets.idGenTestBox is a foreign key and unique in TestBoxes. So, let's do what ever is faster. 1231 self._oDb.execute('SELECT DISTINCT TestBoxesWithStrings.idStrCpuArch, TestBoxesWithStrings.sCpuArch\n' 1232 'FROM ( SELECT idTestBox AS idTestBox,\n' 1233 ' MAX(idGenTestBox) AS idGenTestBox\n' 1234 ' FROM TestSets\n' 1235 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1236 ' GROUP BY idTestBox\n' 1237 ' ) AS TestBoxIDs\n' 1238 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1239 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxIDs.idGenTestBox\n' 1240 'ORDER BY TestBoxesWithStrings.sCpuArch\n' ); 1241 return self._oDb.fetchAll(); 1242 1243 def getBuildCategories(self, tsNow, sPeriod): 1244 """ 1245 Get a list of BuildCategoryData that appears in the specified result period. 1246 """ 1247 1248 self._oDb.execute('SELECT DISTINCT BuildCategories.*\n' 1249 'FROM ( SELECT DISTINCT idBuildCategory AS idBuildCategory\n' 1250 ' FROM TestSets\n' 1251 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1252 ' ) AS BuildCategoryIDs\n' 1253 ' LEFT OUTER JOIN BuildCategories\n' 1254 ' ON BuildCategories.idBuildCategory = BuildCategoryIDs.idBuildCategory\n' 1255 'ORDER BY BuildCategories.sProduct, BuildCategories.sBranch, BuildCategories.sType\n'); 1256 aoRet = []; 1257 for aoRow in self._oDb.fetchAll(): 1258 aoRet.append(BuildCategoryData().initFromDbRow(aoRow)); 1259 return aoRet; 1260 1188 1261 def getSchedGroups(self, tsNow, sPeriod): 1189 1262 """ -
trunk/src/VBox/ValidationKit/testmanager/webui/template-details.html
r52776 r64951 35 35 </div> 36 36 37 <div id="main" >37 <div id="main" tabindex="1"> 38 38 @@PAGE_BODY@@ 39 39 -
trunk/src/VBox/ValidationKit/testmanager/webui/template.html
r61252 r64951 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">1 <!DOCTYPE HTML> 2 2 <html lang="en"> 3 3 <head> … … 47 47 </div> 48 48 49 <div id="main" >49 <div id="main" tabindex="1"> 50 50 @@PAGE_BODY@@ 51 51 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py
r64529 r64951 58 58 ksActionResultsGroupedByTestGroup = 'ResultsGroupedByTestGroup' 59 59 ksActionResultsGroupedByBuildRev = 'ResultsGroupedByBuildRev' 60 ksActionResultsGroupedByBuildCat = 'ResultsGroupedByBuildCat' 60 61 ksActionResultsGroupedByTestBox = 'ResultsGroupedByTestBox' 61 62 ksActionResultsGroupedByTestCase = 'ResultsGroupedByTestCase' 63 ksActionResultsGroupedByOS = 'ResultsGroupedByOS' 64 ksActionResultsGroupedByArch = 'ResultsGroupedByArch' 62 65 ksActionTestSetDetails = 'TestSetDetails'; 63 66 ksActionTestResultDetails = ksActionTestSetDetails; … … 199 202 self._dDispatch[self.ksActionResultsGroupedByTestGroup] = self._actionResultsGroupedByTestGroup; 200 203 self._dDispatch[self.ksActionResultsGroupedByBuildRev] = self._actionResultsGroupedByBuildRev; 204 self._dDispatch[self.ksActionResultsGroupedByBuildCat] = self._actionResultsGroupedByBuildCat; 201 205 self._dDispatch[self.ksActionResultsGroupedByTestBox] = self._actionResultsGroupedByTestBox; 202 206 self._dDispatch[self.ksActionResultsGroupedByTestCase] = self._actionResultsGroupedByTestCase; 207 self._dDispatch[self.ksActionResultsGroupedByOS] = self._actionResultsGroupedByOS; 208 self._dDispatch[self.ksActionResultsGroupedByArch] = self._actionResultsGroupedByArch; 203 209 self._dDispatch[self.ksActionResultsGroupedBySchedGroup] = self._actionResultsGroupedBySchedGroup; 204 210 … … 262 268 [ 'Grouped by TestBox', sActUrlBase + self.ksActionResultsGroupedByTestBox + sSheriff ], 263 269 [ 'Grouped by Test Case', sActUrlBase + self.ksActionResultsGroupedByTestCase + sSheriff ], 270 [ 'Grouped by OS', sActUrlBase + self.ksActionResultsGroupedByOS + sSheriff ], 271 [ 'Grouped by Architecture', sActUrlBase + self.ksActionResultsGroupedByArch + sSheriff ], 264 272 [ 'Grouped by Revision', sActUrlBase + self.ksActionResultsGroupedByBuildRev + sSheriff ], 273 [ 'Grouped by Build Category', sActUrlBase + self.ksActionResultsGroupedByBuildCat + sSheriff ], 265 274 ] 266 275 ], … … 283 292 [ 'Grouped by TestBox', sActUrlBase + self.ksActionResultsGroupedByTestBox + sExtraTimeNav ], 284 293 [ 'Grouped by Test Case', sActUrlBase + self.ksActionResultsGroupedByTestCase + sExtraTimeNav ], 294 [ 'Grouped by OS', sActUrlBase + self.ksActionResultsGroupedByOS + sExtraTimeNav ], 295 [ 'Grouped by Architecture', sActUrlBase + self.ksActionResultsGroupedByArch + sExtraTimeNav ], 285 296 [ 'Grouped by Revision', sActUrlBase + self.ksActionResultsGroupedByBuildRev + sExtraTimeNav ], 297 [ 'Grouped by Build Category', sActUrlBase + self.ksActionResultsGroupedByBuildCat + sExtraTimeNav ], 286 298 ] 287 299 ], … … 294 306 [ 'Grouped by TestBox', sActUrlBase + self.ksActionResultsGroupedByTestBox + sOnlyFailures ], 295 307 [ 'Grouped by Test Case', sActUrlBase + self.ksActionResultsGroupedByTestCase + sOnlyFailures ], 308 [ 'Grouped by OS', sActUrlBase + self.ksActionResultsGroupedByOS + sOnlyFailures ], 309 [ 'Grouped by Architecture', sActUrlBase + self.ksActionResultsGroupedByArch + sOnlyFailures ], 296 310 [ 'Grouped by Revision', sActUrlBase + self.ksActionResultsGroupedByBuildRev + sOnlyFailures ], 311 [ 'Grouped by Build Category', sActUrlBase + self.ksActionResultsGroupedByBuildCat + sOnlyFailures ], 297 312 ] 298 313 ], … … 764 779 self._sPageTitle = 'Grouped by Build' 765 780 781 elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeBuildCat: 782 aoTmp = oTrLogic.getBuildCategories(tsNow = tsEffective, sPeriod = sCurPeriod) 783 aoGroupMembers = sorted(list(set([ ( x.idBuildCategory, '%s / %s / %s / %s' 784 % ( x.sProduct, x.sBranch, ', '.join(x.asOsArches), x.sType) ) 785 for x in aoTmp ])), 786 reverse = True, key = lambda asData: asData[1]); 787 self._sPageTitle = 'Grouped by Build Category' 788 766 789 elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeTestCase: 767 790 aoTmp = oTrLogic.getTestCases(tsNow = tsEffective, sPeriod = sCurPeriod) … … 769 792 reverse = False, key = lambda asData: asData[1]) 770 793 self._sPageTitle = 'Grouped by Test Case' 794 795 elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeOS: 796 aoTmp = oTrLogic.getOSes(tsNow = tsEffective, sPeriod = sCurPeriod) 797 aoGroupMembers = sorted(list(set(aoTmp)), reverse = False, key = lambda asData: asData[1]); 798 self._sPageTitle = 'Grouped by OS' 799 800 elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeArch: 801 aoTmp = oTrLogic.getArchitectures(tsNow = tsEffective, sPeriod = sCurPeriod) 802 aoGroupMembers = sorted(list(set(aoTmp)), reverse = False, key = lambda asData: asData[1]); 803 self._sPageTitle = 'Grouped by Architecture' 771 804 772 805 elif enmResultsGroupingType == TestResultLogic.ksResultsGroupingTypeSchedGroup: … … 875 908 TestResultLogic, WuiGroupedResultList); 876 909 910 def _actionResultsGroupedByBuildCat(self): 911 """ Action wrapper. """ 912 from testmanager.webui.wuitestresult import WuiGroupedResultList; 913 from testmanager.core.testresults import TestResultLogic; 914 return self._actionGroupedResultsListing(TestResultLogic.ksResultsGroupingTypeBuildCat, 915 TestResultLogic, WuiGroupedResultList); 916 877 917 def _actionResultsGroupedByTestBox(self): 878 918 """ Action wrapper. """ … … 887 927 from testmanager.core.testresults import TestResultLogic; 888 928 return self._actionGroupedResultsListing(TestResultLogic.ksResultsGroupingTypeTestCase, 929 TestResultLogic, WuiGroupedResultList); 930 931 def _actionResultsGroupedByOS(self): 932 """ Action wrapper. """ 933 from testmanager.webui.wuitestresult import WuiGroupedResultList; 934 from testmanager.core.testresults import TestResultLogic; 935 return self._actionGroupedResultsListing(TestResultLogic.ksResultsGroupingTypeOS, 936 TestResultLogic, WuiGroupedResultList); 937 938 def _actionResultsGroupedByArch(self): 939 """ Action wrapper. """ 940 from testmanager.webui.wuitestresult import WuiGroupedResultList; 941 from testmanager.core.testresults import TestResultLogic; 942 return self._actionGroupedResultsListing(TestResultLogic.ksResultsGroupingTypeArch, 889 943 TestResultLogic, WuiGroupedResultList); 890 944
Note:
See TracChangeset
for help on using the changeset viewer.