Megatest

Check-in [eadcceede0]
Login
Overview
Comment:More stuff for the possible testdata split
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | testdata
Files: files | file ages | folders
SHA1: eadcceede081cd64ec737c5d119c7ee7f1cc4c44
User & Date: matt on 2012-03-01 23:18:32
Other Links: branch diff | manifest | tags
Context
2012-03-01
23:18
More stuff for the possible testdata split Closed-Leaf check-in: eadcceede0 user: matt tags: testdata
2012-02-28
21:28
Incrementail changes towards the test-info data split check-in: 0bdbd9ba53 user: matt tags: testdata
Changes

Modified db.scm from [b7761500bc] to [5fe32894ce].

34
35
36
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
(define *incoming-data*      '())
(define *incoming-last-time* (current-seconds))
(define *incoming-mutex*     (make-mutex))
(define *cache-on* #f)

(define (open-db) ;;  (conc *toppath* "/megatest.db") (car *configinfo*)))
  (let* ((dbpath    (conc *toppath* "/megatest.db")) ;; fname)
         (tdatpath  (conc *toppath* "/test_info.db")))
	 (dbexists  (file-exists? dbpath)
         (tdatexists (file-exists? tdatpath))
	 (db        (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath))
	 (handler   (make-busy-timeout 36000)))
    (sqlite3:set-busy-handler! db handler)
    (if (not dbexists)
	(db:initialize db))
     (cond
	((and (not tdataexists)(not dbexists))
	 (let ((tdb (db:initialize-test-data-db)))
	   (sqlite3:finalize! tdb)))
	((not tdataexists)
	 (db:migrate-to-testdata db)))
    (db:attach-testdata db)
     db))

;; Migrate data from tests table to testinfo
(define (db:migrate-to-test-info db)
  ;; first create the new db and open it
  (let ((tdb (db:initialize-test-data-db))
	(tbldef (lambda (tname)(conc "CREATE TABLE IF NOT EXISTS " tname "
                    (id INTEGER PRIMARY KEY,







|
|
|





|
|
|
|
|
|

|







34
35
36
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
(define *incoming-data*      '())
(define *incoming-last-time* (current-seconds))
(define *incoming-mutex*     (make-mutex))
(define *cache-on* #f)

(define (open-db) ;;  (conc *toppath* "/megatest.db") (car *configinfo*)))
  (let* ((dbpath    (conc *toppath* "/megatest.db")) ;; fname)
         (tdatpath  (conc *toppath* "/test_info.db"))
	 (dbexists  (file-exists? dbpath))
         (tdataexists (file-exists? tdatpath))
	 (db        (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath))
	 (handler   (make-busy-timeout 36000)))
    (sqlite3:set-busy-handler! db handler)
    (if (not dbexists)
	(db:initialize db))
    (cond
     ((and (not tdataexists)(not dbexists))
      (let ((tdb (db:initialize-test-data-db)))
	(sqlite3:finalize! tdb)))
     ((not tdataexists)
      (db:migrate-to-testdata db)))
    (db:attach-testdata db)
    db))

;; Migrate data from tests table to testinfo
(define (db:migrate-to-test-info db)
  ;; first create the new db and open it
  (let ((tdb (db:initialize-test-data-db))
	(tbldef (lambda (tname)(conc "CREATE TABLE IF NOT EXISTS " tname "
                    (id INTEGER PRIMARY KEY,