VirtualBox

Changeset 61474 in vbox


Ignore:
Timestamp:
Jun 5, 2016 9:02:01 PM (8 years ago)
Author:
vboxsync
Message:

testmanager: Preparting TestSets for TestBoxes belonging to more than one scheduling group by storing the idSchedGroup in TestSets as well (this has a slight speed up effect on grouping results by scheduling group too of course). The idSchedGroup column in TestBoxes will be changed into a M:N table later some time. Also corrected a typo regarding orphaned tests.

Location:
trunk/src/VBox/ValidationKit
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/docs/AutomaticTestingRevamp.html

    r59549 r61474  
    946946<li><p class="first">If the testbox was marked as disabled, respond with an IDLE command to the
    947947testbox [done]. (Note! Must do this after TestBoxStatuses maintainance from
    948 point 2, or abandond tests won't be cleaned up after a testbox is disabled.)</p>
     948point 2, or abandoned tests won't be cleaned up after a testbox is disabled.)</p>
    949949</li>
    950950<li><p class="first">Consider testcases in the scheduling queue, pick the first one which the
     
    10991099<p>TODO</p>
    11001100</div>
    1101 <div class="section" id="cleaning-up-abandond-testcase">
    1102 <h2>#9 - Cleaning Up Abandond Testcase</h2>
     1101<div class="section" id="cleaning-up-abandoned-testcase">
     1102<h2>#9 - Cleaning Up Abandoned Testcase</h2>
    11031103<p>This is a subfunction of scenario #1 and #2.  The actions taken are the same in
    11041104both situations.  The precondition for taking this path is that the row in the
     
    11101110<dd><ol class="first last loweralpha simple">
    11111111<li>Add a message to the root TestResults row, creating one if necesary,
    1112 that explains that the test was abandond.  This is done
     1112that explains that the test was abandoned.  This is done
    11131113by inserting/finding the string into/in TestResultStrTab and adding
    11141114a row to TestResultMsgs with idStrMsg set to that string id and
     
    11291129<h2>#10 - Cleaning Up a Disabled/Dead TestBox</h2>
    11301130<p>The UI needs to be able to clean up the remains of a testbox which for some
    1131 reason is out of action.  Normal cleaning up of abandond testcases requires
     1131reason is out of action.  Normal cleaning up of abandoned testcases requires
    11321132that the testbox signs on or asks for work, but if the testbox is dead or
    11331133in some way indisposed, it won't be doing any of that.  So, the testbox
  • trunk/src/VBox/ValidationKit/docs/AutomaticTestingRevamp.txt

    r59549 r61474  
    6356353. If the testbox was marked as disabled, respond with an IDLE command to the
    636636   testbox [done]. (Note! Must do this after TestBoxStatuses maintainance from
    637    point 2, or abandond tests won't be cleaned up after a testbox is disabled.)
     637   point 2, or abandoned tests won't be cleaned up after a testbox is disabled.)
    638638
    6396394. Consider testcases in the scheduling queue, pick the first one which the
     
    784784
    785785
    786 #9 - Cleaning Up Abandond Testcase
    787 ----------------------------------
     786#9 - Cleaning Up Abandoned Testcase
     787-----------------------------------
    788788
    789789This is a subfunction of scenario #1 and #2.  The actions taken are the same in
     
    7967961. If the testset is incomplete, we need to completed:
    797797        a) Add a message to the root TestResults row, creating one if necesary,
    798            that explains that the test was abandond.  This is done
     798           that explains that the test was abandoned.  This is done
    799799           by inserting/finding the string into/in TestResultStrTab and adding
    800800           a row to TestResultMsgs with idStrMsg set to that string id and
     
    813813
    814814The UI needs to be able to clean up the remains of a testbox which for some
    815 reason is out of action.  Normal cleaning up of abandond testcases requires
     815reason is out of action.  Normal cleaning up of abandoned testcases requires
    816816that the testbox signs on or asks for work, but if the testbox is dead or
    817817in some way indisposed, it won't be doing any of that.  So, the testbox
  • trunk/src/VBox/ValidationKit/testmanager/batch/close_orphaned_testsets.py

    r56295 r61474  
    7272            # Complete them.
    7373            if self.oConfig.fJustDoIt:
    74                 print 'Completing %u test sets as abandond:' % (len(aoOrphans),);
     74                print 'Completing %u test sets as abandoned:' % (len(aoOrphans),);
    7575                for oTestSet in aoOrphans:
    7676                    print '#%-7u: idTestBox=%-3u tsCreated=%s tsDone=%s' \
    7777                        % (oTestSet.idTestSet, oTestSet.idTestBox, oTestSet.tsCreated, oTestSet.tsDone);
    78                     oLogic.completeAsAbandond(oTestSet.idTestSet);
     78                    oLogic.completeAsAbandoned(oTestSet.idTestSet);
    7979                print 'Committing...';
    8080                oDb.commit();
  • trunk/src/VBox/ValidationKit/testmanager/core/schedulerbase.py

    r61220 r61474  
    884884                          '             idGenTestBox,\n'
    885885                          '             idTestBox,\n'
     886                          '             idSchedGroup,\n'
    886887                          '             idTestGroup,\n'
    887888                          '             idGenTestCase,\n'
     
    900901                          '             %s,\n'      # idGenTestBox
    901902                          '             %s,\n'      # idTestBox
     903                          '             %s,\n'      # idSchedGroup
    902904                          '             %s,\n'      # idTestGroup
    903905                          '             %s,\n'      # idGenTestCase
     
    916918                              oTestBoxData.idGenTestBox,
    917919                              oTestBoxData.idTestBox,
     920                              oTestBoxData.idSchedGroup,
    918921                              oTask.idTestGroup,
    919922                              oTestEx.oTestCase.idGenTestCase,
     
    10441047                fDecision = oEntry.getPreReqDecision(sPreReqSet);
    10451048                if fDecision is None:
    1046                     ## @todo DB Tuning
    10471049                    # Check for missing prereqs.
    10481050                    self._oDb.execute('SELECT   COUNT(*)\n'
    10491051                                      'FROM     (VALUES ' + sPreReqSet + ') AS PreReqs(idTestCase)\n'
    1050                                       'LEFT OUTER JOIN (SELECT  *\n'
     1052                                      'LEFT OUTER JOIN (SELECT  idTestSet\n'
    10511053                                      '                 FROM    TestSets\n'
    10521054                                      '                 WHERE   enmStatus IN (%s, %s)\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/systemlog.py

    r56295 r61474  
    4646    ksEvent_CmdNacked           = 'CmdNack ';
    4747    ksEvent_TestBoxUnknown      = 'TBoxUnkn';
    48     ksEvent_TestSetAbandond     = 'TSetAbdd';
     48    ksEvent_TestSetAbandoned    = 'TSetAbdd';
    4949    ksEvent_UserAccountUnknown  = 'TAccUnkn';
    5050    ksEvent_XmlResultMalformed  = 'XmlRMalf';
     
    5757        ksEvent_CmdNacked,
    5858        ksEvent_TestBoxUnknown,
    59         ksEvent_TestSetAbandond,
     59        ksEvent_TestSetAbandoned,
    6060        ksEvent_UserAccountUnknown,
    6161        ksEvent_XmlResultMalformed,
  • trunk/src/VBox/ValidationKit/testmanager/core/testboxcontroller.py

    r61468 r61474  
    273273        Cleans up any old test set that may be left behind and changes the
    274274        state to 'idle'.  See scenario #9:
    275         file://../../docs/AutomaticTestingRevamp.html#cleaning-up-abandond-testcase
     275        file://../../docs/AutomaticTestingRevamp.html#cleaning-up-abandoned-testcase
    276276
    277277        Note. oStatusData.enmState is set to idle, but tsUpdated is not changed.
    278278        """
    279279
    280         # Cleanup any abandond test.
     280        # Cleanup any abandoned test.
    281281        if oStatusData.idTestSet is not None:
    282             SystemLogLogic(oDb).addEntry(SystemLogData.ksEvent_TestSetAbandond,
     282            SystemLogLogic(oDb).addEntry(SystemLogData.ksEvent_TestSetAbandoned,
    283283                                         "idTestSet=%u idTestBox=%u enmState=%s %s"
    284284                                         % (oStatusData.idTestSet, oStatusData.idTestBox,
    285285                                            oStatusData.enmState, self._sAction),
    286286                                         fCommit = False);
    287             TestSetLogic(oDb).completeAsAbandond(oStatusData.idTestSet, fCommit = False);
     287            TestSetLogic(oDb).completeAsAbandoned(oStatusData.idTestSet, fCommit = False);
    288288            GlobalResourceLogic(oDb).freeGlobalResourcesByTestBox(self._idTestBox, fCommit = False);
    289289
  • trunk/src/VBox/ValidationKit/testmanager/core/testresults.py

    r61470 r61474  
    799799            { ksResultsSortByBuildRevision: ( '', None,  ' Builds.iRevision DESC' ), }
    800800        ),
    801         ksResultsGroupingTypeSchedGroup: (
    802             ', TestBoxesWithStrings',
    803             'TestBoxesWithStrings.idSchedGroup',
    804             ' AND TestSets.idGenTestBox = TestBoxesWithStrings.idGenTestBox',
    805             {
    806 
    807               ksResultsSortByTestBoxName: (
    808                   # Sorting tables.
    809                   '',
    810                   # Sorting table join(s).
    811                   None,
    812                   # Start of ORDER BY statement.
    813                   ' TestBoxesWithStrings.sName DESC',
    814                   # Extra columns to fetch for the above ORDER BY to work in a SELECT DISTINCT statement.
    815                   '',
    816                   # Columns for the GROUP BY
    817                   '' ),
    818               ksResultsSortByTestBoxOsArch:     ( '', None, ' TestBoxesWithStrings.sOs, TestBoxesWithStrings.sCpuArch', '', '' ),
    819               ksResultsSortByTestBoxOs:         ( '', None, ' TestBoxesWithStrings.sOs', '', ''  ),
    820               ksResultsSortByTestBoxOsVersion:  ( '', None, ' TestBoxesWithStrings.sOs, TestBoxesWithStrings.sOsVersion DESC',
    821                                                   '', '' ),
    822               ksResultsSortByTestBoxArch:       ( '', None, ' TestBoxesWithStrings.sCpuArch', '', ''  ),
    823               ksResultsSortByTestBoxCpuVendor:  ( '', None, ' TestBoxesWithStrings.sCpuVendor', '', ''  ),
    824               ksResultsSortByTestBoxCpuName:    ( '', None, ' TestBoxesWithStrings.sCpuVendor, TestBoxesWithStrings.sCpuName',
    825                                                   '', '' ),
    826               ksResultsSortByTestBoxCpuRev: (
    827                   '',
    828                   None,
    829                   ' TestBoxesWithStrings.sCpuVendor, TestBoxesWithStrings.lCpuRevision DESC',
    830                   ', TestBoxesWithStrings.lCpuRevision',
    831                   ', TestBoxesWithStrings.lCpuRevision' ),
    832               ksResultsSortByTestBoxCpuFeatures: (
    833                   '',
    834                   None,
    835                   ' TestBoxesWithStrings.fCpuHwVirt DESC, TestBoxesWithStrings.fCpuNestedPaging DESC, '
    836                   +'TestBoxesWithStrings.fCpu64BitGuest DESC, TestBoxesWithStrings.cCpus DESC',
    837                   '',
    838                   '' ), }
    839         ),
     801        ksResultsGroupingTypeSchedGroup: ( '', 'TestSets.idSchedGroup',   None,                      {},),
    840802    };
    841803
     
    12281190
    12291191        self._oDb.execute('SELECT SchedGroups.*\n'
    1230                           'FROM   ( SELECT TestBoxes.idSchedGroup  AS idSchedGroup,\n'
     1192                          'FROM   ( SELECT idSchedGroup,\n'
    12311193                          '                MAX(TestSets.tsCreated) AS tsNow\n'
    1232                           '         FROM   TestSets,\n'
    1233                           '                TestBoxes\n'
    1234                           '         WHERE  TestSets.idGenTestBox = TestBoxes.idGenTestBox\n'
    1235                           '            AND ' + self._getTimePeriodQueryPart(tsNow, sPeriod, '         ') +
     1194                          '         FROM   TestSets\n'
     1195                          '         WHERE  ' + self._getTimePeriodQueryPart(tsNow, sPeriod, '         ') +
    12361196                          '         GROUP BY idSchedGroup\n'
    12371197                          '       ) AS SchedGroupIDs\n'
  • trunk/src/VBox/ValidationKit/testmanager/core/testset.py

    r61468 r61474  
    7979    ksParam_idGenTestBox        = 'TestSet_idGenTestBox';
    8080    ksParam_idTestBox           = 'TestSet_idTestBox';
     81    ksParam_idSchedGroup        = 'TestSet_idSchedGroup';
    8182    ksParam_idTestGroup         = 'TestSet_idTestGroup';
    8283    ksParam_idGenTestCase       = 'TestSet_idGenTestCase';
     
    8990    ksParam_idTestSetGangLeader = 'TestSet_idTestSetGangLeader';
    9091
    91     kasAllowNullAttributes      = ['tsDone', 'idBuildTestSuite', 'idTestSetGangLeader' ];
     92    kasAllowNullAttributes      = [ 'tsDone', 'idBuildTestSuite', 'idTestSetGangLeader' ];
    9293    kasValidValues_enmStatus    = [
    9394        ksTestStatus_Running,
     
    104105
    105106
     107    kcDbColumns                 = 20;
     108
    106109    def __init__(self):
    107110        ModelDataBase.__init__(self);
     
    121124        self.idGenTestBox           = None;
    122125        self.idTestBox              = None;
     126        self.idSchedGroup           = None;
    123127        self.idTestGroup            = None;
    124128        self.idGenTestCase          = None;
     
    150154        self.idGenTestBox           = aoRow[8];
    151155        self.idTestBox              = aoRow[9];
    152         self.idTestGroup            = aoRow[10];
    153         self.idGenTestCase          = aoRow[11];
    154         self.idTestCase             = aoRow[12];
    155         self.idGenTestCaseArgs      = aoRow[13];
    156         self.idTestCaseArgs         = aoRow[14];
    157         self.idTestResult           = aoRow[15];
    158         self.sBaseFilename          = aoRow[16];
    159         self.iGangMemberNo          = aoRow[17];
    160         self.idTestSetGangLeader    = aoRow[18];
     156        self.idSchedGroup           = aoRow[10];
     157        self.idTestGroup            = aoRow[11];
     158        self.idGenTestCase          = aoRow[12];
     159        self.idTestCase             = aoRow[13];
     160        self.idGenTestCaseArgs      = aoRow[14];
     161        self.idTestCaseArgs         = aoRow[15];
     162        self.idTestResult           = aoRow[16];
     163        self.sBaseFilename          = aoRow[17];
     164        self.iGangMemberNo          = aoRow[18];
     165        self.idTestSetGangLeader    = aoRow[19];
    161166        return self;
    162167
     
    443448        return oData.idTestSetGangLeader;
    444449
    445     def completeAsAbandond(self, idTestSet, fCommit = False):
     450    def completeAsAbandoned(self, idTestSet, fCommit = False):
    446451        """
    447452        Completes the testset as abandoned if necessary.
  • trunk/src/VBox/ValidationKit/testmanager/db/TestManagerDatabaseInit.pgsql

    r61472 r61474  
    5959--                  AND sEvent = 'TBoxUnkn'
    6060--                  AND sLogText = :sNewLogText;
    61 --      - When cleaning up an abandond testcase (scenario #9), log which
    62 --        testbox abandond which testset.
     61--      - When cleaning up an abandoned testcase (scenario #9), log which
     62--        testbox abandoned which testset.
    6363--
    6464-- The Web UI will have some way of displaying the log.
     
    16051605    -- Non-unique foreign key: TestBoxes(idTestBox)
    16061606    idTestBox           INTEGER     NOT NULL,
     1607    --- The scheduling group ID the test was scheduled thru (valid: tsStarted).
     1608    -- Non-unique foreign key: SchedGroups(idSchedGroup)
     1609    idSchedGroup        INTEGER     NOT NULL,
    16071610
    16081611    --- The testgroup (valid: tsConfig).
     
    16641667CREATE INDEX TestSetsGraphBoxIdx    ON TestSets (idTestBox, tsCreated DESC, tsDone ASC NULLS LAST, idBuildCategory, idTestCase);
    16651668
    1666 ALTER TABLE TestResults      ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
    1667 ALTER TABLE TestResultValues ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
    1668 ALTER TABLE TestResultFiles  ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
    1669 ALTER TABLE TestResultMsgs   ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
    1670 ALTER TABLE TestResultFailures ADD CONSTRAINT idTestSetFk FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
     1669ALTER TABLE TestResults        ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
     1670ALTER TABLE TestResultValues   ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
     1671ALTER TABLE TestResultFiles    ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
     1672ALTER TABLE TestResultMsgs     ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
     1673ALTER TABLE TestResultFailures ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
    16711674
    16721675
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