VirtualBox

Changeset 61291 in vbox


Ignore:
Timestamp:
May 30, 2016 12:57:40 PM (8 years ago)
Author:
vboxsync
Message:

arg. bugs. sorting indicator.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/report.py

    r61290 r61291  
    373373        self.cHits              = 0;            # Sum number of hits in all periods and all reasons.
    374374        self.cMaxHits           = 0;            # Max hits in a row.
    375         self.cMinHits           = 0;            # Min hits in a row.
     375        self.cMinHits           = 99999999;     # Min hits in a row.
    376376        self.cMaxRows           = 0;            # Max number of rows in a period.
    377         self.cMinRows           = 0;            # Min number of rows in a period.
     377        self.cMinRows           = 99999999;     # Min number of rows in a period.
    378378        self.diPeriodFirst      = {};           # The period number a reason was first seen (keyed by subject ID).
    379379        self.diPeriodLast       = {};           # The period number a reason was last seen (keyed by subject ID).
     
    392392        """ Worker for appendPeriod and recalcStats. """
    393393        self.cHits += oPeriod.cHits;
    394         if oPeriod.cHits > self.cMaxHits:
    395             self.cMaxHits = oPeriod.cHits;
    396         if oPeriod.cHits < self.cMinHits:
    397             self.cMinHits = oPeriod.cHits;
    398 
    399         if len(oPeriod.aoRows) > self.cMaxHits:
    400             self.cMaxHits = len(oPeriod.aoRows);
    401         if len(oPeriod.aoRows) < self.cMinHits:
    402             self.cMinHits = len(oPeriod.aoRows);
     394        if oPeriod.cMaxHits > self.cMaxHits:
     395            self.cMaxHits = oPeriod.cMaxHits;
     396        if oPeriod.cMinHits < self.cMinHits:
     397            self.cMinHits = oPeriod.cMinHits;
     398
     399        if len(oPeriod.aoRows) > self.cMaxRows:
     400            self.cMaxRows = len(oPeriod.aoRows);
     401        if len(oPeriod.aoRows) < self.cMinRows:
     402            self.cMinRows = len(oPeriod.aoRows);
    403403
    404404    def recalcStats(self):
     
    406406        self.cHits          = 0;
    407407        self.cMaxHits       = 0;
    408         self.cMinHits       = 0;
     408        self.cMinHits       = 99999999;
    409409        self.cMaxRows       = 0;
    410         self.cMinRows       = 0;
     410        self.cMinRows       = 99999999;
    411411        self.diPeriodFirst  = {};
    412412        self.diPeriodLast   = {};
     
    474474        super(ReportPeriodSetWithTotalBase, self)._doStatsForPeriod(oPeriod);
    475475        self.cTotal += oPeriod.cTotal;
    476         if oPeriod.cTotal > self.cMaxTotal:
    477             self.cMaxTotal = oPeriod.cTotal;
    478         if oPeriod.cTotal < self.cMinTotal:
    479             self.cMinTotal = oPeriod.cTotal;
     476        if oPeriod.cMaxTotal > self.cMaxTotal:
     477            self.cMaxTotal = oPeriod.cMaxTotal;
     478        if oPeriod.cMinTotal < self.cMinTotal:
     479            self.cMinTotal = oPeriod.cMinTotal;
    480480
    481481        if oPeriod.uMaxPct > self.uMaxPct:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py

    r61289 r61291  
    264264        return u'<td align="center">%u</td>' % (oSet.dcHitsPerId[idKey],);
    265265
    266     def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, fWithTotals = True, cColsPerSeries = None):
     266    def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, iSortColumn = 0,
     267                             fWithTotals = True, cColsPerSeries = None):
    267268        """
    268269        Turns the set into a table.
     
    276277        # Header row.
    277278        sHtml += u' <tr><thead><th></th><th>%s</th>' % (webutils.escapeElem(sColumnName),)
    278         for oPeriod in reversed(oSet.aoPeriods):
    279             sHtml += u'<th colspan="%d">%s</th>' % (cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),);
     279        for iPeriod, oPeriod in enumerate(reversed(oSet.aoPeriods)):
     280            sHtml += u'<th colspan="%d">%s%s</th>' % ( cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),
     281                                                       '&#x25bc;' if iPeriod == iSortColumn else '');
    280282        if fWithTotals:
    281             sHtml += u'<th colspan="%d">Total</th>' % (cColsPerSeries,);
     283            sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries,
     284                                                         '&#x25bc;' if iSortColumn == len(oSet.aoPeriods) else '');
    282285        sHtml += u'</thead></td>\n';
    283286
     
    308311    def _getSortedIds(self, oSet, fByTotal = None):
    309312        """
    310         Get default sorted subject IDs.
     313        Get default sorted subject IDs and which column.
    311314        """
    312315
     
    319322                                  key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey],
    320323                                  reverse = True);
     324            iColumn = len(oSet.aoPeriods);
    321325        else:
    322326            # Sort by NOW column.
     
    327331                else:               dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal);
    328332            aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True);
    329         return aidSortedRaw;
     333            iColumn = 0;
     334        return (aidSortedRaw, iColumn);
    330335
    331336    def _generateGraph(self, oSet, sIdBase, aidSortedRaw):
     
    410415        # Generate table and transition list. These are the most useful ones with the current graph machinery.
    411416        #
    412         sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw);
     417        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, len(oSet.aoPeriods));
    413418        sHtml += self._generateTransitionList(oSet);
    414419
     
    485490        self._sTitle = 'Test Case Failures';
    486491        oSet = self._oModel.getTestCaseFailures();
    487         aidSortedRaw = self._getSortedIds(oSet);
    488 
    489         sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw);
     492        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
     493
     494        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, iSortColumn);
    490495        sHtml += self._generateTransitionList(oSet);
    491496        sHtml += self._generateGraph(oSet, 'testcase-graph', aidSortedRaw);
     
    524529        self._sTitle = 'Test Case Variation Failures';
    525530        oSet = self._oModel.getTestCaseVariationFailures();
    526         aidSortedRaw = self._getSortedIds(oSet);
    527 
    528         sHtml  = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw);
     531        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
     532
     533        sHtml  = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw, iSortColumn);
    529534        sHtml += self._generateTransitionList(oSet);
    530535        sHtml += self._generateGraph(oSet, 'testcasearg-graph', aidSortedRaw);
     
    556561        self._sTitle = 'Test Box Failures';
    557562        oSet = self._oModel.getTestBoxFailures();
    558         aidSortedRaw = self._getSortedIds(oSet);
    559 
    560         sHtml  = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw);
     563        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
     564
     565        sHtml  = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw, iSortColumn);
    561566        sHtml += self._generateTransitionList(oSet);
    562567        sHtml += self._generateGraph(oSet, 'testbox-graph', aidSortedRaw);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette