Overview
Comment: | Added wrapper for open-run-close of db and applied to all in execute section |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | test-specific-db |
Files: | files | file ages | folders |
SHA1: |
d092880d3126f62c3032268c016215e6 |
User & Date: | mrwellan on 2012-09-21 15:46:59 |
Other Links: | branch diff | manifest | tags |
Context
2012-09-21
| ||
16:30 | Launching code changed to open-run-close the db check-in: 784ff21f6c user: mrwellan tags: test-specific-db | |
15:46 | Added wrapper for open-run-close of db and applied to all in execute section check-in: d092880d31 user: mrwellan tags: test-specific-db | |
14:38 | Cleaned up most fallout from migration to test specific data file check-in: 94f8ba30bd user: mrwellan tags: test-specific-db | |
Changes
Modified db.scm from [2653e20858] to [cfb0529798].
︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + + + + + + | (db:initialize db)) ;; (if (config-lookup *configdat* "setup" "synchronous") ;; (begin ;; (debug:print 4 "INFO: Turning off pragma synchronous") ;; (sqlite3:execute db "PRAGMA synchronous = 0;")) ;; (debug:print 4 "INFO: NOT turning off pragma synchronous")) db)) (define (open-run-close proc idb . params) (let* ((db (if idb idb (open-db))) (res (apply proc db params))) (if (not idb)(sqlite3:finalize! db)) res)) (define (db:initialize db) (let* ((configdat (car *configinfo*)) ;; tut tut, global warning... (keys (config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys))) |
︙ | |||
1024 1025 1026 1027 1028 1029 1030 | 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | - + | (define (db:read-test-data db test-id categorypatt) (let ((tdb (db:open-test-db-by-test-id db test-id))) (if tdb (let ((res '())) (sqlite3:for-each-row (lambda (id test_id category variable value expected tol units comment status type) (set! res (cons (vector id test_id category variable value expected tol units comment status type) res))) |
︙ |
Modified launch.scm from [908cebfd40] to [56945cc56b].
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - - | (itemdat (assoc/default 'itemdat cmdinfo)) (env-ovrd (assoc/default 'env-ovrd cmdinfo)) (set-vars (assoc/default 'set-vars cmdinfo)) ;; pre-overrides from -setvar (runname (assoc/default 'runname cmdinfo)) (megatest (assoc/default 'megatest cmdinfo)) (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) (fullrunscript (if runscript (conc testpath "/" runscript) #f)) |
︙ | |||
94 95 96 97 98 99 100 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + - - - - - + - - - - - + - + - - + + | (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") ;; (sqlite3:finalize! db) ;; (sqlite3:finalize! tdb) (exit 1))) (change-directory *toppath*) |
︙ | |||
153 154 155 156 157 158 159 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + - - - | (thread-sleep! 2) (loop (+ i 1))) ))))) ;; then, if runscript ran ok (or did not get called) ;; do all the ezsteps (if any) (if ezsteps (let* ((testconfig (read-config (conc work-area "/testconfig") #f #t environ-patt: "pre-launch-env-vars")) ;; FIXME??? is allow-system ok here? |
︙ | |||
190 191 192 193 194 195 196 | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | - + - + - + | ;; (set! script (conc script "source " prev-env)))) ;; call the command using mt_ezstep (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "-") " " stepcmd)) (debug:print 4 "script: " script) |
︙ | |||
232 233 234 235 236 237 238 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - + - + - + | (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used " this-step-status: " this-step-status " overall-status: " overall-status " next-status: " next-status " rollup-status: " rollup-status) (case next-status ((warn) (set! rollup-status 2) ;; NB// test-set-status! does rdb calls under the hood |
︙ | |||
264 265 266 267 268 269 270 | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | - - + + | ;; (diskfree (get-df (current-directory))) ;; (tmpfree (get-df "/tmp"))) (begin ;; (if (not (args:get-arg "-server")) ;; (server:client-setup db)) ;; (if (not cpuload) (begin (debug:print 0 "WARNING: CPULOAD not found.") (set! cpuload "n/a"))) ;; (if (not diskfree) (begin (debug:print 0 "WARNING: DISKFREE not found.") (set! diskfree "n/a"))) |
︙ | |||
289 290 291 292 293 294 295 | 276 277 278 279 280 281 282 283 284 285 286 287 288 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 | - + - - + - + | (begin (debug:print 0 "Killing " (cadr parts) "; kill -9 " p-id) (system (conc "kill -9 " p-id)))))) (car processes)) (system (conc "kill -9 " pid)))) (begin (debug:print 0 "WARNING: Request received to kill job but problem with process, attempting to kill manager process") |
︙ | |||
337 338 339 340 341 342 343 | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | - + | ((eq? rollup-status 2) ;; if the current status is AUTO the defer to the calculated value but qualify (i.e. make this AUTO-WARN) (if (equal? (db:test-get-status testinfo) "AUTO") "AUTO-WARN" "WARN")) (else "FAIL")) (args:get-arg "-m") #f))) ;; for automated creation of the rollup html file this is a good place... (if (not (equal? item-path "")) |
︙ |
Modified runs.scm from [60fd9683ee] to [d1cf09ce49].
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - | runnamepatt) (vector header res))) (define (runs:test-get-full-path test) (let* ((testname (db:test-get-testname test)) (itempath (db:test-get-item-path test))) (conc testname (if (equal? itempath "") "" (conc "(" itempath ")"))))) |
︙ |
Modified tests/tests.scm from [fdee90c537] to [403df89532].
︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + + + | (test "get all legal tests" (list "test1" "test2") (sort (get-all-legal-tests) string<=?)) (test "register-test, test info" "NOT_STARTED" (begin (tests:register-test *db* 1 "nada" "") (vector-ref (db:get-test-info *db* 1 "nada" "") 3))) (test #f "NOT_STARTED" (begin (open-run-close tests:register-test #f 1 "nada" "") (vector-ref (open-run-close db:get-test-info #f 1 "nada" "") 3))) (test "get-keys" "SYSTEM" (vector-ref (car (db:get-keys *db*)) 0));; (key:get-fieldname (car (sort (db-get-keys *db*)(lambda (a b)(string>=? (vector-ref a 0)(vector-ref b 0))))))) (define remargs (args:get-args '("bar" "foo" ":runname" "bob" ":sysname" "ubuntu" ":fsname" "nfs" ":datapath" "blah/foo" "nada") (list ":runname" ":state" ":status") (list "-h") |
︙ |