Overview
Comment: | Merged in logging to sqlite db code |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
427183e35c00d9b356f081212c453743 |
User & Date: | mrwellan on 2012-10-16 15:23:47 |
Other Links: | manifest | tags |
Context
2012-10-16
| ||
17:47 | Fixed case where un-runnable tests due to dependencies caused megatest to never exit check-in: b005b34ebc user: mrwellan tags: trunk | |
15:23 | Merged in logging to sqlite db code check-in: 427183e35c user: mrwellan tags: trunk | |
14:28 | Merged trunk into sqlite3-logging check-in: 13d3e653d6 user: mrwellan tags: sqlite3-logging | |
2012-10-15
| ||
15:06 | Bumped version check-in: 8b9875923e user: fdk71adm tags: trunk | |
Changes
Modified common.scm from [b1035eae27] to [cc91d853d4].
︙ | |||
35 36 37 38 39 40 41 | 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 64 65 66 67 | - + + + + + | (define *configdat* #f) (define *toppath* #f) (define *already-seen-runconfig-info* #f) (define *waiting-queue* (make-hash-table)) (define *test-meta-updated* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar |
︙ |
Modified common_records.scm from [305c308b19] to [d3914aa282].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + - - + + + + | ;;====================================================================== ;; Copyright 2006-2012, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== (define-inline (debug:print n . params) (begin |
Modified db.scm from [07bd577b13] to [e2024934a0].
︙ | |||
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | + + + + | status TEXT DEFAULT 'n/a', type TEXT DEFAULT '', CONSTRAINT test_data_constraint UNIQUE (test_id,category,variable));") ;; Must do this *after* running patch db !! No more. (db:set-var db "MEGATEST_VERSION" megatest-version) )) ;;====================================================================== ;; T E S T S P E C I F I C D B ;;====================================================================== ;; Create the sqlite db for the individual test(s) (define (open-test-db testpath) (if (and (directory? testpath) (file-read-access? testpath)) (let* ((dbpath (conc testpath "/testdat.db")) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) |
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 296 297 298 | 289 290 291 292 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 320 321 322 323 324 325 326 327 | + + + + + + + + + + + + + + + + + + + + + + + + + | ;; the ackstate is set to 1 once the command has been completed "CREATE TABLE IF NOT EXISTS test_meta ( id INTEGER PRIMARY KEY, var TEXT, val TEXT, ackstate INTEGER DEFAULT 0, CONSTRAINT metadat_constraint UNIQUE (var));"))) ;;====================================================================== ;; L O G G I N G D B ;;====================================================================== (define (open-logging-db) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) (let* ((dbpath (conc (if *toppath* (conc *toppath* "/") "") "logging.db")) ;; fname) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) (handler (make-busy-timeout (if (args:get-arg "-override-timeout") (string->number (args:get-arg "-override-timeout")) 36000)))) ;; 136000))) (sqlite3:set-busy-handler! db handler) (if (not dbexists) (begin (sqlite3:execute db "CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY,event_time TIMESTAMP DEFAULT (strftime('%s','now')),logline TEXT);") (sqlite3:execute db (conc "PRAGMA synchronous = 0;")))) db)) (define (db:log-event . loglst) (let ((db (open-logging-db)) (logline (apply conc loglst))) (sqlite3:execute db "INSERT INTO log (logline) VALUES (?);" logline) (sqlite3:finalize! db) logline)) ;;====================================================================== ;; TODO: ;; put deltas into an assoc list with version numbers ;; apply all from last to current ;;====================================================================== (define (patch-db db) |
︙ |
Modified launch.scm from [ae6bdfdb7c] to [32c9f375e7].
︙ | |||
538 539 540 541 542 543 544 | 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | - + + | (cmdparms #f) (fullcmd #f) ;; (define a (with-output-to-string (lambda ()(write x)))) (mt-bindir-path #f) (item-path (item-list->path itemdat)) (test-id (open-run-close db:get-test-id db run-id test-name item-path)) (testinfo (open-run-close db:get-test-info-by-id db test-id)) (mt_target (string-intersperse (map cadr keyvallst) "/")) |
︙ |
Modified megatest.scm from [0d217d1188] to [028bf7b036].
︙ | |||
212 213 214 215 216 217 218 219 220 221 222 223 224 225 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | + + | ((args:get-arg "-q") 0) (else 1))) (if (not (number? *verbosity*)) (begin (print "ERROR: Invalid debug value " (args:get-arg "-debug")) (exit))) (if (args:get-arg "-logging")(set! *logging* #t)) (if (> *verbosity* 3) ;; we are obviously debugging (set! open-run-close open-run-close-no-exception-handling)) ;; to try and not burden Kim too much... (if (args:get-arg "-itempatt") (let ((old-testpatt (args:get-arg "-testpatt"))) |
︙ |
Modified server.scm from [5d7f3edf83] to [d8295b1488].
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + | (hostname (if (string=? "-" hostn) (get-host-name) hostn)) (ipaddrstr (if (string=? "-" hostn) (string-intersperse (map number->string (u8vector->list (hostname->ip hostname))) ".") #f)) (host:port (conc (if ipaddrstr ipaddrstr hostname) ":" (rpc:default-server-port)))) (debug:print 0 "Server started on " host:port) (db:set-var db "SERVER" host:port) (set! *cache-on* #t) ;; can use this to run most anything at the remote (rpc:publish-procedure! 'remote:run (lambda (procstr . params) |
︙ | |||
134 135 136 137 138 139 140 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | - + | (mutex-unlock! *incoming-mutex*) (if (> queue-len 0) (begin (debug:print 0 "INFO: Queue not flushed, waiting ...") (loop (+ n 1))))) ))) (thread-start! th1) |
︙ | |||
169 170 171 172 173 174 175 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - - + + | (define (server:find-free-port-and-open port) (handle-exceptions exn (begin (print "Failed to bind to port " (rpc:default-server-port) ", trying next port") (server:find-free-port-and-open (+ port 1))) (rpc:default-server-port port) |
︙ |
Modified tests/tests.scm from [4294e642fa] to [d970f073ac].
︙ | |||
305 306 307 308 309 310 311 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + | ("COMPLETED" "PASS" #f) ("NOT_STARTED" "FAIL" "Just testing") ("KILLED" "UNKNOWN" "More testing") ("KILLED" "UNKNOWN" "More testing") )) ;; now set all tests to completed (rdb:flush-queue) |
︙ |