VirtualBox

Ignore:
Timestamp:
Jan 10, 2017 3:36:36 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112734
Message:

TestManager: Hacked up some basic testbox sorting during the weekly meeting.

Location:
trunk/src/VBox/ValidationKit/testmanager/core
Files:
14 edited

Legend:

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

    r65053 r65226  
    152152        self.dCache = None;
    153153
    154     def fetchForListing(self, iStart, cMaxRows, tsNow):
     154    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    155155        """
    156156        Fetches testboxes for listing.
     
    515515    #
    516516
    517     def fetchForListing(self, iStart, cMaxRows, tsNow):
     517    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    518518        """
    519519        Fetches builds for listing.
     
    522522        Raises exception on error.
    523523        """
     524        _ = aiSortColumns;
     525
    524526        if tsNow is None:
    525527            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/buildblacklist.py

    r65040 r65226  
    128128        self.dCache = None;
    129129
    130     def fetchForListing(self, iStart, cMaxRows, tsNow):
     130    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    131131        """
    132132        Fetches Build Blacklist records.
     
    135135        Raises exception on error.
    136136        """
     137        _ = aiSortColumns;
    137138
    138139        if tsNow is None:
  • trunk/src/VBox/ValidationKit/testmanager/core/buildsource.py

    r65040 r65226  
    163163    #
    164164
    165     def fetchForListing(self, iStart, cMaxRows, tsNow):
     165    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    166166        """
    167167        Fetches build sources.
     
    170170        Raises exception on error.
    171171        """
     172        _ = aiSortColumns;
     173
    172174        if tsNow is None:
    173175            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/failurecategory.py

    r62484 r65226  
    111111        self.dCache = None;
    112112
    113     def fetchForListing(self, iStart, cMaxRows, tsNow):
     113    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    114114        """
    115115        Fetches Failure Category records.
     
    118118        Raises exception on error.
    119119        """
     120        _ = aiSortColumns;
    120121
    121122        if tsNow is None:
  • trunk/src/VBox/ValidationKit/testmanager/core/failurereason.py

    r65040 r65226  
    149149        self.oUserAccountLogic = None;
    150150
    151     def fetchForListing(self, iStart, cMaxRows, tsNow):
     151    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    152152        """
    153153        Fetches Failure Category records.
     
    156156        Raises exception on error.
    157157        """
     158        _ = aiSortColumns;
    158159        self._ensureCachesPresent();
    159160
     
    188189        return aoRows
    189190
    190     def fetchForListingInCategory(self, iStart, cMaxRows, tsNow, idFailureCategory):
     191    def fetchForListingInCategory(self, iStart, cMaxRows, tsNow, idFailureCategory, aiSortColumns = None):
    191192        """
    192193        Fetches Failure Category records.
     
    195196        Raises exception on error.
    196197        """
     198        _ = aiSortColumns;
    197199        self._ensureCachesPresent();
    198200
  • trunk/src/VBox/ValidationKit/testmanager/core/globalresource.py

    r65040 r65226  
    124124        self.dCache = None;
    125125
    126     def fetchForListing(self, iStart, cMaxRows, tsNow):
     126    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    127127        """
    128128        Returns an array (list) of FailureReasonData items, empty list if none.
    129129        Raises exception on error.
    130130        """
     131        _ = aiSortColumns;
    131132
    132133        if tsNow is None:
  • trunk/src/VBox/ValidationKit/testmanager/core/schedgroup.py

    r65040 r65226  
    434434    #
    435435
    436     def fetchForListing(self, iStart, cMaxRows, tsNow):
     436    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    437437        """
    438438        Fetches build sources.
     
    441441        Raises exception on error.
    442442        """
     443        _ = aiSortColumns;
    443444
    444445        if tsNow is None:
  • trunk/src/VBox/ValidationKit/testmanager/core/systemchangelog.py

    r65211 r65226  
    128128
    129129
    130     def fetchForListingEx(self, iStart, cMaxRows, tsNow, cDaysBack):
     130    def fetchForListingEx(self, iStart, cMaxRows, tsNow, cDaysBack, aiSortColumns = None):
    131131        """
    132132        Fetches SystemLog entries.
     
    135135        Raises exception on error.
    136136        """
     137        _ = aiSortColumns;
    137138
    138139        #
  • trunk/src/VBox/ValidationKit/testmanager/core/systemlog.py

    r62484 r65226  
    103103        ModelLogicBase.__init__(self, oDb);
    104104
    105     def fetchForListing(self, iStart, cMaxRows, tsNow):
     105    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    106106        """
    107107        Fetches SystemLog entries.
     
    110110        Raises exception on error.
    111111        """
     112        _ = aiSortColumns;
    112113        if tsNow is None:
    113114            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/testbox.py

    r65094 r65226  
    671671    """
    672672
     673    kiSortColumn_sName              =  0;
     674    kiSortColumn_sOs                =  1;
     675    kiSortColumn_sOsVersion         =  2;
     676    kiSortColumn_sCpuVendor         =  3;
     677    kiSortColumn_sCpuArch           =  4;
     678    kiSortColumn_lCpuRevision       =  5;
     679    kiSortColumn_cCpus              =  6;
     680    kiSortColumn_cMbMemory          =  7;
     681    kiSortColumn_cMbScratch         =  8;
     682    kiSortColumn_fNestedPaging      =  9;
     683    kiSortColumn_iTestBoxScriptRev  = 10;
     684    kiSortColumn_iPythonHexVersion  = 11;
     685    kcMaxSortColumns                = 12;
     686    kdSortColumnMap                 = {
     687        kiSortColumn_sName:             'TestBoxesWithStrings.sName',
     688        kiSortColumn_sOs:               'TestBoxesWithStrings.sOs',
     689        kiSortColumn_sOsVersion:        'TestBoxesWithStrings.sOsVersion',
     690        kiSortColumn_sCpuVendor:        'TestBoxesWithStrings.sCpuVendor',
     691        kiSortColumn_sCpuArch:          'TestBoxesWithStrings.sCpuArch',
     692        kiSortColumn_lCpuRevision:      'TestBoxesWithStrings.lCpuRevision',
     693        kiSortColumn_cCpus:             'TestBoxesWithStrings.cCpus',
     694        kiSortColumn_cMbMemory:         'TestBoxesWithStrings.cMbMemory',
     695        kiSortColumn_cMbScratch:        'TestBoxesWithStrings.cMbScratch',
     696        kiSortColumn_fNestedPaging:     'TestBoxesWithStrings.fNestedPaging',
     697        kiSortColumn_iTestBoxScriptRev: 'TestBoxesWithStrings.iTestBoxScriptRev',
     698        kiSortColumn_iPythonHexVersion: 'TestBoxesWithStrings.iPythonHexVersion',
     699    };
    673700
    674701    def __init__(self, oDb):
     
    694721        return oData;
    695722
    696     def fetchForListing(self, iStart, cMaxRows, tsNow):
     723    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    697724        """
    698725        Fetches testboxes for listing.
     
    713740
    714741        from testmanager.core.testboxstatus import TestBoxStatusData;
     742
     743        if aiSortColumns is None or len(aiSortColumns) == 0:
     744            aiSortColumns = [self.kiSortColumn_sName,];
    715745
    716746        if tsNow is None:
     
    721751                              '                      ON TestBoxStatuses.idTestBox = TestBoxesWithStrings.idTestBox\n'
    722752                              'WHERE    TestBoxesWithStrings.tsExpire = \'infinity\'::TIMESTAMP\n'
    723                               'ORDER BY TestBoxesWithStrings.sName\n'
     753                              'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n'
    724754                              'LIMIT %s OFFSET %s\n'
    725755                              , (cMaxRows, iStart,));
     
    732762                              'WHERE    tsExpire     > %s\n'
    733763                              '     AND tsEffective <= %s\n'
    734                               'ORDER BY TestBoxesWithStrings.sName\n'
     764                              'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n'
    735765                              'LIMIT %s OFFSET %s\n'
    736766                              , ( tsNow, tsNow, cMaxRows, iStart,));
  • trunk/src/VBox/ValidationKit/testmanager/core/testcase.py

    r62484 r65226  
    965965        return aoRet
    966966
    967     def fetchForListing(self, iStart, cMaxRows, tsNow):
     967    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    968968        """
    969969        Fetches test cases.
     
    972972        Raises exception on error.
    973973        """
     974        _ = aiSortColumns;
    974975        if tsNow is None:
    975976            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/testgroup.py

    r65040 r65226  
    380380    #
    381381
    382     def fetchForListing(self, iStart, cMaxRows, tsNow):
     382    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    383383        """
    384384        Fetches test groups.
     
    387387        Raises exception on error.
    388388        """
     389        _ = aiSortColumns;
    389390        if tsNow is None:
    390391            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/useraccount.py

    r62484 r65226  
    123123        self.dCache = None;
    124124
    125     def fetchForListing(self, iStart, cMaxRows, tsNow):
     125    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    126126        """
    127127        Fetches user accounts.
     
    130130        Raises exception on error.
    131131        """
     132        _ = aiSortColumns;
    132133        if tsNow is None:
    133134            self._oDb.execute('SELECT   *\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/vcsrevisions.py

    r62484 r65226  
    113113    #
    114114
    115     def fetchForListing(self, iStart, cMaxRows, tsNow):
     115    def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None):
    116116        """
    117117        Fetches VCS revisions for listing.
     
    120120        Raises exception on error.
    121121        """
    122         _ = tsNow;
     122        _ = tsNow; _ = aiSortColumns;
    123123        self._oDb.execute('SELECT   *\n'
    124124                          'FROM     VcsRevisions\n'
Note: See TracChangeset for help on using the changeset viewer.

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