Changeset 69448 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Oct 27, 2017 4:57:29 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 118783
- Location:
- trunk/src/VBox/ValidationKit/testmanager/db
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/db/TestManagerDatabaseComments.pgsql
r65914 r69448 1 -- $Id$ 2 --- @file 3 -- Autogenerated from TestManagerDatabaseInit.pgsql. Do not edit! 4 -- 5 6 -- 7 -- Copyright (C) 2012-2017 Oracle Corporation 8 -- 9 -- This file is part of VirtualBox Open Source Edition (OSE), as 10 -- available from http://www.virtualbox.org. This file is free software; 11 -- you can redistribute it and/or modify it under the terms of the GNU 12 -- General Public License (GPL) as published by the Free Software 13 -- Foundation, in version 2 as it comes in the "COPYING" file of the 14 -- VirtualBox OSE distribution. VirtualBox OSE is distributed in the 15 -- hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 -- 17 -- The contents of this file may alternatively be used under the terms 18 -- of the Common Development and Distribution License Version 1.0 19 -- (CDDL) only, as it comes in the "COPYING.CDDL" file of the 20 -- VirtualBox OSE distribution, in which case the provisions of the 21 -- CDDL are applicable instead of those of the GPL. 22 -- 23 -- You may elect to license modified versions of this file under the 24 -- terms and conditions of either the GPL or the CDDL or both. 25 -- 26 27 1 28 COMMENT ON COLUMN SystemLog.tsCreated IS 2 29 'When this was logged.'; … … 1363 1390 to figure out whether to remain in ''gather-gang''::TestBoxState_T.'; 1364 1391 1365 -
trunk/src/VBox/ValidationKit/testmanager/db/TestManagerDatabaseInit.pgsql
r69111 r69448 693 693 -- 694 694 -- This is a string cache for all string members in TestBoxes except the name. 695 -- The rational is to avoid duplicating large strings like sReport when the 696 -- testbox reports a new cMbScratch value or the box when the test sheriff 697 -- sends a reboot command or similar. 698 -- 699 -- At the time this table was introduced, we had 400558 TestBoxes rows, where 695 -- The rational is to avoid duplicating large strings like sReport when the 696 -- testbox reports a new cMbScratch value or the box when the test sheriff 697 -- sends a reboot command or similar. 698 -- 699 -- At the time this table was introduced, we had 400558 TestBoxes rows, where 700 700 -- the SUM(LENGTH(sReport)) was 993MB. There were really just 1066 distinct 701 701 -- sReport values, with a total length of 0x3 MB. … … 1171 1171 PRIMARY KEY (idBlacklisting, tsExpire) 1172 1172 ); 1173 CREATE INDEX BuildBlacklistIdx ON BuildBlacklist (iLastRevision DESC, iFirstRevision ASC, sProduct, sBranch, 1173 CREATE INDEX BuildBlacklistIdx ON BuildBlacklist (iLastRevision DESC, iFirstRevision ASC, sProduct, sBranch, 1174 1174 tsExpire DESC, tsEffective ASC); 1175 1175 … … 1445 1445 CREATE INDEX TestResultsNameIdx2 ON TestResults (idTestResult, idStrName); 1446 1446 1447 ALTER TABLE TestResultFailures ADD CONSTRAINT TestResultFailures_idTestResult_idTestSet_fkey 1447 ALTER TABLE TestResultFailures ADD CONSTRAINT TestResultFailures_idTestResult_idTestSet_fkey 1448 1448 FOREIGN KEY (idTestResult, idTestSet) REFERENCES TestResults(idTestResult, idTestSet) MATCH FULL; 1449 1449 -
trunk/src/VBox/ValidationKit/testmanager/db/TestManagerVBoxPilot-1.pgsql
r69111 r69448 50 50 INSERT INTO SchedGroups (sName, sDescription, fEnabled, idBuildSrc, idBuildSrcTestSuite) 51 51 VALUES ('VirtualBox Trunk', NULL, TRUE, 52 (SELECT idBuildSrc FROM BuildSources WHERE sName = 'VBox trunk builds'), 52 (SELECT idBuildSrc FROM BuildSources WHERE sName = 'VBox trunk builds'), 53 53 (SELECT idBuildSrc FROM BuildSources WHERE sName = 'VBox TestSuite trunk builds') ); 54 54 \set idSchedGroupQuery '(SELECT idSchedGroup FROM SchedGroups WHERE sName = \'VirtualBox Trunk\')' … … 80 80 -- 81 81 INSERT INTO TestCases (uidAuthor, sName, fEnabled, cSecTimeout, sBaseCmd, sTestSuiteZips) 82 VALUES (:idUserQuery, 'VBox install', TRUE, 600, 83 'validationkit/testdriver/vboxinstaller.py --vbox-build @BUILD_BINARIES@ @ACTION@ -- testdriver/base.py @ACTION@', 82 VALUES (:idUserQuery, 'VBox install', TRUE, 600, 83 'validationkit/testdriver/vboxinstaller.py --vbox-build @BUILD_BINARIES@ @ACTION@ -- testdriver/base.py @ACTION@', 84 84 '@VALIDATIONKIT_ZIP@'); 85 85 INSERT INTO TestCaseArgs (idTestCase, uidAuthor, sArgs) … … 90 90 COMMIT WORK; 91 91 92 -
trunk/src/VBox/ValidationKit/testmanager/db/gen-sql-comments.py
r69111 r69448 3 3 # $Id$ 4 4 5 """ 6 Converts doxygen style comments in SQL script to COMMENT ON statements. 7 """ 8 9 __copyright__ = \ 5 10 """ 6 11 Copyright (C) 2012-2017 Oracle Corporation … … 22 27 You may elect to license modified versions of this file under the 23 28 terms and conditions of either the GPL or the CDDL or both. 24 """25 """26 Converts doxygen style comments in SQL script to COMMENT ON statements.27 29 """ 28 30 … … 204 206 except: 205 207 return errorMsg("failed to open '%s' for reading" % (sInput,)); 208 209 # header. 210 print("-- $" "Id" "$"); 211 print("--- @file"); 212 print("-- Autogenerated from %s. Do not edit!" % (sInput,)); 213 print("--"); 214 print(""); 215 for sLine in __copyright__.split('\n'): 216 print("-- %s" % (sLine,)); 217 print(""); 218 print(""); 206 219 me = SqlDox(oFile, sInput); 207 220 return me.process(); -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r07-testresults-1.pgsql
r69111 r69448 36 36 \d+ TestResults 37 37 38 -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r11-testsets-2.pgsql
r69111 r69448 31 31 DROP INDEX TestSetsBoxIdx; 32 32 DROP INDEX TestSetsBuildIdx; 33 DROP INDEX TestSetsTestCaseIdx; 33 DROP INDEX TestSetsTestCaseIdx; 34 34 DROP INDEX TestSetsTestVarIdx; 35 35 DROP INDEX TestSetsCreated; … … 78 78 idBuild INTEGER NOT NULL, 79 79 --- The build category of idBuild when the test started. 80 -- This is for speeding up graph data collection, i.e. avoid idBuild 80 -- This is for speeding up graph data collection, i.e. avoid idBuild 81 81 -- the WHERE part of the selection. 82 82 idBuildCategory INTEGER , -- NOT NULL REFERENCES BuildCategories(idBuildCategory) … … 148 148 SELECT COUNT(*) FROM TestSets; 149 149 150 INSERT INTO NewTestSets (idTestSet, tsConfig, tsCreated, tsDone, enmStatus, idBuild, idBuildCategory, idBuildTestSuite, 151 idGenTestBox, idTestBox, idTestGroup, idGenTestCase, idTestCase, idGenTestCaseArgs, idTestCaseArgs, 150 INSERT INTO NewTestSets (idTestSet, tsConfig, tsCreated, tsDone, enmStatus, idBuild, idBuildCategory, idBuildTestSuite, 151 idGenTestBox, idTestBox, idTestGroup, idGenTestCase, idTestCase, idGenTestCaseArgs, idTestCaseArgs, 152 152 idTestResult, sBaseFilename, iGangMemberNo, idTestSetGangLeader ) 153 SELECT a.idTestSet, a.tsConfig, a.tsCreated, tsDone, a.enmStatus, a.idBuild, b.idBuildCategory, a.idBuildTestSuite, 154 a.idGenTestBox, a.idTestBox, a.idTestGroup, a.idGenTestCase, a.idTestCase, a.idGenTestCaseArgs, a.idTestCaseArgs, 153 SELECT a.idTestSet, a.tsConfig, a.tsCreated, tsDone, a.enmStatus, a.idBuild, b.idBuildCategory, a.idBuildTestSuite, 154 a.idGenTestBox, a.idTestBox, a.idTestGroup, a.idGenTestCase, a.idTestCase, a.idGenTestCaseArgs, a.idTestCaseArgs, 155 155 a.idTestResult, a.sBaseFilename, a.iGangMemberNo, a.idTestSetGangLeader 156 156 FROM TestSets a LEFT OUTER JOIN Builds b ON (a.idBuild = b.idBuild AND b.tsExpire = 'infinity'::TIMESTAMP); -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r15-index-sorting.pgsql
r69111 r69448 61 61 62 62 DROP INDEX IF EXISTS BuildBlacklistIdx; 63 CREATE INDEX BuildBlacklistIdx ON BuildBlacklist (iLastRevision DESC, iFirstRevision ASC, sProduct, sBranch, 63 CREATE INDEX BuildBlacklistIdx ON BuildBlacklist (iLastRevision DESC, iFirstRevision ASC, sProduct, sBranch, 64 64 tsExpire DESC, tsEffective ASC); 65 65 \d BuildBlacklist; -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r16-testcaseargs-1-testresultfailures-1.pgsql
r69111 r69448 91 91 TestResults tr 92 92 WHERE o.idTestResult = tr.idTestResult; 93 93 94 94 -- Add unique constraint to TestResult for our new foreign key. 95 95 ALTER TABLE TestResults ADD CONSTRAINT TestResults_idTestResult_idTestSet_key UNIQUE (idTestResult, idTestSet); 96 96 97 97 -- Restore foreign key. 98 ALTER TABLE TestResultFailures ADD CONSTRAINT TestResultFailures_idTestResult_idTestSet_fkey 98 ALTER TABLE TestResultFailures ADD CONSTRAINT TestResultFailures_idTestResult_idTestSet_fkey 99 99 FOREIGN KEY (idTestResult, idTestSet) REFERENCES TestResults(idTestResult, idTestSet) MATCH FULL; 100 100 -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r17-testresultvalues-4.pgsql
r69111 r69448 37 37 \d+ TestResultValues 38 38 39 -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r18-testresultfiles-1-testresultmsgs-1.pgsql
r69111 r69448 37 37 \set AUTOCOMMIT 0 38 38 39 40 -- 41 -- Rename the original table, drop constrains and foreign key references so we 42 -- get the right name automatic when creating the new one. 43 -- 39 40 -- 41 -- Rename the original table, drop constrains and foreign key references so we 42 -- get the right name automatic when creating the new one. 43 -- 44 44 \d+ TestResultFiles; 45 45 ALTER TABLE TestResultFiles RENAME TO OldTestResultFiles; … … 82 82 ); 83 83 84 INSERT INTO TestResultFiles ( idTestResultFile, idTestResult, idTestSet, tsCreated, idStrFile, idStrDescription, 84 INSERT INTO TestResultFiles ( idTestResultFile, idTestResult, idTestSet, tsCreated, idStrFile, idStrDescription, 85 85 idStrKind, idStrMime) 86 SELECT o.idTestResultFile, o.idTestResult, tr.idTestSet, o.tsCreated, o.idStrFile, o.idStrDescription, 86 SELECT o.idTestResultFile, o.idTestResult, tr.idTestSet, o.tsCreated, o.idStrFile, o.idStrDescription, 87 87 o.idStrKind, o.idStrMime 88 88 FROM OldTestResultFiles o, 89 89 TestResults tr 90 90 WHERE o.idTestResult = tr.idTestResult; 91 91 92 92 -- Add new indexes. 93 93 CREATE INDEX TestResultFilesIdx ON TestResultFiles(idTestResult); … … 105 105 106 106 107 -- 108 -- Rename the original table, drop constrains and foreign key references so we 109 -- get the right name automatic when creating the new one. 110 -- 107 -- 108 -- Rename the original table, drop constrains and foreign key references so we 109 -- get the right name automatic when creating the new one. 110 -- 111 111 \d+ TestResultMsgs; 112 112 ALTER TABLE TestResultMsgs RENAME TO OldTestResultMsgs; … … 134 134 135 135 INSERT INTO TestResultMsgs ( idTestResultMsg, idTestResult, idTestSet, tsCreated, idStrMsg, enmLevel) 136 SELECT o.idTestResultMsg, o.idTestResult, tr.idTestSet, o.tsCreated, o.idStrMsg, o.enmLevel 136 SELECT o.idTestResultMsg, o.idTestResult, tr.idTestSet, o.tsCreated, o.idStrMsg, o.enmLevel 137 137 FROM OldTestResultMsgs o, 138 138 TestResults tr 139 139 WHERE o.idTestResult = tr.idTestResult; 140 140 141 141 -- Add new indexes. 142 142 CREATE INDEX TestResultMsgsIdx ON TestResultMsgs(idTestResult); … … 160 160 COMMIT; 161 161 162 163 -
trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r19-testboxes-3.pgsql
r69111 r69448 43 43 LOCK TABLE TestBoxes IN ACCESS EXCLUSIVE MODE; 44 44 LOCK TABLE SchedGroupMembers IN ACCESS EXCLUSIVE MODE; 45 45 46 46 \d+ TestBoxes; 47 47 48 48 -- 49 -- Rename the table, drop foreign keys refering to it, and drop constrains 49 -- Rename the table, drop foreign keys refering to it, and drop constrains 50 50 -- within the table itself. The latter is mostly for naming and we do it 51 51 -- up front in case the database we're running against has different names 52 -- due to previous conversions. 52 -- due to previous conversions. 53 53 -- 54 54 ALTER TABLE TestBoxes RENAME TO OldTestBoxes; … … 65 65 ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_pkey; 66 66 ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_idgentestbox_key; 67 67 68 68 DROP INDEX IF EXISTS TestBoxesUuidIdx; 69 69 DROP INDEX IF EXISTS TestBoxesExpireEffectiveIdx; 70 70 71 71 -- This output should be free of index, constraints and references from other tables. 72 72 \d+ OldTestBoxes; 73 74 -- 75 -- Create the two new tables before starting data migration (don't want to spend time 73 74 -- 75 -- Create the two new tables before starting data migration (don't want to spend time 76 76 -- on converting strings just to find a typo in the TestBoxes create table syntax). 77 -- 77 -- 78 78 CREATE SEQUENCE TestBoxStrTabIdSeq 79 79 START 1 … … 251 251 -- 252 252 253 INSERT INTO TestBoxes ( 253 INSERT INTO TestBoxes ( 254 254 idTestBox, -- 0 255 255 tsEffective, -- 1 … … 278 278 fCpu64BitGuest, -- 24 279 279 fChipsetIoMmu, -- 25 280 fRawMode, -- 26 281 cMbMemory, -- 27 282 cMbScratch, -- 28 283 idStrReport, -- 29 284 iTestBoxScriptRev, -- 30 280 fRawMode, -- 26 281 cMbMemory, -- 27 282 cMbScratch, -- 28 283 idStrReport, -- 29 284 iTestBoxScriptRev, -- 30 285 285 iPythonHexVersion, -- 31 286 286 enmPendingCmd -- 32 287 287 ) 288 SELECT idTestBox, 289 tsEffective, 290 tsExpire, 291 uidAuthor, 292 idGenTestBox, 293 ip, 294 uuidSystem, 295 sName, 296 st1.idStr, 297 idSchedGroup, 298 fEnabled, 299 enmLomKind, 300 ipLom, 301 pctScaleTimeout, 288 SELECT idTestBox, 289 tsEffective, 290 tsExpire, 291 uidAuthor, 292 idGenTestBox, 293 ip, 294 uuidSystem, 295 sName, 296 st1.idStr, 297 idSchedGroup, 298 fEnabled, 299 enmLomKind, 300 ipLom, 301 pctScaleTimeout, 302 302 NULL, 303 st2.idStr, 304 st3.idStr, 305 st4.idStr, 306 st5.idStr, 303 st2.idStr, 304 st3.idStr, 305 st4.idStr, 306 st5.idStr, 307 307 st6.idStr, 308 lCpuRevision, 309 cCpus, 310 fCpuHwVirt, 311 fCpuNestedPaging, 312 fCpu64BitGuest, 313 fChipsetIoMmu, 308 lCpuRevision, 309 cCpus, 310 fCpuHwVirt, 311 fCpuNestedPaging, 312 fCpu64BitGuest, 313 fChipsetIoMmu, 314 314 NULL, 315 cMbMemory, 316 cMbScratch, 315 cMbMemory, 316 cMbScratch, 317 317 st7.idStr, 318 iTestBoxScriptRev, 319 iPythonHexVersion, 318 iTestBoxScriptRev, 319 iPythonHexVersion, 320 320 enmPendingCmd 321 321 FROM OldTestBoxes … … 333 333 334 334 -- Restore foreign key references to the table. 335 ALTER TABLE TestBoxStatuses ADD CONSTRAINT TestBoxStatuses_idGenTestBox_fkey 335 ALTER TABLE TestBoxStatuses ADD CONSTRAINT TestBoxStatuses_idGenTestBox_fkey 336 336 FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox); 337 ALTER TABLE TestSets ADD CONSTRAINT TestSets_idGenTestBox_fkey 337 ALTER TABLE TestSets ADD CONSTRAINT TestSets_idGenTestBox_fkey 338 338 FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox); 339 339 … … 345 345 \d TestBoxes; 346 346 347
Note:
See TracChangeset
for help on using the changeset viewer.