Overview
Comment: | Got -import-megatest.db working |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | inmem-per-run-db |
Files: | files | file ages | folders |
SHA1: |
4af84cb81948c98a6f99459a0222ddc4 |
User & Date: | matt on 2013-11-30 09:24:30 |
Other Links: | branch diff | manifest | tags |
Context
2013-11-30
| ||
10:12 | Force sync for now check-in: eac279e14a user: matt tags: inmem-per-run-db | |
09:24 | Got -import-megatest.db working check-in: 4af84cb819 user: matt tags: inmem-per-run-db | |
08:15 | Still hosed check-in: cfb597082f user: matt tags: inmem-per-run-db | |
Changes
Modified api.scm from [408545c812] to [a5a1f9f0f0].
︙ | |||
68 69 70 71 72 73 74 | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + | ((login) (apply db:login dbstruct params)) ((general-call) (let ((stmtname (car params)) (run-id (cadr params)) (realparams (cddr params))) (db:with-db dbstruct run-id #t ;; these are all for modifying the db (lambda (db) (db:general-call db stmtname realparams))))) |
︙ |
Modified db.scm from [2cba8158d4] to [aabc9033ad].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | + + - - - - - - + + + + + + | db)))) ;; mod-read: ;; 'mod modified data ;; 'read read data ;; (define (db:done-with dbstruct run-id mod-read) (if (not (sqlite3:database? dbstruct)) (begin |
︙ | |||
200 201 202 203 204 205 206 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - + - - + + - - + + + + | (if (not dbexists) (begin (db:initialize-main-db db) (db:initialize-run-id-db db))) db)) ;; sync all touched runs to disk |
︙ | |||
251 252 253 254 255 256 257 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | - - + + - + - + | '("id" #f) '("run_id" #f) '("testname" #f) '("host" #f) '("cpuload" #f) '("diskfree" #f) '("uname" #f) |
︙ | |||
289 290 291 292 293 294 295 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | '("units" #f) '("comment" #f) '("status" #f) '("type" #f)))) ;; needs db to get keys, this is for syncing all tables ;; |
︙ | |||
426 427 428 429 430 431 432 | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | - - - | (count (cdr dat))) (set! tot-count (+ tot-count count)) (if (> count 0) (debug:print 0 (format #f " ~10a ~5a" tblname count))))) (sort (hash-table->alist numrecs)(lambda (a b)(> (cdr a)(cdr b)))))) tot-count)) |
︙ | |||
1423 1424 1425 1426 1427 1428 1429 | 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 | + + - - - - - - - - - - + + + + + + + + + + | res))) (db:get-db dbstruct run-id) (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE run_id=?;") run-id) res)) (define (db:replace-test-records dbstruct run-id testrecs) (db:with-db dbstruct run-id #t (lambda (db) |
︙ |
Modified db_records.scm from [1641bf9d8d] to [832e173195].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - - + + - + | (define-inline (dbr:dbstruct-set-local! vec val)(vector-set! vec 4 val)) ;; get a rundb vector, create it if not already existing (define (dbr:dbstruct-get-rundb-rec vec run-id) (let* ((dbhash (dbr:dbstruct-get-dbhash vec)) ;; get the runs hash (runvec (hash-table-ref/default dbhash run-id #f))) ;; get the vector for run-id (if (vector? runvec) |
︙ |
Modified megatest.scm from [c3002b1e2f] to [ef3627057f].
︙ | |||
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 | 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | + + | (set! *didsomething* #t))) (if (args:get-arg "-import-megatest.db") (let* ((toppath (setup-for-run)) (dbstruct (if toppath (make-dbr:dbstruct path: toppath) #f)) (mtdb (if toppath (db:open-megatest-db))) (run-ids (if toppath (db:get-run-ids mtdb)))) ;; sync runs, test_meta etc. (db:sync-tables (db:sync-main-list mtdb) mtdb (db:get-db dbstruct #f)) (for-each (lambda (run-id) (let ((testrecs (db:get-all-tests-info-by-run-id mtdb run-id))) (debug:print 0 "INFO: Updating " (length testrecs) " records for run-id=" run-id) (db:replace-test-records dbstruct run-id testrecs))) run-ids) (set! *didsomething* #t) |
︙ |