Check-in [3ca3391a4e]
Not logged in
Overview
SHA1 Hash:3ca3391a4ee5ae48d62068fe17ffd6b80e64b0b2
Date: 2011-11-26 10:16:12
User: matt
Comment:Merged reorg-runs-code to trunk
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified Makefile from [ed1fd098c50a8f43] to [6815fb2e48eda855].

1 1 2 PREFIX=. 2 PREFIX=. > 3 CSCOPTS= 3 4 4 SRCFILES = common.scm items.scm launch.scm \ 5 SRCFILES = common.scm items.scm launch.scm \ 5 ods.scm runconfig.scm server.scm configf.scm \ 6 ods.scm runconfig.scm server.scm configf.scm \ 6 db.scm keys.scm margs.scm megatest-version.scm \ 7 db.scm keys.scm margs.scm megatest-version.scm \ 7 process.scm runs.scm tasks.scm tests.scm 8 process.scm runs.scm tasks.scm tests.scm 8 9 9 GUISRCF = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm 10 GUISRCF = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm ................................................................................................................................................................................ 12 GOFILES = $(GUISRCF:%.scm=%.o) 13 GOFILES = $(GUISRCF:%.scm=%.o) 13 14 14 HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep mt_ezstep) 15 HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep mt_ezstep) 15 16 16 all : megatest dboard 17 all : megatest dboard 17 18 18 megatest: $(OFILES) megatest.o 19 megatest: $(OFILES) megatest.o 19 csc $(OFILES) megatest.o -o megatest | 20 csc $(CSCOPTS) $(OFILES) megatest.o -o megatest 20 21 21 dboard : $(OFILES) $(GOFILES) 22 dboard : $(OFILES) $(GOFILES) 22 csc $(OFILES) $(GOFILES) -o dboard 23 csc $(OFILES) $(GOFILES) -o dboard 23 24 24 # Special dependencies for the includes 25 # Special dependencies for the includes 25 db.o launch.o runs.o dashboard-tests.o dashboard-guimonitor.o monitor.o dashboar | 26 tests.o db.o launch.o runs.o dashboard-tests.o dashboard-guimonitor.o monitor.o 26 runs.o dashboard.o dashboard-tests.o : run_records.scm | 27 tests.o runs.o dashboard.o dashboard-tests.o : run_records.scm 27 keys.o db.o runs.o launch.o megatest.o : key_records.scm | 28 db.o ezsteps.o keys.o launch.o megatest.o monitor.o runs-for-ref.o runs.o tests. 28 tasks.o dashboard-tasks.o : task_records.scm | 29 tests.o tasks.o dashboard-tasks.o : task_records.scm 29 runs.o : old-runs.scm | 30 runs.o : test_records.scm 30 31 31 $(OFILES) $(GOFILES) : common_records.scm 32 $(OFILES) $(GOFILES) : common_records.scm 32 33 33 %.o : %.scm 34 %.o : %.scm 34 csc -c $< | 35 csc $(CSCOPTS) -c $< 35 36 36 $(PREFIX)/bin/megatest : megatest 37 $(PREFIX)/bin/megatest : megatest 37 @echo Installing to PREFIX=$(PREFIX) 38 @echo Installing to PREFIX=$(PREFIX) 38 cp megatest $(PREFIX)/bin/megatest 39 cp megatest $(PREFIX)/bin/megatest 39 40 40 $(HELPERS) : utils/mt_* 41 $(HELPERS) : utils/mt_* 41 cp $< $@ 42 cp $< $@

Modified configf.scm from [ef264b880e908b66] to [a8e7a14c9a72acaf].

74 (blank-l-rx _ (loop (read-line inp) curr-section 74 (blank-l-rx _ (loop (read-line inp) curr-section 75 (include-rx ( x include-file ) (begin 75 (include-rx ( x include-file ) (begin 76 (read-config include-file res al 76 (read-config include-file res al 77 (loop (read-line inp) curr-secti 77 (loop (read-line inp) curr-secti 78 (section-rx ( x section-name ) (loop (read-line inp) section-name 78 (section-rx ( x section-name ) (loop (read-line inp) section-name 79 (key-sys-pr ( x key cmd ) (if allow-system 79 (key-sys-pr ( x key cmd ) (if allow-system 80 (let ((alist (hash-table-ref/d 80 (let ((alist (hash-table-ref/d > 81 (val-proc (lambda () 81 (val (let* ((cmdres ( | 82 (let* ((cmdr 82 (status ( | 83 (stat 83 (res ( | 84 (res 84 (if (not (eq? s | 85 (if (not ( 85 (begin | 86 (begin 86 (debug:pr | 87 (deb 87 (exit 1)) | 88 (exi 88 (if (null? res) | 89 (if (null? 89 "" | 90 "" 90 (string-int | 91 (strin 91 (hash-table-set! res curr-se 92 (hash-table-set! res curr-se 92 (config:ass | 93 (config:ass > 94 > 95 > 96 > 97 93 (loop (read-line inp) curr-s 98 (loop (read-line inp) curr-s 94 (loop (read-line inp) curr-sec 99 (loop (read-line inp) curr-sec 95 (key-val-pr ( x key val ) (let* ((alist (hash-table-ref/de 100 (key-val-pr ( x key val ) (let* ((alist (hash-table-ref/de 96 (envar (and environ-patt 101 (envar (and environ-patt 97 (realval (if envar 102 (realval (if envar 98 (config:eval-st 103 (config:eval-st 99 val))) 104 val)))

Modified db.scm from [65214cf6f39701d4] to [6268431c21aa8c10].

36 (let* ((keys (config-get-fields configdat)) 36 (let* ((keys (config-get-fields configdat)) 37 (havekeys (> (length keys) 0)) 37 (havekeys (> (length keys) 0)) 38 (keystr (keys->keystr keys)) 38 (keystr (keys->keystr keys)) 39 (fieldstr (keys->key/field keys))) 39 (fieldstr (keys->key/field keys))) 40 (for-each (lambda (key) 40 (for-each (lambda (key) 41 (let ((keyn (vector-ref key 0))) 41 (let ((keyn (vector-ref key 0))) 42 (if (member (string-downcase keyn) 42 (if (member (string-downcase keyn) 43 (list "runname" "state" "status" "owner" "e | 43 (list "runname" "state" "status" "owner" "ev 44 "pass_count")) | 44 "pass_count")) 45 (begin 45 (begin 46 (print "ERROR: your key cannot be named " keyn " a 46 (print "ERROR: your key cannot be named " keyn " a 47 (system (conc "rm -f " dbpath)) 47 (system (conc "rm -f " dbpath)) 48 (exit 1))))) 48 (exit 1))))) 49 keys) 49 keys) 50 ;; (sqlite3:execute db "PRAGMA synchronous = OFF;") 50 ;; (sqlite3:execute db "PRAGMA synchronous = OFF;") 51 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS keys (id INTEGER PRIMA 51 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS keys (id INTEGER PRIMA 52 (for-each (lambda (key) 52 (for-each (lambda (key) 53 (sqlite3:execute db "INSERT INTO keys (fieldname,fieldtype 53 (sqlite3:execute db "INSERT INTO keys (fieldname,fieldtype 54 keys) 54 keys) 55 (sqlite3:execute db (conc 55 (sqlite3:execute db (conc 56 "CREATE TABLE IF NOT EXISTS runs (id INTEGER PRIMARY | 56 "CREATE TABLE IF NOT EXISTS runs (id INTEGER PRIM 57 fieldstr (if havekeys "," "") | 57 fieldstr (if havekeys "," "") 58 "runname TEXT," | 58 "runname TEXT," 59 "state TEXT DEFAULT ''," | 59 "state TEXT DEFAULT ''," 60 "status TEXT DEFAULT ''," | 60 "status TEXT DEFAULT ''," 61 "owner TEXT DEFAULT ''," | 61 "owner TEXT DEFAULT ''," 62 "event_time TIMESTAMP," | 62 "event_time TIMESTAMP," 63 "comment TEXT DEFAULT ''," | 63 "comment TEXT DEFAULT ''," 64 "fail_count INTEGER DEFAULT 0," | 64 "fail_count INTEGER DEFAULT 0," 65 "pass_count INTEGER DEFAULT 0," | 65 "pass_count INTEGER DEFAULT 0," 66 "CONSTRAINT runsconstraint UNIQUE (runname" (if have | 66 "CONSTRAINT runsconstraint UNIQUE (runname" (if h 67 (sqlite3:execute db (conc "CREATE INDEX runs_index ON runs (runname" ( 67 (sqlite3:execute db (conc "CREATE INDEX runs_index ON runs (runname" ( 68 (sqlite3:execute db 68 (sqlite3:execute db 69 "CREATE TABLE IF NOT EXISTS tests | 69 "CREATE TABLE IF NOT EXISTS tests 70 (id INTEGER PRIMARY KEY, 70 (id INTEGER PRIMARY KEY, 71 run_id INTEGER, 71 run_id INTEGER, 72 testname TEXT, 72 testname TEXT, 73 host TEXT DEFAULT 'n/a', 73 host TEXT DEFAULT 'n/a', 74 cpuload REAL DEFAULT -1, 74 cpuload REAL DEFAULT -1, 75 diskfree INTEGER DEFAULT -1, 75 diskfree INTEGER DEFAULT -1, 76 uname TEXT DEFAULT 'n/a', 76 uname TEXT DEFAULT 'n/a', ................................................................................................................................................................................ 111 owner TEXT DEFAULT '', 111 owner TEXT DEFAULT '', 112 description TEXT DEFAULT '', 112 description TEXT DEFAULT '', 113 reviewed TIMESTAMP, 113 reviewed TIMESTAMP, 114 iterated TEXT DEFAULT '', 114 iterated TEXT DEFAULT '', 115 avg_runtime REAL, 115 avg_runtime REAL, 116 avg_disk REAL, 116 avg_disk REAL, 117 tags TEXT DEFAULT '', 117 tags TEXT DEFAULT '', > 118 jobgroup TEXT DEFAULT 'default', 118 CONSTRAINT test_meta_constraint UNIQUE (testname 119 CONSTRAINT test_meta_constraint UNIQUE (testname 119 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER 120 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER 120 test_id INTEGER, 121 test_id INTEGER, 121 category TEXT DEFAULT '', 122 category TEXT DEFAULT '', 122 variable TEXT, 123 variable TEXT, 123 value REAL, 124 value REAL, 124 expected REAL, 125 expected REAL, ................................................................................................................................................................................ 171 (patch-db)) 172 (patch-db)) 172 ((< mver 1.21) 173 ((< mver 1.21) 173 (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") 174 (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") 174 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var 175 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var 175 CONSTRAINT metadat_constraint UNIQUE (var));") 176 CONSTRAINT metadat_constraint UNIQUE (var));") 176 (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the c 177 (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the c 177 (sqlite3:execute db test-meta-def) 178 (sqlite3:execute db test-meta-def) 178 ;(for-each | 179 ;(for-each 179 ; (lambda (stmt) | 180 ; (lambda (stmt) 180 ; (sqlite3:execute db stmt)) | 181 ; (sqlite3:execute db stmt)) 181 ; (list | 182 ; (list 182 ; "ALTER TABLE tests ADD COLUMN first_err TEXT;" | 183 ; "ALTER TABLE tests ADD COLUMN first_e 183 ; "ALTER TABLE tests ADD COLUMN first_warn TEXT;" | 184 ; "ALTER TABLE tests ADD COLUMN first_w 184 ; )) | 185 ; )) 185 (patch-db)) 186 (patch-db)) 186 ((< mver 1.24) 187 ((< mver 1.24) 187 (db:set-var db "MEGATEST_VERSION" 1.24) 188 (db:set-var db "MEGATEST_VERSION" 1.24) 188 (sqlite3:execute db "DROP TABLE IF EXISTS test_data;") 189 (sqlite3:execute db "DROP TABLE IF EXISTS test_data;") 189 (sqlite3:execute db "DROP TABLE IF EXISTS test_meta;") 190 (sqlite3:execute db "DROP TABLE IF EXISTS test_meta;") 190 (sqlite3:execute db test-meta-def) 191 (sqlite3:execute db test-meta-def) 191 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRI 192 (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRI ................................................................................................................................................................................ 205 (db:set-var db "MEGATEST_VERSION" 1.27) 206 (db:set-var db "MEGATEST_VERSION" 1.27) 206 (sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT ' 207 (sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT ' 207 (patch-db)) 208 (patch-db)) 208 ((< mver 1.29) 209 ((< mver 1.29) 209 (db:set-var db "MEGATEST_VERSION" 1.29) 210 (db:set-var db "MEGATEST_VERSION" 1.29) 210 (sqlite3:execute db "ALTER TABLE test_steps ADD COLUMN logfile TEXT DEFAU 211 (sqlite3:execute db "ALTER TABLE test_steps ADD COLUMN logfile TEXT DEFAU 211 (sqlite3:execute db "ALTER TABLE tests ADD COLUMN shortdir TEXT DEFAULT ' 212 (sqlite3:execute db "ALTER TABLE tests ADD COLUMN shortdir TEXT DEFAULT ' > 213 ((< mver 1.36) > 214 (db:set-var db "MEGATEST_VERSION" 1.36) > 215 (sqlite3:execute db "ALTER TABLER test_meta ADD COLUMN jobgroup TEXT DEFA 212 ((< mver megatest-version) 216 ((< mver megatest-version) 213 (db:set-var db "MEGATEST_VERSION" megatest-version)))))) 217 (db:set-var db "MEGATEST_VERSION" megatest-version)))))) 214 218 215 ;;====================================================================== 219 ;;====================================================================== 216 ;; meta get and set vars 220 ;; meta get and set vars 217 ;;====================================================================== 221 ;;====================================================================== 218 222 ................................................................................................................................................................................ 361 ;; states and statuses are required to be lists, empty is ok 365 ;; states and statuses are required to be lists, empty is ok 362 (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) 366 (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) 363 (let ((res '()) 367 (let ((res '()) 364 (states-str (conc "('" (string-intersperse states "','") "')")) 368 (states-str (conc "('" (string-intersperse states "','") "')")) 365 (statuses-str (conc "('" (string-intersperse statuses "','") "')")) 369 (statuses-str (conc "('" (string-intersperse statuses "','") "')")) 366 ) 370 ) 367 (sqlite3:for-each-row 371 (sqlite3:for-each-row 368 (lambda (id run-id testname state status event-time host cpuload diskfree u | 372 (lambda (a . b) ;; id run-id testname state status event-time host cpuload 369 (set! res (cons (vector id run-id testname state status event-time host c | 373 (set! res (cons (apply vector a b) res))) ;; id run-id testname state sta 370 db 374 db 371 (conc "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskf 375 (conc "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskf 372 " FROM tests WHERE run_id=? AND testname like ? AND item_path LIKE ? 376 " FROM tests WHERE run_id=? AND testname like ? AND item_path LIKE ? 373 " AND NOT (state in " states-str " AND status IN " statuses-str ") " 377 " AND NOT (state in " states-str " AND status IN " statuses-str ") " 374 ;; " ORDER BY id DESC;" 378 ;; " ORDER BY id DESC;" 375 " ORDER BY event_time ASC;" ;; POTENTIAL ISSUE! CHECK ME! Does anytin 379 " ORDER BY event_time ASC;" ;; POTENTIAL ISSUE! CHECK ME! Does anytin 376 ) 380 ) ................................................................................................................................................................................ 391 395 392 ;; set tests with state currstate and status currstatus to newstate and newstatu 396 ;; set tests with state currstate and status currstatus to newstate and newstatu 393 ;; use currstate = #f and or currstatus = #f to apply to any state or status res 397 ;; use currstate = #f and or currstatus = #f to apply to any state or status res 394 ;; WARNING: SQL injection risk 398 ;; WARNING: SQL injection risk 395 (define (db:set-tests-state-status db run-id testnames currstate currstatus news 399 (define (db:set-tests-state-status db run-id testnames currstate currstatus news 396 (for-each (lambda (testname) 400 (for-each (lambda (testname) 397 (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " 401 (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " 398 (if currstate (conc "state='" currstate | 402 (if currstate (conc "state='" currstate "' AND " 399 (if currstatus (conc "status='" currstat | 403 (if currstatus (conc "status='" currstatus "' AND 400 " run_id=? AND testname=? AND NOT (item_ | 404 " run_id=? AND testname=? AND NOT (item_path='' A 401 ;;(debug:print 0 "QRY: " qry) 405 ;;(debug:print 0 "QRY: " qry) 402 (sqlite3:execute db qry run-id newstate newstatus testname testn 406 (sqlite3:execute db qry run-id newstate newstatus testname testn 403 testnames)) 407 testnames)) 404 408 405 (define (db:delete-tests-in-state db run-id state) 409 (define (db:delete-tests-in-state db run-id state) 406 (sqlite3:execute db "DELETE FROM tests WHERE state=? AND run_id=?;" state run- 410 (sqlite3:execute db "DELETE FROM tests WHERE state=? AND run_id=?;" state run- 407 411 ................................................................................................................................................................................ 414 (let ((res 0)) 418 (let ((res 0)) 415 (sqlite3:for-each-row 419 (sqlite3:for-each-row 416 (lambda (count) 420 (lambda (count) 417 (set! res count)) 421 (set! res count)) 418 db 422 db 419 "SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' 423 "SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' 420 res)) 424 res)) > 425 > 426 (define (db:get-count-tests-running-in-jobgroup db jobgroup) > 427 (if (not jobgroup) > 428 0 ;; > 429 (let ((res 0)) > 430 (sqlite3:for-each-row > 431 (lambda (count) > 432 (set! res count)) > 433 db > 434 "SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCH > 435 AND testname in (SELECT testname FROM test_meta WHERE jobgroup=?;" > 436 jobgroup) > 437 res))) 421 438 422 ;; done with run when: 439 ;; done with run when: 423 ;; 0 tests in LAUNCHED, NOT_STARTED, REMOTEHOSTSTART, RUNNING 440 ;; 0 tests in LAUNCHED, NOT_STARTED, REMOTEHOSTSTART, RUNNING 424 (define (db:estimated-tests-remaining db run-id) 441 (define (db:estimated-tests-remaining db run-id) 425 (let ((res 0)) 442 (let ((res 0)) 426 (sqlite3:for-each-row 443 (sqlite3:for-each-row 427 (lambda (count) 444 (lambda (count) ................................................................................................................................................................................ 453 res)) 470 res)) 454 471 455 472 456 (define (db:test-set-comment db run-id testname item-path comment) 473 (define (db:test-set-comment db run-id testname item-path comment) 457 (sqlite3:execute 474 (sqlite3:execute 458 db 475 db 459 "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" 476 "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" 460 comment run-id testname item-path)) | 477 comment run-id testname item-path)) 461 478 462 ;; 479 ;; 463 (define (db:test-set-rundir! db run-id testname item-path rundir) 480 (define (db:test-set-rundir! db run-id testname item-path rundir) 464 (sqlite3:execute 481 (sqlite3:execute 465 db 482 db 466 "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" 483 "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" 467 rundir run-id testname item-path)) | 484 rundir run-id testname item-path)) 468 485 469 ;;====================================================================== 486 ;;====================================================================== 470 ;; Tests meta data 487 ;; Tests meta data 471 ;;====================================================================== 488 ;;====================================================================== 472 489 473 ;; read the record given a testname 490 ;; read the record given a testname 474 (define (db:testmeta-get-record db testname) 491 (define (db:testmeta-get-record db testname) ................................................................................................................................................................................ 517 (debug:print 4 "BEFORE: category: " category " variable: " variable " v 534 (debug:print 4 "BEFORE: category: " category " variable: " variable " v 518 ", expected: " expected " tol: " tol " units: " units " st 535 ", expected: " expected " tol: " tol " units: " units " st 519 536 520 (if (and (or (not expected)(equal? expected "")) 537 (if (and (or (not expected)(equal? expected "")) 521 (or (not tol) (equal? expected "")) 538 (or (not tol) (equal? expected "")) 522 (or (not units) (equal? expected ""))) 539 (or (not units) (equal? expected ""))) 523 (let-values (((new-expected new-tol new-units)(db:get-prev-tol-for- 540 (let-values (((new-expected new-tol new-units)(db:get-prev-tol-for- 524 (set! expected new-expected) | 541 (set! expected new-expected) 525 (set! tol new-tol) | 542 (set! tol new-tol) 526 (set! units new-units))) | 543 (set! units new-units))) 527 544 528 (debug:print 4 "AFTER: category: " category " variable: " variable " v 545 (debug:print 4 "AFTER: category: " category " variable: " variable " v 529 ", expected: " expected " tol: " tol " units: " units " st 546 ", expected: " expected " tol: " tol " units: " units " st 530 ;; calculate status if NOT specified 547 ;; calculate status if NOT specified 531 (if (and (not status)(number? expected)(number? value)) ;; need expecte 548 (if (and (not status)(number? expected)(number? value)) ;; need expecte 532 (if (number? tol) ;; if tol is a number then we do the standard com 549 (if (number? tol) ;; if tol is a number then we do the standard com 533 (let* ((max-val (+ expected tol)) 550 (let* ((max-val (+ expected tol)) ................................................................................................................................................................................ 541 ((<) (if (< value expected) "pass" "fail")) 558 ((<) (if (< value expected) "pass" "fail")) 542 ((>=) (if (>= value expected) "pass" "fail")) 559 ((>=) (if (>= value expected) "pass" "fail")) 543 ((<=) (if (<= value expected) "pass" "fail")) 560 ((<=) (if (<= value expected) "pass" "fail")) 544 (else (conc "ERROR: bad tol comparator " tol)))))) 561 (else (conc "ERROR: bad tol comparator " tol)))))) 545 (debug:print 4 "AFTER2: category: " category " variable: " variable " v 562 (debug:print 4 "AFTER2: category: " category " variable: " variable " v 546 ", expected: " expected " tol: " tol " units: " units " st 563 ", expected: " expected " tol: " tol " units: " units " st 547 (sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category 564 (sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category 548 test-id category variable value expected tol units (if comment com | 565 test-id category variable value expected tol units (if 549 csvlist))) 566 csvlist))) 550 567 551 ;; get a list of test_data records matching categorypatt 568 ;; get a list of test_data records matching categorypatt 552 (define (db:read-test-data db test-id categorypatt) 569 (define (db:read-test-data db test-id categorypatt) 553 (let ((res '())) 570 (let ((res '())) 554 (sqlite3:for-each-row 571 (sqlite3:for-each-row 555 (lambda (id test_id category variable value expected tol units comment stat 572 (lambda (id test_id category variable value expected tol units comment stat ................................................................................................................................................................................ 605 (values #f #f #f)) 622 (values #f #f #f)) 606 623 607 ;;====================================================================== 624 ;;====================================================================== 608 ;; S T E P S 625 ;; S T E P S 609 ;;====================================================================== 626 ;;====================================================================== 610 627 611 (define (db:step-get-time-as-string vec) 628 (define (db:step-get-time-as-string vec) 612 (seconds->time-string (db:step-get-event_time vec))) | 629 (seconds->time-string (db:step-get-event_time vec))) 613 630 614 ;; db-get-test-steps-for-run 631 ;; db-get-test-steps-for-run 615 (define (db:get-steps-for-test db test-id) 632 (define (db:get-steps-for-test db test-id) 616 (let ((res '())) 633 (let ((res '())) 617 (sqlite3:for-each-row 634 (sqlite3:for-each-row 618 (lambda (id test-id stepname state status event-time logfile) 635 (lambda (id test-id stepname state status event-time logfile) 619 (set! res (cons (vector id test-id stepname state status event-time (if ( 636 (set! res (cons (vector id test-id stepname state status event-time (if ( ................................................................................................................................................................................ 659 ", get-status: " (db:step-get 676 ", get-status: " (db:step-get 660 (if (and (number? startt)(number? endt)) 677 (if (and (number? startt)(number? endt)) 661 (seconds->hr-min-sec (- endt startt)) 678 (seconds->hr-min-sec (- endt startt)) 662 (if (> (string-length (db:step-get-logfile step)) 679 (if (> (string-length (db:step-get-logfile step)) 663 0) 680 0) 664 (vector-set! record 5 (db:step-get-logfile step)))) 681 (vector-set! record 5 (db:step-get-logfile step)))) 665 (else 682 (else 666 (vector-set! record 2 (db:step-get-state step)) | 683 (vector-set! record 2 (db:step-get-state step)) 667 (vector-set! record 3 (db:step-get-status step)) | 684 (vector-set! record 3 (db:step-get-status step)) 668 (vector-set! record 4 (db:step-get-event_time step)))) | 685 (vector-set! record 4 (db:step-get-event_time step)))) 669 (hash-table-set! res (db:step-get-stepname step) record) 686 (hash-table-set! res (db:step-get-stepname step) record) 670 (debug:print 6 "record(after) = " record 687 (debug:print 6 "record(after) = " record 671 "\nid: " (db:step-get-id step) 688 "\nid: " (db:step-get-id step) 672 "\nstepname: " (db:step-get-stepname step) 689 "\nstepname: " (db:step-get-stepname step) 673 "\nstate: " (db:step-get-state step) 690 "\nstate: " (db:step-get-state step) 674 "\nstatus: " (db:step-get-status step) 691 "\nstatus: " (db:step-get-status step) 675 "\ntime: " (db:step-get-event_time step)))) 692 "\ntime: " (db:step-get-event_time step)))) ................................................................................................................................................................................ 696 (if (not (and (equal? (db:test-get-state 713 (if (not (and (equal? (db:test-get-state 697 (member (db:test-get-statu 714 (member (db:test-get-statu 698 (set! result (cons waitontest-name r 715 (set! result (cons waitontest-name r 699 tests) 716 tests) 700 (if (not ever-seen)(set! result (cons waitontest-name resu 717 (if (not ever-seen)(set! result (cons waitontest-name resu 701 waiton) 718 waiton) 702 (delete-duplicates result)))) 719 (delete-duplicates result)))) > 720 > 721 ;; the new prereqs calculation, looks also at itempath if specified > 722 ;; all prereqs must be met: > 723 ;; if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAI > 724 ;; if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, > 725 (define (db:get-prereqs-not-met db run-id waitons ref-item-path) > 726 (if (or (not waitons) > 727 (null? waitons)) > 728 '() > 729 (let* ((unmet-pre-reqs '()) > 730 (result '())) > 731 (for-each > 732 (lambda (waitontest-name) > 733 ;; by getting the tests with matching name we are looking only at the > 734 ;; and related sub items > 735 (let ((tests (db-get-tests-for-run db run-id waitontest-n > 736 (ever-seen #f) > 737 (parent-waiton-met #f) > 738 (item-waiton-met #f)) > 739 (for-each > 740 (lambda (test) > 741 ;; (if (equal? waitontest-name (db:test-get-testname test)) ;; b > 742 (let* ((state (db:test-get-state test)) > 743 (status (db:test-get-status test)) > 744 (item-path (db:test-get-item-path test)) > 745 (is-completed (equal? state "COMPLETED")) > 746 (is-ok (member status '("PASS" "WARN" "CHECK" > 747 (same-itempath (equal? ref-item-path item-path))) > 748 (set! ever-seen #t) > 749 (cond > 750 ;; case 1, non-item (parent test) is > 751 ((and (equal? item-path "") ;; this is the parent test > 752 is-completed > 753 is-ok) > 754 (set! parent-waiton-met #t)) > 755 ((and same-itempath > 756 is-completed > 757 is-ok) > 758 (set! item-waiton-met #t))))) > 759 tests) > 760 (if (not (or parent-waiton-met item-waiton-met)) > 761 (set! result (cons waitontest-name result))) > 762 ;; if the test is not found then clearly the waiton is not met... > 763 (if (not ever-seen)(set! result (cons waitontest-name result))))) > 764 waitons) > 765 (delete-duplicates result)))) 703 766 704 ;;====================================================================== 767 ;;====================================================================== 705 ;; Extract ods file from the db 768 ;; Extract ods file from the db 706 ;;====================================================================== 769 ;;====================================================================== 707 770 708 ;; runspatt is a comma delimited list of run patterns 771 ;; runspatt is a comma delimited list of run patterns 709 ;; keypatt-alist must contain *all* keys with an associated pattern: '( ("KEY1" 772 ;; keypatt-alist must contain *all* keys with an associated pattern: '( ("KEY1" ................................................................................................................................................................................ 739 (results (list runsheader)) 802 (results (list runsheader)) 740 (testdata-header (list "Run Id" "Testname" "Item Path" "Category" "Vari 803 (testdata-header (list "Run Id" "Testname" "Item Path" "Category" "Vari 741 (debug:print 2 "Using " tempdir " for constructing the ods file. keyqry: " k 804 (debug:print 2 "Using " tempdir " for constructing the ods file. keyqry: " k 742 ;; "Expected Value" 805 ;; "Expected Value" 743 ;; "Value Found" 806 ;; "Value Found" 744 ;; "Tolerance" 807 ;; "Tolerance" 745 (apply sqlite3:for-each-row 808 (apply sqlite3:for-each-row 746 (lambda (test-id . b) | 809 (lambda (test-id . b) 747 (set! test-ids (cons test-id test-ids)) ;; test-id is now testname | 810 (set! test-ids (cons test-id test-ids)) ;; test-id is now testnam 748 (set! results (append results ;; note, drop the test-id | 811 (set! results (append results ;; note, drop the test-id 749 (list | 812 (list 750 (if pathmod | 813 (if pathmod 751 (let* ((vb (apply vector b)) | 814 (let* ((vb (apply vector b)) 752 (keyvals (let loop ((i 0) | 815 (keyvals (let loop ((i 0) 753 (res '())) | 816 (res '())) 754 (if (>= i numkeys) | 817 (if (>= i numkeys) 755 res | 818 res 756 (loop (+ i 1) | 819 (loop (+ i 1) 757 (append res (lis | 820 (append re 758 (runname (vector-ref vb 1)) | 821 (runname (vector-ref vb 1)) 759 (testname (vector-ref vb (+ 2 numkeys | 822 (testname (vector-ref vb (+ 2 n 760 (item-path (vector-ref vb (+ 3 numkeys | 823 (item-path (vector-ref vb (+ 3 n 761 (final-log (vector-ref vb (+ 7 numkeys | 824 (final-log (vector-ref vb (+ 7 n 762 (run-dir (vector-ref vb (+ 18 numkeys | 825 (run-dir (vector-ref vb (+ 18 n 763 (log-fpath (conc run-dir "/" final-log | 826 (log-fpath (conc run-dir "/" fin 764 (debug:print 4 "log: " log-fpath " exists: " | 827 (debug:print 4 "log: " log-fpath " exi 765 (vector-set! vb (+ 7 numkeys) (if (file-exis | 828 (vector-set! vb (+ 7 numkeys) (if (fil 766 (let ((new | 829 (let 767 | 830 768 | 831 769 | 832 770 | 833 771 ;; for n | 834 ;; 772 (set! ne | 835 (s 773 (if wind | 836 (i 774 (if (> *ve | 837 (if 775 (conc | 838 776 ""))) | 839 777 (vector->list vb)) | 840 (vector->list vb)) 778 b))))) | 841 b))))) 779 db | 842 db 780 (conc "SELECT | 843 (conc "SELECT 781 t.testname,r.id,runname," keysstr ",t.testname, 844 t.testname,r.id,runname," keysstr ",t.testname, 782 t.item_path,tm.description,t.state,t.status, 845 t.item_path,tm.description,t.state,t.status, 783 final_logf,run_duration, 846 final_logf,run_duration, 784 strftime('%m/%d/%Y %H:%M:%S',datetime(t.event_time,'unixepoch'),'l 847 strftime('%m/%d/%Y %H:%M:%S',datetime(t.event_time,'unixepoch'),'l 785 tm.tags,r.owner,t.comment, 848 tm.tags,r.owner,t.comment, 786 author, 849 author, 787 tm.owner,reviewed, 850 tm.owner,reviewed, 788 diskfree,uname,rundir, 851 diskfree,uname,rundir, 789 host,cpuload 852 host,cpuload 790 FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id INNER JOIN tes 853 FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id INNER JOIN tes 791 WHERE runname LIKE ? AND " keyqry ";") 854 WHERE runname LIKE ? AND " keyqry ";") 792 runspatt (map cadr keypatt-alist)) | 855 runspatt (map cadr keypatt-alist)) 793 (set! results (list (cons "Runs" results))) 856 (set! results (list (cons "Runs" results))) 794 ;; now, for each test, collect the test_data info and add a new sheet 857 ;; now, for each test, collect the test_data info and add a new sheet 795 (for-each 858 (for-each 796 (lambda (test-id) 859 (lambda (test-id) 797 (let ((test-data (list testdata-header)) 860 (let ((test-data (list testdata-header)) 798 (curr-test-name #f)) 861 (curr-test-name #f)) 799 (sqlite3:for-each-row 862 (sqlite3:for-each-row

Modified docs/megatest.lyx from [d71eb3594c0999ca] to [8cf3af19a75c29af].

283 \end_layout 283 \end_layout 284 284 285 \begin_layout Standard 285 \begin_layout Standard 286 \begin_inset VSpace medskip 286 \begin_inset VSpace medskip 287 \end_inset 287 \end_inset 288 288 289 This document is believed to be acurate at the time of writing but as with 289 This document is believed to be acurate at the time of writing but as with 290 any opensource project the source code itself is the final arbiter of the | 290 any opensource project the source code itself is the reference. 291 softwares behaviour. < 292 It is the responsibility of the end user to validate that the code will 291 It is the responsibility of the end user to validate that the code will 293 perform as they expect. 292 perform as they expect. 294 The author assumes no responsibility for any inaccuracies that this document 293 The author assumes no responsibility for any inaccuracies that this document 295 may contain. 294 may contain. 296 In no event will Matthew Welland be liable for direct, indirect, special, 295 In no event will Matthew Welland be liable for direct, indirect, special, 297 exemplary, incidental, or consequential damages resulting from any defect 296 exemplary, incidental, or consequential damages resulting from any defect 298 or omission in this document, even if advised of the possibility of such 297 or omission in this document, even if advised of the possibility of such 299 damages. 298 damages. 300 299 301 \end_layout 300 \end_layout 302 301 303 \begin_layout Standard 302 \begin_layout Standard 304 This document is a snapshot in time and the Megatest software has likely | 303 This document is a snapshot in time and Megatest software has likely changed 305 been changed since publication. | 304 since publication. 306 This document and the product that it describes may be improved at any | 305 This document and Megatest may be improved at any time, without notice 307 time, without notice or obligation. | 306 or obligation. 308 307 309 \end_layout 308 \end_layout 310 309 311 \begin_layout Standard 310 \begin_layout Standard 312 \begin_inset Newpage newpage 311 \begin_inset Newpage newpage 313 \end_inset 312 \end_inset 314 313 ................................................................................................................................................................................ 457 456 458 \begin_layout Subsection 457 \begin_layout Subsection 459 Megatest design philosophy 458 Megatest design philosophy 460 \end_layout 459 \end_layout 461 460 462 \begin_layout Standard 461 \begin_layout Standard 463 Megatest is intended to provide the minimum needed resources to make writing 462 Megatest is intended to provide the minimum needed resources to make writing > 463 a suite of tests and implementing continuous build for software, design 464 a suite of tests for software, design engineering or process control (via | 464 engineering or process control (via owlfs for example) without being specialize 465 owlfs for example) without being specialized for any specific problem space. | 465 d for any specific problem space. 466 Megatest in of itself does not know what constitutes a PASS or FAIL of 466 Megatest in of itself does not know what constitutes a PASS or FAIL of 467 a test. 467 a test. 468 In most cases megatest is best used in conjunction with logpro or a similar 468 In most cases megatest is best used in conjunction with logpro or a similar 469 tool to parse, analyze and decide on the test outcome. 469 tool to parse, analyze and decide on the test outcome. 470 A call to megatest can then be made to record the result. < 471 < 472 \end_layout 470 \end_layout 473 471 474 \begin_layout Subsection 472 \begin_layout Subsection 475 Megatest architecture 473 Megatest architecture 476 \end_layout 474 \end_layout 477 475 478 \begin_layout Standard 476 \begin_layout Standard ................................................................................................................................................................................ 1673 \begin_layout Section 1671 \begin_layout Section 1674 Monitor based running 1672 Monitor based running 1675 \end_layout 1673 \end_layout 1676 1674 1677 \begin_layout Subsection 1675 \begin_layout Subsection 1678 Monitor logic 1676 Monitor logic 1679 \end_layout 1677 \end_layout > 1678 > 1679 \begin_layout Standard > 1680 Note: The monitor is usable but incomplete as of Megatest v1.31. > 1681 Click on the > 1682 \begin_inset Quotes eld > 1683 \end_inset > 1684 > 1685 Monitor > 1686 \begin_inset Quotes erd > 1687 \end_inset > 1688 > 1689 button on the dashboard to start the monitor and give it a try. > 1690 \end_layout 1680 1691 1681 \begin_layout Standard 1692 \begin_layout Standard 1682 \begin_inset Graphics 1693 \begin_inset Graphics 1683 filename monitor-state-diagram.svg 1694 filename monitor-state-diagram.svg 1684 1695 1685 \end_inset 1696 \end_inset 1686 1697 ................................................................................................................................................................................ 1690 \begin_layout Section 1701 \begin_layout Section 1691 Reference 1702 Reference 1692 \end_layout 1703 \end_layout 1693 1704 1694 \begin_layout Subsection 1705 \begin_layout Subsection 1695 Configuration file Syntax 1706 Configuration file Syntax 1696 \end_layout 1707 \end_layout > 1708 > 1709 \begin_layout Standard > 1710 Note: whitespace is preserved including at the end of line. > 1711 Ensure your entries only have whitespace at the end of line when needed > 1712 to avoid problems. > 1713 \end_layout 1697 1714 1698 \begin_layout Subsubsection 1715 \begin_layout Subsubsection 1699 Sections 1716 Sections 1700 \end_layout 1717 \end_layout 1701 1718 1702 \begin_layout Standard 1719 \begin_layout Standard 1703 \begin_inset listings 1720 \begin_inset listings ................................................................................................................................................................................ 2006 2023 2007 \begin_layout Subsection 2024 \begin_layout Subsection 2008 megatest.config 2025 megatest.config 2009 \end_layout 2026 \end_layout 2010 2027 2011 \begin_layout Standard 2028 \begin_layout Standard 2012 \begin_inset Tabular 2029 \begin_inset Tabular 2013 <lyxtabular version="3" rows="9" columns="5"> | 2030 <lyxtabular version="3" rows="10" columns="5"> 2014 <features tabularvalignment="middle" tabularwidth="80page%"> 2031 <features tabularvalignment="middle" tabularwidth="80page%"> 2015 <column alignment="left" valignment="top" width="10page%"> 2032 <column alignment="left" valignment="top" width="10page%"> 2016 <column alignment="left" valignment="top" width="15page%"> 2033 <column alignment="left" valignment="top" width="15page%"> 2017 <column alignment="left" valignment="top" width="20page%"> 2034 <column alignment="left" valignment="top" width="20page%"> 2018 <column alignment="left" valignment="top" width="6page%"> 2035 <column alignment="left" valignment="top" width="6page%"> 2019 <column alignment="left" valignment="top" width="20page%"> 2036 <column alignment="left" valignment="top" width="20page%"> 2020 <row> 2037 <row> ................................................................................................................................................................................ 2342 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline 2359 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline 2343 \begin_inset Text 2360 \begin_inset Text 2344 2361 2345 \begin_layout Plain Layout 2362 \begin_layout Plain Layout 2346 2363 2347 \end_layout 2364 \end_layout 2348 2365 > 2366 \end_inset > 2367 </cell> > 2368 </row> > 2369 <row> > 2370 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2371 \begin_inset Text > 2372 > 2373 \begin_layout Plain Layout > 2374 [jobgroups] > 2375 \end_layout > 2376 > 2377 \end_inset > 2378 </cell> > 2379 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2380 \begin_inset Text > 2381 > 2382 \begin_layout Plain Layout > 2383 string of letters, numbers and underscore > 2384 \end_layout > 2385 > 2386 \end_inset > 2387 </cell> > 2388 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2389 \begin_inset Text > 2390 > 2391 \begin_layout Plain Layout > 2392 number > 2393 \end_layout > 2394 > 2395 \end_inset > 2396 </cell> > 2397 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2398 \begin_inset Text > 2399 > 2400 \begin_layout Plain Layout > 2401 no > 2402 \end_layout > 2403 > 2404 \end_inset > 2405 </cell> > 2406 <cell alignment="center" valignment="top" topline="true" leftline="true" rightli > 2407 \begin_inset Text > 2408 > 2409 \begin_layout Plain Layout > 2410 Control number of jobs allowed to concurrently run in categories. > 2411 See [jobgroup] in testconfig > 2412 \end_layout > 2413 2349 \end_inset 2414 \end_inset 2350 </cell> 2415 </cell> 2351 </row> 2416 </row> 2352 <row> 2417 <row> 2353 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2418 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2354 \begin_inset Text 2419 \begin_inset Text 2355 2420 ................................................................................................................................................................................ 2741 2806 2742 \begin_layout Subsubsection 2807 \begin_layout Subsubsection 2743 testconfig file 2808 testconfig file 2744 \end_layout 2809 \end_layout 2745 2810 2746 \begin_layout Standard 2811 \begin_layout Standard 2747 \begin_inset Tabular 2812 \begin_inset Tabular 2748 <lyxtabular version="3" rows="4" columns="5"> | 2813 <lyxtabular version="3" rows="6" columns="5"> 2749 <features tabularvalignment="middle" tabularwidth="80page%"> 2814 <features tabularvalignment="middle" tabularwidth="80page%"> 2750 <column alignment="left" valignment="top" width="8page%"> 2815 <column alignment="left" valignment="top" width="8page%"> 2751 <column alignment="left" valignment="top" width="6page%"> 2816 <column alignment="left" valignment="top" width="6page%"> 2752 <column alignment="left" valignment="top" width="12page%"> 2817 <column alignment="left" valignment="top" width="12page%"> 2753 <column alignment="left" valignment="top" width="6page%"> 2818 <column alignment="left" valignment="top" width="6page%"> 2754 <column alignment="left" valignment="top" width="30page%"> 2819 <column alignment="left" valignment="top" width="30page%"> 2755 <row> 2820 <row> ................................................................................................................................................................................ 2892 PASS 2957 PASS 2893 \end_layout 2958 \end_layout 2894 2959 2895 \end_inset 2960 \end_inset 2896 </cell> 2961 </cell> 2897 </row> 2962 </row> 2898 <row> 2963 <row> > 2964 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2965 \begin_inset Text > 2966 > 2967 \begin_layout Plain Layout > 2968 > 2969 \end_layout > 2970 > 2971 \end_inset > 2972 </cell> > 2973 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2974 \begin_inset Text > 2975 > 2976 \begin_layout Plain Layout > 2977 jobgroup > 2978 \end_layout > 2979 > 2980 \end_inset > 2981 </cell> > 2982 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2983 \begin_inset Text > 2984 > 2985 \begin_layout Plain Layout > 2986 > 2987 \end_layout > 2988 > 2989 \end_inset > 2990 </cell> > 2991 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox= > 2992 \begin_inset Text > 2993 > 2994 \begin_layout Plain Layout > 2995 > 2996 \end_layout > 2997 > 2998 \end_inset > 2999 </cell> > 3000 <cell alignment="center" valignment="top" topline="true" leftline="true" rightli > 3001 \begin_inset Text > 3002 > 3003 \begin_layout Plain Layout > 3004 > 3005 \end_layout > 3006 > 3007 \end_inset > 3008 </cell> > 3009 </row> > 3010 <row> 2899 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin | 3011 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2900 \begin_inset Text 3012 \begin_inset Text 2901 3013 2902 \begin_layout Plain Layout 3014 \begin_layout Plain Layout 2903 [items] 3015 [items] 2904 \end_layout 3016 \end_layout 2905 3017 2906 \end_inset 3018 \end_inset 2907 </cell> 3019 </cell> 2908 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin | 3020 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2909 \begin_inset Text 3021 \begin_inset Text 2910 3022 2911 \begin_layout Plain Layout 3023 \begin_layout Plain Layout 2912 any valid 3024 any valid 2913 \end_layout 3025 \end_layout 2914 3026 2915 \end_inset 3027 \end_inset 2916 </cell> 3028 </cell> 2917 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin | 3029 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2918 \begin_inset Text 3030 \begin_inset Text 2919 3031 2920 \begin_layout Plain Layout 3032 \begin_layout Plain Layout 2921 list of values 3033 list of values 2922 \end_layout 3034 \end_layout 2923 3035 2924 \end_inset 3036 \end_inset 2925 </cell> 3037 </cell> 2926 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin | 3038 <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="n 2927 \begin_inset Text 3039 \begin_inset Text 2928 3040 2929 \begin_layout Plain Layout 3041 \begin_layout Plain Layout 2930 no 3042 no 2931 \end_layout 3043 \end_layout 2932 3044 2933 \end_inset 3045 \end_inset 2934 </cell> 3046 </cell> 2935 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin | 3047 <cell alignment="left" valignment="top" topline="true" leftline="true" rightline 2936 \begin_inset Text 3048 \begin_inset Text 2937 3049 2938 \begin_layout Plain Layout 3050 \begin_layout Plain Layout 2939 The test will be repeated once for each item with the variable name set 3051 The test will be repeated once for each item with the variable name set 2940 to the value. 3052 to the value. 2941 If there is more than one variable then the test will be run against all 3053 If there is more than one variable then the test will be run against all 2942 unique combinations of the values 3054 unique combinations of the values 2943 \end_layout 3055 \end_layout 2944 3056 > 3057 \end_inset > 3058 </cell> > 3059 </row> > 3060 <row> > 3061 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftl > 3062 \begin_inset Text > 3063 > 3064 \begin_layout Plain Layout > 3065 [eztests] > 3066 \end_layout > 3067 > 3068 \end_inset > 3069 </cell> > 3070 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftl > 3071 \begin_inset Text > 3072 > 3073 \begin_layout Plain Layout > 3074 any valid > 3075 \end_layout > 3076 > 3077 \end_inset > 3078 </cell> > 3079 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftl > 3080 \begin_inset Text > 3081 > 3082 \begin_layout Plain Layout > 3083 stepname command > 3084 \end_layout > 3085 > 3086 \end_inset > 3087 </cell> > 3088 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftl > 3089 \begin_inset Text > 3090 > 3091 \begin_layout Plain Layout > 3092 no > 3093 \end_layout > 3094 > 3095 \end_inset > 3096 </cell> > 3097 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftl > 3098 \begin_inset Text > 3099 > 3100 \begin_layout Plain Layout > 3101 Use in addition to or instead of runscript for easy implementation of steps. > 3102 If <stepname>.logpro exists it will be applied to the <stepname>.log and > 3103 resulting exit code will be used to determine PASS/FAIL/WARN > 3104 \end_layout > 3105 2945 \end_inset 3106 \end_inset 2946 </cell> 3107 </cell> 2947 </row> 3108 </row> 2948 </lyxtabular> 3109 </lyxtabular> 2949 3110 2950 \end_inset 3111 \end_inset 2951 3112 ................................................................................................................................................................................ 3868 4029 3869 \end_inset 4030 \end_inset 3870 </cell> 4031 </cell> 3871 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin 4032 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin 3872 \begin_inset Text 4033 \begin_inset Text 3873 4034 3874 \begin_layout Plain Layout 4035 \begin_layout Plain Layout 3875 If using logpro to asses the PASS/FAIL status of the step you specify the | 4036 If using logpro to acess the PASS/FAIL status of the step you specify the 3876 logpro file with this parameter. 4037 logpro file with this parameter. 3877 \end_layout 4038 \end_layout 3878 4039 3879 \end_inset 4040 \end_inset 3880 </cell> 4041 </cell> 3881 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin 4042 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftlin 3882 \begin_inset Text 4043 \begin_inset Text

Added docs/monitor-state-diagram.svg version [5c370cf9de317dcc]

> 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> > 2 <!-- Created with Inkscape (http://www.inkscape.org/) --> > 3 > 4 <svg > 5 xmlns:dc="http://purl.org/dc/elements/1.1/" > 6 xmlns:cc="http://creativecommons.org/ns#" > 7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > 8 xmlns:svg="http://www.w3.org/2000/svg" > 9 xmlns="http://www.w3.org/2000/svg" > 10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" > 11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" > 12 width="382.82721" > 13 height="334.97675" > 14 id="svg2" > 15 version="1.1" > 16 inkscape:version="0.48.1 r9760" > 17 sodipodi:docname="monitor-state-diagram.svg"> > 18 <defs > 19 id="defs4"> > 20 <marker > 21 inkscape:stockid="Arrow1Lend" > 22 orient="auto" > 23 refY="0" > 24 refX="0" > 25 id="Arrow1Lend" > 26 style="overflow:visible"> > 27 <path > 28 id="path3777" > 29 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 30 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 31 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 32 inkscape:connector-curvature="0" /> > 33 </marker> > 34 <marker > 35 inkscape:stockid="Arrow1Lend" > 36 orient="auto" > 37 refY="0" > 38 refX="0" > 39 id="Arrow1Lend-8" > 40 style="overflow:visible"> > 41 <path > 42 inkscape:connector-curvature="0" > 43 id="path3777-9" > 44 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 45 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 46 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 47 </marker> > 48 <marker > 49 inkscape:stockid="Arrow1Lend" > 50 orient="auto" > 51 refY="0" > 52 refX="0" > 53 id="Arrow1Lend-9" > 54 style="overflow:visible"> > 55 <path > 56 inkscape:connector-curvature="0" > 57 id="path3777-5" > 58 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 59 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 60 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 61 </marker> > 62 <marker > 63 inkscape:stockid="Arrow1Lend" > 64 orient="auto" > 65 refY="0" > 66 refX="0" > 67 id="Arrow1Lend-4" > 68 style="overflow:visible"> > 69 <path > 70 inkscape:connector-curvature="0" > 71 id="path3777-8" > 72 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 73 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 74 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 75 </marker> > 76 <marker > 77 inkscape:stockid="Arrow1Lend" > 78 orient="auto" > 79 refY="0" > 80 refX="0" > 81 id="Arrow1Lend-7" > 82 style="overflow:visible"> > 83 <path > 84 inkscape:connector-curvature="0" > 85 id="path3777-2" > 86 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 87 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 88 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 89 </marker> > 90 <marker > 91 inkscape:stockid="Arrow1Lend" > 92 orient="auto" > 93 refY="0" > 94 refX="0" > 95 id="Arrow1Lend-2" > 96 style="overflow:visible"> > 97 <path > 98 inkscape:connector-curvature="0" > 99 id="path3777-26" > 100 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 101 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 102 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 103 </marker> > 104 </defs> > 105 <sodipodi:namedview > 106 id="base" > 107 pagecolor="#ffffff" > 108 bordercolor="#666666" > 109 borderopacity="1.0" > 110 inkscape:pageopacity="0.0" > 111 inkscape:pageshadow="2" > 112 inkscape:zoom="1.0240234" > 113 inkscape:cx="197.40711" > 114 inkscape:cy="50.784201" > 115 inkscape:document-units="px" > 116 inkscape:current-layer="layer1" > 117 showgrid="false" > 118 inkscape:window-width="1336" > 119 inkscape:window-height="907" > 120 inkscape:window-x="405" > 121 inkscape:window-y="31" > 122 inkscape:window-maximized="0" > 123 fit-margin-top="0" > 124 fit-margin-left="0" > 125 fit-margin-right="0" > 126 fit-margin-bottom="0" /> > 127 <metadata > 128 id="metadata7"> > 129 <rdf:RDF> > 130 <cc:Work > 131 rdf:about=""> > 132 <dc:format>image/svg+xml</dc:format> > 133 <dc:type > 134 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> > 135 <dc:title /> > 136 </cc:Work> > 137 </rdf:RDF> > 138 </metadata> > 139 <g > 140 inkscape:label="Layer 1" > 141 inkscape:groupmode="layer" > 142 id="layer1" > 143 transform="translate(-88.36515,-238.40424)"> > 144 <text > 145 xml:space="preserve" > 146 style="font-size:18px;font-style:normal;font-weight:normal;line-height:12 > 147 x="119.1379" > 148 y="302.37936" > 149 id="text2985" > 150 sodipodi:linespacing="125%"><tspan > 151 sodipodi:role="line" > 152 id="tspan2987" > 153 x="119.1379" > 154 y="302.37936">New</tspan></text> > 155 <text > 156 xml:space="preserve" > 157 style="font-size:18px;font-style:normal;font-weight:normal;line-height:12 > 158 x="171.87106" > 159 y="404.91605" > 160 id="text2989" > 161 sodipodi:linespacing="125%"><tspan > 162 sodipodi:role="line" > 163 id="tspan2991" > 164 x="171.87106" > 165 y="404.91605">processing</tspan></text> > 166 <text > 167 xml:space="preserve" > 168 style="font-size:18px;font-style:normal;font-weight:normal;line-height:12 > 169 x="344.71866" > 170 y="408.8222" > 171 id="text2993" > 172 sodipodi:linespacing="125%"><tspan > 173 sodipodi:role="line" > 174 id="tspan2995" > 175 x="344.71866" > 176 y="408.8222">waiting</tspan></text> > 177 <text > 178 xml:space="preserve" > 179 style="font-size:18px;font-style:normal;font-weight:normal;line-height:12 > 180 x="175.77724" > 181 y="530.88977" > 182 id="text2997" > 183 sodipodi:linespacing="125%"><tspan > 184 sodipodi:role="line" > 185 id="tspan2999" > 186 x="175.77724" > 187 y="530.88977">done</tspan></text> > 188 <path > 189 style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stro > 190 d="m 168.94145,296.52011 c 50.03998,8.38374 51.51168,48.28767 51.75662,85 > 191 id="path3001" > 192 inkscape:connector-curvature="0" > 193 sodipodi:nodetypes="cc" /> > 194 <path > 195 style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stro > 196 d="m 222.64982,413.70493 c -1.71665,59.16383 -23.68191,54.14691 -24.41351 > 197 id="path3001-2" > 198 inkscape:connector-curvature="0" > 199 sodipodi:nodetypes="cc" /> > 200 <path > 201 style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stro > 202 d="m 238.76406,415.04172 c 45.26369,68.23333 101.21533,61.78246 141.59833 > 203 id="path3001-2-0-7-7" > 204 inkscape:connector-curvature="0" > 205 sodipodi:nodetypes="cc" /> > 206 <path > 207 style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stro > 208 d="M 379.38586,385.25271 C 334.12217,317.01938 278.17053,323.47025 237.78 > 209 id="path3001-2-0-7-7-1" > 210 inkscape:connector-curvature="0" > 211 sodipodi:nodetypes="cc" /> > 212 <rect > 213 style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke- > 214 id="rect4335" > 215 width="381.82721" > 216 height="333.97675" > 217 x="88.86515" > 218 y="238.90424" /> > 219 </g> > 220 </svg>

Added docs/test-launch-state-diagram.svg version [6e88c87b22e4b389]

> 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> > 2 <!-- Created with Inkscape (http://www.inkscape.org/) --> > 3 > 4 <svg > 5 xmlns:dc="http://purl.org/dc/elements/1.1/" > 6 xmlns:cc="http://creativecommons.org/ns#" > 7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > 8 xmlns:svg="http://www.w3.org/2000/svg" > 9 xmlns="http://www.w3.org/2000/svg" > 10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" > 11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" > 12 width="382.82721" > 13 height="334.97675" > 14 id="svg2" > 15 version="1.1" > 16 inkscape:version="0.48.2 r9819" > 17 sodipodi:docname="test-launch-state-diagram.svg"> > 18 <defs > 19 id="defs4"> > 20 <marker > 21 inkscape:stockid="Arrow1Lend" > 22 orient="auto" > 23 refY="0" > 24 refX="0" > 25 id="Arrow1Lend" > 26 style="overflow:visible"> > 27 <path > 28 id="path3777" > 29 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 30 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 31 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 32 inkscape:connector-curvature="0" /> > 33 </marker> > 34 <marker > 35 inkscape:stockid="Arrow1Lend" > 36 orient="auto" > 37 refY="0" > 38 refX="0" > 39 id="Arrow1Lend-8" > 40 style="overflow:visible"> > 41 <path > 42 inkscape:connector-curvature="0" > 43 id="path3777-9" > 44 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 45 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 46 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 47 </marker> > 48 <marker > 49 inkscape:stockid="Arrow1Lend" > 50 orient="auto" > 51 refY="0" > 52 refX="0" > 53 id="Arrow1Lend-9" > 54 style="overflow:visible"> > 55 <path > 56 inkscape:connector-curvature="0" > 57 id="path3777-5" > 58 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 59 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 60 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 61 </marker> > 62 <marker > 63 inkscape:stockid="Arrow1Lend" > 64 orient="auto" > 65 refY="0" > 66 refX="0" > 67 id="Arrow1Lend-4" > 68 style="overflow:visible"> > 69 <path > 70 inkscape:connector-curvature="0" > 71 id="path3777-8" > 72 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 73 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 74 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 75 </marker> > 76 <marker > 77 inkscape:stockid="Arrow1Lend" > 78 orient="auto" > 79 refY="0" > 80 refX="0" > 81 id="Arrow1Lend-7" > 82 style="overflow:visible"> > 83 <path > 84 inkscape:connector-curvature="0" > 85 id="path3777-2" > 86 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 87 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 88 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 89 </marker> > 90 <marker > 91 inkscape:stockid="Arrow1Lend" > 92 orient="auto" > 93 refY="0" > 94 refX="0" > 95 id="Arrow1Lend-2" > 96 style="overflow:visible"> > 97 <path > 98 inkscape:connector-curvature="0" > 99 id="path3777-26" > 100 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 101 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 102 transform="matrix(-0.8,0,0,-0.8,-10,0)" /> > 103 </marker> > 104 <marker > 105 inkscape:stockid="Arrow1Lend" > 106 orient="auto" > 107 refY="0" > 108 refX="0" > 109 id="Arrow1Lend-5" > 110 style="overflow:visible"> > 111 <path > 112 id="path3777-97" > 113 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 114 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 115 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 116 inkscape:connector-curvature="0" /> > 117 </marker> > 118 <marker > 119 inkscape:stockid="Arrow1Lend" > 120 orient="auto" > 121 refY="0" > 122 refX="0" > 123 id="Arrow1Lend-88" > 124 style="overflow:visible"> > 125 <path > 126 id="path3777-50" > 127 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 128 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 129 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 130 inkscape:connector-curvature="0" /> > 131 </marker> > 132 <marker > 133 inkscape:stockid="Arrow1Lend" > 134 orient="auto" > 135 refY="0" > 136 refX="0" > 137 id="Arrow1Lend-85" > 138 style="overflow:visible"> > 139 <path > 140 id="path3777-6" > 141 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 142 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 143 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 144 inkscape:connector-curvature="0" /> > 145 </marker> > 146 <marker > 147 inkscape:stockid="Arrow1Lend" > 148 orient="auto" > 149 refY="0" > 150 refX="0" > 151 id="Arrow1Lend-44" > 152 style="overflow:visible"> > 153 <path > 154 id="path3777-7" > 155 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 156 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 157 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 158 inkscape:connector-curvature="0" /> > 159 </marker> > 160 <marker > 161 inkscape:stockid="Arrow1Lend" > 162 orient="auto" > 163 refY="0" > 164 refX="0" > 165 id="Arrow1Lend-75" > 166 style="overflow:visible"> > 167 <path > 168 id="path3777-96" > 169 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 170 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 171 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 172 inkscape:connector-curvature="0" /> > 173 </marker> > 174 <marker > 175 inkscape:stockid="Arrow1Lend" > 176 orient="auto" > 177 refY="0" > 178 refX="0" > 179 id="Arrow1Lend-57" > 180 style="overflow:visible"> > 181 <path > 182 id="path3777-4" > 183 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 184 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 185 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 186 inkscape:connector-curvature="0" /> > 187 </marker> > 188 <marker > 189 inkscape:stockid="Arrow1Lend" > 190 orient="auto" > 191 refY="0" > 192 refX="0" > 193 id="Arrow1Lend-59" > 194 style="overflow:visible"> > 195 <path > 196 id="path3777-75" > 197 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 198 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 199 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 200 inkscape:connector-curvature="0" /> > 201 </marker> > 202 <marker > 203 inkscape:stockid="Arrow1Lend" > 204 orient="auto" > 205 refY="0" > 206 refX="0" > 207 id="Arrow1Lend-0" > 208 style="overflow:visible"> > 209 <path > 210 id="path3777-48" > 211 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 212 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 213 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 214 inkscape:connector-curvature="0" /> > 215 </marker> > 216 <marker > 217 inkscape:stockid="Arrow1Lend" > 218 orient="auto" > 219 refY="0" > 220 refX="0" > 221 id="Arrow1Lend-89" > 222 style="overflow:visible"> > 223 <path > 224 id="path3777-77" > 225 d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" > 226 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:n > 227 transform="matrix(-0.8,0,0,-0.8,-10,0)" > 228 inkscape:connector-curvature="0" /> > 229 </marker> > 230 </defs> > 231 <sodipodi:namedview > 232 id="base" > 233 pagecolor="#ffffff" > 234 bordercolor="#666666" > 235 borderopacity="1.0" > 236 inkscape:pageopacity="0.0" > 237 inkscape:pageshadow="2" > 238 inkscape:zoom="1.4481878" > 239 inkscape:cx="234.81903" > 240 inkscape:cy="169.96344" > 241 inkscape:document-units="px" > 242 inkscape:current-layer="layer1" > 243 showgrid="false" > 244 inkscape:window-width="973" > 245 inkscape:window-height="687" > 246 inkscape:window-x="272" > 247 inkscape:window-y="30" > 248 inkscape:window-maximized="0" > 249 fit-margin-top="0" > 250 fit-margin-left="0" > 251 fit-margin-right="0" > 252 fit-margin-bottom="0" /> > 253 <metadata > 254 id="metadata7"> > 255 <rdf:RDF> > 256 <cc:Work > 257 rdf:about=""> > 258 <dc:format>image/svg+xml</dc:format> > 259 <dc:type > 260 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> > 261 <dc:title /> > 262 </cc:Work> > 263 </rdf:RDF> > 264 </metadata> > 265 <g > 266 inkscape:label="Layer 1" > 267 inkscape:groupmode="layer" > 268 id="layer1" > 269 transform="translate(-88.36515,-238.40424)"> > 270 <text > 271 xml:space="preserve" > 272 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 273 x="135.60928" > 274 y="298.95386" > 275 id="text2985" > 276 sodipodi:linespacing="125%" > 277 transform="scale(1.0060888,0.99394803)"><tspan > 278 sodipodi:role="line" > 279 id="tspan2987" > 280 x="135.60928" > 281 y="298.95386">get test</tspan></text> > 282 <path > 283 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 284 d="m 176.36623,295.35828 c 59.16525,-0.58879 77.47792,18.54001 82.13592,3 > 285 id="path3001" > 286 inkscape:connector-curvature="0" > 287 sodipodi:nodetypes="cc" /> > 288 <rect > 289 style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke- > 290 id="rect4335" > 291 width="381.82721" > 292 height="333.97675" > 293 x="88.86515" > 294 y="238.90424" /> > 295 <text > 296 xml:space="preserve" > 297 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 298 x="126.26069" > 299 y="288.2449" > 300 id="text2985-7" > 301 sodipodi:linespacing="125%" > 302 transform="scale(1.0060888,0.99394804)"><tspan > 303 sodipodi:role="line" > 304 id="tspan2987-2" > 305 x="126.26069" > 306 y="288.2449">(Tests list)</tspan></text> > 307 <text > 308 xml:space="preserve" > 309 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 310 x="234.48593" > 311 y="344.24658" > 312 id="text2985-0" > 313 sodipodi:linespacing="125%" > 314 transform="scale(1.0060888,0.99394804)"><tspan > 315 sodipodi:role="line" > 316 id="tspan2987-6" > 317 x="234.48593" > 318 y="344.24658">items list?</tspan></text> > 319 <text > 320 xml:space="preserve" > 321 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 322 x="230.46114" > 323 y="357.51541" > 324 id="text2985-5" > 325 sodipodi:linespacing="125%" > 326 transform="scale(1.0060888,0.99394804)"><tspan > 327 sodipodi:role="line" > 328 id="tspan2987-9" > 329 x="230.46114" > 330 y="357.51541">string</tspan></text> > 331 <text > 332 xml:space="preserve" > 333 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 334 x="268.80106" > 335 y="357.02417" > 336 id="text2985-4" > 337 sodipodi:linespacing="125%" > 338 transform="scale(1.0060888,0.99394804)"><tspan > 339 sodipodi:role="line" > 340 id="tspan2987-90" > 341 x="268.80106" > 342 y="357.02417">proc</tspan></text> > 343 <text > 344 xml:space="preserve" > 345 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 346 x="303.25842" > 347 y="356.04172" > 348 id="text2985-9" > 349 sodipodi:linespacing="125%" > 350 transform="scale(1.0060888,0.99394804)"><tspan > 351 sodipodi:role="line" > 352 id="tspan2987-1" > 353 x="303.25842" > 354 y="356.04172">list</tspan></text> > 355 <text > 356 xml:space="preserve" > 357 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 358 x="199.40099" > 359 y="357.0242" > 360 id="text2985-77" > 361 sodipodi:linespacing="125%" > 362 transform="scale(1.0060888,0.99394804)"><tspan > 363 sodipodi:role="line" > 364 x="199.40099" > 365 y="357.0242" > 366 id="tspan3116">#f</tspan></text> > 367 <path > 368 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 369 d="m 208.18134,362.26964 c 5.9438,28.21915 -7.96935,38.07082 -9.1706,63.8 > 370 id="path3001-7" > 371 inkscape:connector-curvature="0" > 372 sodipodi:nodetypes="cc" /> > 373 <text > 374 xml:space="preserve" > 375 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 376 x="157.41812" > 377 y="439.9064" > 378 id="text2985-4-6" > 379 sodipodi:linespacing="125%" > 380 transform="scale(1.0060888,0.99394804)"><tspan > 381 sodipodi:role="line" > 382 id="tspan2987-90-7" > 383 x="157.41812" > 384 y="439.9064">all prerequisites met?</tspan></text> > 385 <text > 386 xml:space="preserve" > 387 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 388 x="171.97758" > 389 y="451.69623" > 390 id="text2985-4-2" > 391 sodipodi:linespacing="125%" > 392 transform="scale(1.0060888,0.99394804)"><tspan > 393 sodipodi:role="line" > 394 id="tspan2987-90-9" > 395 x="171.97758" > 396 y="451.69623">no</tspan></text> > 397 <text > 398 xml:space="preserve" > 399 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 400 x="208.86153" > 401 y="451.20499" > 402 id="text2985-4-3" > 403 sodipodi:linespacing="125%" > 404 transform="scale(1.0060888,0.99394804)"><tspan > 405 sodipodi:role="line" > 406 id="tspan2987-90-90" > 407 x="208.86153" > 408 y="451.20499">yes</tspan></text> > 409 <path > 410 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 411 d="m 171.17455,448.19855 c -60.9492,14.05932 -70.95619,-114.75772 -41.396 > 412 id="path3001-7-9" > 413 inkscape:connector-curvature="0" > 414 sodipodi:nodetypes="cc" /> > 415 <text > 416 xml:space="preserve" > 417 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 418 x="199.94124" > 419 y="535.69879" > 420 id="text2985-4-3-6" > 421 sodipodi:linespacing="125%" > 422 transform="scale(1.0060888,0.99394804)"><tspan > 423 sodipodi:role="line" > 424 id="tspan2987-90-90-3" > 425 x="199.94124" > 426 y="535.69879">launch and drop test record</tspan></text> > 427 <path > 428 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 429 d="m 218.04848,453.08125 c -0.40371,25.28953 25.23302,35.62947 27.93793,6 > 430 id="path3001-7-1" > 431 inkscape:connector-curvature="0" > 432 sodipodi:nodetypes="cc" /> > 433 <path > 434 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 435 d="m 314.05701,358.60098 c 10.33823,35.05494 42.32247,37.09428 50.88663,2 > 436 id="path3001-7-1-6" > 437 inkscape:connector-curvature="0" > 438 sodipodi:nodetypes="cc" /> > 439 <text > 440 xml:space="preserve" > 441 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 442 x="331.94305" > 443 y="344.87405" > 444 id="text2985-4-3-6-3" > 445 sodipodi:linespacing="125%" > 446 transform="scale(1.0060888,0.99394804)"><tspan > 447 sodipodi:role="line" > 448 id="tspan2987-90-90-3-1" > 449 x="331.94305" > 450 y="344.87405">create records</tspan><tspan > 451 sodipodi:role="line" > 452 x="331.94305" > 453 y="355.94327" > 454 id="tspan3297">and add to tests list</tspan></text> > 455 <path > 456 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 457 d="M 362.32596,330.83471 C 348.25067,277.51275 294.29939,275.64594 178.84 > 458 id="path3001-7-9-2" > 459 inkscape:connector-curvature="0" > 460 sodipodi:nodetypes="cc" /> > 461 <path > 462 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 463 d="m 245.87987,358.35685 c 4.16667,48.51677 -23.10149,23.92638 -29.18967, > 464 id="path3001-7-18" > 465 inkscape:connector-curvature="0" > 466 sodipodi:nodetypes="cc" /> > 467 <path > 468 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 469 d="m 282.50013,359.82166 c 3.50245,39.44937 26.69783,25.86407 26.96139,65 > 470 id="path3001-7-3" > 471 inkscape:connector-curvature="0" > 472 sodipodi:nodetypes="cc" /> > 473 <text > 474 xml:space="preserve" > 475 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 476 x="281.47418" > 477 y="439.41516" > 478 id="text2985-4-3-8" > 479 sodipodi:linespacing="125%" > 480 transform="scale(1.0060888,0.99394804)"><tspan > 481 sodipodi:role="line" > 482 x="281.47418" > 483 y="439.41516" > 484 id="tspan3392">waiton prerequites met?</tspan><tspan > 485 sodipodi:role="line" > 486 x="281.47418" > 487 y="447.63828" > 488 id="tspan3396" > 489 style="font-size:6px">(waitonbyitem prerequisites</tspan><tspan > 490 sodipodi:role="line" > 491 x="281.47418" > 492 y="455.13828" > 493 id="tspan3398" > 494 style="font-size:6px">do not have to be met)</tspan></text> > 495 <text > 496 xml:space="preserve" > 497 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 498 x="281.47418" > 499 y="467.41602" > 500 id="text2985-4-3-3" > 501 sodipodi:linespacing="125%" > 502 transform="scale(1.0060888,0.99394804)"><tspan > 503 sodipodi:role="line" > 504 id="tspan2987-90-90-33" > 505 x="281.47418" > 506 y="467.41602">yes</tspan></text> > 507 <text > 508 xml:space="preserve" > 509 style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-h > 510 x="333.83432" > 511 y="467.78305" > 512 id="text2985-4-2-8" > 513 sodipodi:linespacing="125%" > 514 transform="scale(1.0060888,0.99394804)"><tspan > 515 sodipodi:role="line" > 516 id="tspan2987-90-9-6" > 517 x="333.83432" > 518 y="467.78305">no</tspan></text> > 519 <rect > 520 style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke- > 521 id="rect3442" > 522 width="133.29773" > 523 height="13.183292" > 524 x="191.19385" > 525 y="343.89999" /> > 526 <rect > 527 style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke- > 528 id="rect3444" > 529 width="68.357811" > 530 height="14.648103" > 531 x="163.85072" > 532 y="438.13614" /> > 533 <rect > 534 style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke- > 535 id="rect3446" > 536 width="79.588028" > 537 height="14.648103" > 538 x="276.64111" > 539 y="455.22559" /> > 540 <path > 541 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 542 d="m 291.59658,468.46176 c -0.40371,25.28953 -41.65998,22.44618 -38.95507 > 543 id="path3001-7-1-8" > 544 inkscape:connector-curvature="0" > 545 sodipodi:nodetypes="cc" /> > 546 <path > 547 style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:b > 548 d="M 352.59293,462.5344 C 463.88305,449.42673 457.66893,360.39971 423.602 > 549 id="path3001-7-1-6-6" > 550 inkscape:connector-curvature="0" > 551 sodipodi:nodetypes="csc" /> > 552 </g> > 553 </svg>

Modified items.scm from [24c226214482b949] to [d370c880ec95b9d4].

123 (let ((valid-values (let ((s (config-lookup *configdat* "validvalues" class))) 123 (let ((valid-values (let ((s (config-lookup *configdat* "validvalues" class))) 124 (if s (string-split s) #f)))) 124 (if s (string-split s) #f)))) 125 (if valid-values 125 (if valid-values 126 (if (member item valid-values) 126 (if (member item valid-values) 127 item #f) 127 item #f) 128 item))) 128 item))) 129 129 > 130 (define (items:get-items-from-config tconfig) > 131 (let* (;; db is always at *toppath*/db/megatest.db > 132 (items (hash-table-ref/default tconfig "items" '())) > 133 (itemstable (hash-table-ref/default tconfig "itemstable" '()))) > 134 (debug:print 5 "items: " items " itemstable: " itemstable) > 135 (set! items (map (lambda (item) > 136 (if (procedure? (cadr item)) > 137 (list (car item)((cadr item))) > 138 item)) > 139 items)) > 140 (set! itemstable (map (lambda (item) > 141 (if (procedure? (cadr item)) > 142 (list (car item)((cadr item))) > 143 item)) > 144 itemstable)) > 145 (if (or (not (null? items))(not (null? itemstable))) > 146 (append (item-assoc->item-list items) > 147 (item-table->item-list itemstable)) > 148 '(())))) 130 149 131 ;; (pp (item-assoc->item-list itemdat)) 150 ;; (pp (item-assoc->item-list itemdat)) 132 151 133 152 134 153

Modified key_records.scm from [46a3b150eaee7941] to [9216cfc5874e5085].

17 17 18 (define-inline (keys->key/field keys . additional) 18 (define-inline (keys->key/field keys . additional) 19 (string-join (map (lambda (k)(conc (key:get-fieldname k) " " 19 (string-join (map (lambda (k)(conc (key:get-fieldname k) " " 20 (key:get-fieldtype k))) 20 (key:get-fieldtype k))) 21 (append keys additional)) ",")) 21 (append keys additional)) ",")) 22 22 23 (define-inline (item-list->path itemdat) 23 (define-inline (item-list->path itemdat) > 24 (if (list? itemdat) 24 (string-intersperse (map cadr itemdat) "/")) | 25 (string-intersperse (map cadr itemdat) "/") > 26 "")) 25 27

Modified launch.scm from [31b7f8fd5060a7d3] to [a9c8f38913463910].

369 (db:get-header run-info) 369 (db:get-header run-info) 370 "runname")) 370 "runname")) 371 (key-vals (get-key-vals db run-id)) 371 (key-vals (get-key-vals db run-id)) 372 (key-str (string-intersperse key-vals "/")) 372 (key-str (string-intersperse key-vals "/")) 373 (dfullp (conc disk-path "/" key-str "/" runname "/" testname 373 (dfullp (conc disk-path "/" key-str "/" runname "/" testname 374 item-path)) 374 item-path)) 375 (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) 375 (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) 376 (runsdir (config-lookup *configdat* "setup" "runsdir")) | 376 (runsdir (let ((rd (config-lookup *configdat* "setup" "runsdir"))) 377 (lnkpath (conc (if runsdir runsdir (conc *toppath* "/runs")) | 377 (if rd rd (conc *toppath* "/runs")))) 378 "/" key-str "/" runname item-path))) | 378 (lnkpath (conc runsdir "/" key-str "/" runname item-path))) > 379 (if (not (file-exists? runsdir)) > 380 (begin > 381 (debug:print 0 "WARNING: runsdir did not exist! Creating it now at " r > 382 (system (conc "mkdir -p " runsdir)))) 379 ;; since this is an iterated test this is as good a place as any to 383 ;; since this is an iterated test this is as good a place as any to 380 ;; update the toptest record with its location rundir 384 ;; update the toptest record with its location rundir 381 (if (not (equal? item-path "")) 385 (if (not (equal? item-path "")) 382 (db:test-set-rundir! db run-id testname "" toptest-path)) 386 (db:test-set-rundir! db run-id testname "" toptest-path)) 383 (debug:print 2 "Setting up test run area") 387 (debug:print 2 "Setting up test run area") 384 (debug:print 2 " - creating run area in " dfullp) 388 (debug:print 2 " - creating run area in " dfullp) 385 (system (conc "mkdir -p " dfullp)) 389 (system (conc "mkdir -p " dfullp)) 386 (debug:print 2 " - creating link from " dfullp "/" testname " to " lnkpath) 390 (debug:print 2 " - creating link from " dfullp "/" testname " to " lnkpath) 387 (system (conc "mkdir -p " lnkpath)) 391 (system (conc "mkdir -p " lnkpath)) 388 392 389 ;; I suspect this section was deleting test directories under some | 393 ;; I suspect this section was deleting test directories under some 390 ;; wierd sitations | 394 ;; wierd sitations? This doesn't make sense - reenabling the rm -f 391 395 392 ;; (if (file-exists? (conc lnkpath "/" testname)) | 396 (if (file-exists? (conc lnkpath "/" testname)) 393 ;; (system (conc "rm -f " lnkpath "/" testname))) | 397 (system (conc "rm -f " lnkpath "/" testname))) 394 (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) 398 (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) 395 (if (directory? dfullp) 399 (if (directory? dfullp) 396 (begin 400 (begin 397 (let* ((cmd (conc "rsync -av" (if (> *verbosity* 1) "" "q") " " tes 401 (let* ((cmd (conc "rsync -av" (if (> *verbosity* 1) "" "q") " " tes 398 (status (system cmd))) 402 (status (system cmd))) 399 (if (not (eq? status 0)) 403 (if (not (eq? status 0)) 400 (debug:print 2 "ERROR: problem with running \"" cmd "\""))) 404 (debug:print 2 "ERROR: problem with running \"" cmd "\"")))

Modified megatest-version.scm from [c9e5e7d31e1201ff] to [27dcca54210e5a68].

1 ;; Always use two digit decimal 1 ;; Always use two digit decimal 2 ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. 2 ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. 3 3 4 (declare (unit megatest-version)) 4 (declare (unit megatest-version)) 5 5 6 (define megatest-version 1.34) | 6 (define megatest-version 1.36) 7 7

Modified megatest.scm from [1013e8e76b528b6b] to [17bb8fe0519c35e5].

322 ;; process deferred tasks per above steps 322 ;; process deferred tasks per above steps 323 323 324 ;; run all tests are are Not COMPLETED and PASS or CHECK 324 ;; run all tests are are Not COMPLETED and PASS or CHECK 325 (if (args:get-arg "-runall") 325 (if (args:get-arg "-runall") 326 (general-run-call 326 (general-run-call 327 "-runall" 327 "-runall" 328 "run all tests" 328 "run all tests" 329 (lambda (db keys keynames keyvallst) | 329 (lambda (db target runname keys keynames keyvallst) 330 (let* ((test-names (get-all-legal-tests))) ;; "PROD" is ignored for now | 330 (runs:run-tests db 331 (debug:print 1 "INFO: Attempting to start the following tests...") | 331 target 332 (debug:print 1 " " (string-intersperse test-names ",")) | 332 runname > 333 (args:get-arg "-testpatt") > 334 (args:get-arg "-itempatt") > 335 user > 336 (make-hash-table))))) > 337 > 338 ;;====================================================================== > 339 ;; run one test > 340 ;;====================================================================== > 341 > 342 ;; 1. find the config file > 343 ;; 2. change to the test directory > 344 ;; 3. update the db with "test started" status, set running host > 345 ;; 4. process launch the test > 346 ;; - monitor the process, update stats in the db every 2^n minutes > 347 ;; 5. as the test proceeds internally it calls megatest as each step is > 348 ;; started and completed > 349 ;; - step started, timestamp > 350 ;; - step completed, exit status, timestamp > 351 ;; 6. test phone home > 352 ;; - if test run time > allowed run time then kill job > 353 ;; - if cannot access db > allowed disconnect time then kill job > 354 > 355 (if (args:get-arg "-runtests") > 356 (general-run-call > 357 "-runtests" > 358 "run a test" > 359 (lambda (db target runname keys keynames keyvallst) 333 (run-tests db test-names))))) | 360 (runs:run-tests db > 361 target > 362 runname > 363 (args:get-arg "-runtests") > 364 (args:get-arg "-itempatt") > 365 user > 366 (make-hash-table))))) 334 367 335 ;;====================================================================== 368 ;;====================================================================== 336 ;; Rollup into a run 369 ;; Rollup into a run 337 ;;====================================================================== 370 ;;====================================================================== 338 (if (args:get-arg "-rollup") 371 (if (args:get-arg "-rollup") 339 (general-run-call 372 (general-run-call 340 "-rollup" 373 "-rollup" ................................................................................................................................................................................ 357 (lambda (db keys keynames keyvallst) 390 (lambda (db keys keynames keyvallst) 358 (let ((outputfile (args:get-arg "-extract-ods")) 391 (let ((outputfile (args:get-arg "-extract-ods")) 359 (runspatt (args:get-arg ":runname")) 392 (runspatt (args:get-arg ":runname")) 360 (pathmod (args:get-arg "-pathmod")) 393 (pathmod (args:get-arg "-pathmod")) 361 (keyvalalist (keys->alist keys "%"))) 394 (keyvalalist (keys->alist keys "%"))) 362 (db:extract-ods-file db outputfile keyvalalist (if runspatt runspatt "% 395 (db:extract-ods-file db outputfile keyvalalist (if runspatt runspatt "% 363 396 364 ;;====================================================================== < 365 ;; run one test < 366 ;;====================================================================== < 367 < 368 ;; 1. find the config file < 369 ;; 2. change to the test directory < 370 ;; 3. update the db with "test started" status, set running host < 371 ;; 4. process launch the test < 372 ;; - monitor the process, update stats in the db every 2^n minutes < 373 ;; 5. as the test proceeds internally it calls megatest as each step is < 374 ;; started and completed < 375 ;; - step started, timestamp < 376 ;; - step completed, exit status, timestamp < 377 ;; 6. test phone home < 378 ;; - if test run time > allowed run time then kill job < 379 ;; - if cannot access db > allowed disconnect time then kill job < 380 < 381 (if (args:get-arg "-runtests") < 382 (general-run-call < 383 "-runtests" < 384 "run a test" < 385 (lambda (db keys keynames keyvallst) < 386 (let ((test-names (string-split (args:get-arg "-runtests") ","))) < 387 (run-tests db test-names))))) < 388 < 389 ;;====================================================================== 397 ;;====================================================================== 390 ;; execute the test 398 ;; execute the test 391 ;; - gets called on remote host 399 ;; - gets called on remote host 392 ;; - receives info from the -execute param 400 ;; - receives info from the -execute param 393 ;; - passes info to steps via MT_CMDINFO env var (future is to use a dot file 401 ;; - passes info to steps via MT_CMDINFO env var (future is to use a dot file 394 ;; - gathers host info and 402 ;; - gathers host info and 395 ;;====================================================================== 403 ;;======================================================================

Added monitor.scm version [6e7a5682b5e7ed80]

> 1 ;; Copyright 2006-2011, Matthew Welland. > 2 ;; > 3 ;; This program is made available under the GNU GPL version 2.0 or > 4 ;; greater. See the accompanying file COPYING for details. > 5 ;; > 6 ;; This program is distributed WITHOUT ANY WARRANTY; without even the > 7 ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR > 8 ;; PURPOSE. > 9 > 10 ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') > 11 > 12 (use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking) > 13 (import (prefix sqlite3 sqlite3:)) > 14 > 15 (declare (unit runs)) > 16 (declare (uses db)) > 17 (declare (uses common)) > 18 (declare (uses items)) > 19 (declare (uses runconfig)) > 20 > 21 (include "common_records.scm") > 22 (include "key_records.scm") > 23 (include "db_records.scm") > 24 (include "run_records.scm") > 25

Deleted old-runs.scm version [7bcb24f541f2e9d4]

1 ;; register a test run with the db < 2 (define (register-run db keys) ;; test-name) < 3 (let* ((keystr (keys->keystr keys)) < 4 (comma (if (> (length keys) 0) "," "")) < 5 (andstr (if (> (length keys) 0) " AND " "")) < 6 (valslots (keys->valslots keys)) ;; ?,?,? ... < 7 (keyvallst (keys->vallist keys)) ;; extracts the values from remainder < 8 (runname (get-with-default ":runname" #f)) < 9 (state (get-with-default ":state" "no")) < 10 (status (get-with-default ":status" "n/a")) < 11 (allvals (append (list runname state status user) keyvallst)) < 12 (qryvals (append (list runname) keyvallst)) < 13 (key=?str (string-intersperse (map (lambda (k)(conc (key:get-fieldname < 14 (debug:print 3 "keys: " keys " allvals: " allvals " keyvallst: " keyvallst) < 15 (debug:print 2 "NOTE: using key " (string-intersperse keyvallst "/") " for t < 16 (if (and runname (null? (filter (lambda (x)(not x)) keyvallst))) ;; there mu < 17 (let ((res #f)) < 18 (apply sqlite3:execute db (conc "INSERT OR IGNORE INTO runs (runname,s < 19 allvals) < 20 (apply sqlite3:for-each-row < 21 (lambda (id) < 22 (set! res id)) < 23 db < 24 (let ((qry (conc "SELECT id FROM runs WHERE (runname=? " andstr key=? < 25 ;(debug:print 4 "qry: " qry) < 26 qry) < 27 qryvals) < 28 (sqlite3:execute db "UPDATE runs SET state=?,status=? WHERE id=?;" sta < 29 res) < 30 (begin < 31 (debug:print 0 "ERROR: Called without all necessary keys") < 32 #f)))) < 33 < 34 ;; This is original run-tests, this routine is deprecated and we will transition < 35 ;; < 36 (define (run-tests db test-names) < 37 (let* ((keys (db-get-keys db)) < 38 (keyvallst (keys->vallist keys #t)) < 39 (run-id (register-run db keys)) ;; test-name))) < 40 (deferred '()) ;; delay running these since they have a waiton claus < 41 (runconfigf (conc *toppath* "/runconfigs.config")) < 42 (required-tests '())) < 43 < 44 ;; now add non-directly referenced dependencies (i.e. waiton) < 45 ;; could cache all these since they need to be read again ... < 46 ;; FIXME SOMEDAY < 47 (if (not (null? test-names)) < 48 (let loop ((hed (car test-names)) < 49 (tal (cdr test-names))) < 50 (let* ((config (test:get-testconfig hed #f)) < 51 (waitons (string-split (let ((w (config-lookup config "requirem < 52 (if w w ""))))) < 53 (for-each < 54 (lambda (waiton) < 55 (if (and waiton (not (member waiton test-names))) < 56 (begin < 57 (set! required-tests (cons waiton required-tests)) < 58 (set! test-names (append test-names (list waiton)))))) < 59 waitons) < 60 (let ((remtests (delete-duplicates (append waitons tal)))) < 61 (if (not (null? remtests)) < 62 (loop (car remtests)(cdr remtests))))))) < 63 < 64 (if (not (null? required-tests)) < 65 (debug:print 1 "INFO: Adding " required-tests " to the run queue") < 66 (debug:print 1 "INFO: No prerequisites added")) < 67 < 68 ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if < 69 ;; -keepgoing is specified < 70 < 71 (set-megatest-env-vars db run-id) ;; these may be needed by the launching pr < 72 < 73 (if (file-exists? runconfigf) < 74 (setup-env-defaults db runconfigf run-id *already-seen-runconfig-info* e < 75 (debug:print 0 "WARNING: You do not have a run config file: " runconfigf < 76 < 77 (if (and (eq? *passnum* 0) < 78 (args:get-arg "-keepgoing")) < 79 (begin < 80 ;; have to delete test records where NOT_STARTED since they can cause < 81 ;; get stuck due to becoming inaccessible from a failed test. I.e. if < 82 ;; on test A but test B reached the point on being registered as NOT_S < 83 ;; A failed for some reason then on re-run using -keepgoing the run ca < 84 (db:delete-tests-in-state db run-id "NOT_STARTED") < 85 (db:set-tests-state-status db run-id test-names #f "FAIL" "NOT_STARTED < 86 (set! *passnum* (+ *passnum* 1)) < 87 (let loop ((numtimes 0)) < 88 (for-each < 89 (lambda (test-name) < 90 (if (runs:can-run-more-tests db) < 91 (run-one-test db run-id test-name keyvallst) < 92 ;; add some delay < 93 ;(sleep 2) < 94 )) < 95 (tests:sort-by-priority-and-waiton test-names)) < 96 ;; (run-waiting-tests db) < 97 (if (args:get-arg "-keepgoing") < 98 (let ((estrem (db:estimated-tests-remaining db run-id))) < 99 (if (and (> estrem 0) < 100 (eq? *globalexitstatus* 0)) < 101 (begin < 102 (debug:print 1 "Keep going, estimated " estrem " tests remaini < 103 (thread-sleep! 3) < 104 (run-waiting-tests db) < 105 (loop (+ numtimes 1))))))))) < 106 < 107 ;; VERY INEFFICIENT! Move stuff that should be done once up to calling proc < 108 (define (run-one-test db run-id test-name keyvallst) < 109 (debug:print 1 "Launching test " test-name) < 110 ;; All these vars might be referenced by the testconfig file reader < 111 (setenv "MT_TEST_NAME" test-name) ;; < 112 (setenv "MT_RUNNAME" (args:get-arg ":runname")) < 113 < 114 ;; (set-megatest-env-vars db run-id) ;; these may be needed by the launching p < 115 < 116 (change-directory *toppath*) < 117 (let* ((test-path (conc *toppath* "/tests/" test-name)) ;; could use test:g < 118 (test-configf (conc test-path "/testconfig")) < 119 (testexists (and (file-exists? test-configf)(file-read-access? test-c < 120 (test-conf (if testexists (read-config test-configf #f #t) (make-has < 121 (waiton (let ((w (config-lookup test-conf "requirements" "waiton" < 122 (if (string? w)(string-split w)'()))) < 123 (tags (let ((t (config-lookup test-conf "setup" "tags"))) < 124 ;; we want our tags to be separated by commas and fully < 125 ;; so that queries with "like" can tie to the commas at < 126 ;; while also allowing the end user to freely use space < 127 (if (string? t)(string-substitute (regexp "[,\\s]+") ", < 128 '())))) < 129 (if (not testexists) < 130 (begin < 131 (debug:print 0 "ERROR: Can't find config file " test-configf) < 132 (exit 2)) < 133 ;; put top vars into convenient variables and open the db < 134 (let* (;; db is always at *toppath*/db/megatest.db < 135 (items (hash-table-ref/default test-conf "items" '())) < 136 (itemstable (hash-table-ref/default test-conf "itemstable" '())) < 137 (allitems (if (or (not (null? items))(not (null? itemstable))) < 138 (append (item-assoc->item-list items) < 139 (item-table->item-list itemstable)) < 140 '(())))) ;; a list with one null list is a test < 141 ;; (runconfigf (conc *toppath* "/runconfigs.config"))) < 142 (debug:print 1 "items: ") < 143 (if (>= *verbosity* 1)(pp allitems)) < 144 (if (>= *verbosity* 5) < 145 (begin < 146 (print "items: ")(pp (item-assoc->item-list items)) < 147 (print "itestable: ")(pp (item-table->item-list itemstable)))) < 148 (if (args:get-arg "-m") < 149 (db:set-comment-for-run db run-id (args:get-arg "-m"))) < 150 < 151 ;; Here is where the test_meta table is best updated < 152 (runs:update-test_meta db test-name test-conf) < 153 < 154 ;; braindead work-around for poorly specified allitems list BUG!!! FIX < 155 (if (null? allitems)(set! allitems '(()))) < 156 (let loop ((itemdat (car allitems)) < 157 (tal (cdr allitems))) < 158 ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") < 159 ;; Handle lists of items < 160 (let* ((item-path (item-list->path itemdat)) ;; (string-interspe < 161 (new-test-path (string-intersperse (cons test-path (map cadr < 162 (new-test-name (if (equal? item-path "") test-name (conc test < 163 (testdat #f) < 164 (num-running (db:get-count-tests-running db)) < 165 (max-concurrent-jobs (config-lookup *configdat* "setup" "max_ < 166 (parent-test (and (not (null? items))(equal? item-path ""))) < 167 (single-test (and (null? items) (equal? item-path ""))) < 168 (item-test (not (equal? item-path ""))) < 169 (item-patt (args:get-arg "-itempatt")) < 170 (patt-match (if item-patt < 171 (string-search (glob->regexp < 172 (string-translate item-patt " < 173 item-path) < 174 #t))) < 175 (debug:print 3 "max-concurrent-jobs: " max-concurrent-jobs ", num- < 176 (if (and patt-match (runs:can-run-more-tests db)) < 177 (begin < 178 (let loop2 ((ts (db:get-test-info db run-id test-name item-p < 179 (ct 0)) < 180 (if (and (not ts) < 181 (< ct 10)) < 182 (begin < 183 (register-test db run-id test-name item-path) < 184 (db:test-set-comment db run-id test-name item-path " < 185 (loop2 (db:get-test-info db run-id test-name item-pa < 186 (+ ct 1))) < 187 (if ts < 188 (set! testdat ts) < 189 (begin < 190 (debug:print 0 "WARNING: Couldn't register test < 191 (if (not (null? tal)) < 192 (loop (car tal)(cdr tal))))))) < 193 (change-directory test-path) < 194 ;; this block is here only to inform the user early on < 195 < 196 ;; NB// Moving the setting of runconfig.config vars to *befo < 197 ;; the calling of each test. < 198 ;; (if (file-exists? runconfigf) < 199 ;; (setup-env-defaults db runconfigf run-id *already-see < 200 ;; (debug:print 0 "WARNING: You do not have a run config < 201 (debug:print 4 "run-id: " run-id " test-name: " test-name " < 202 (case (if (args:get-arg "-force") < 203 'NOT_STARTED < 204 (if testdat < 205 (string->symbol (test:get-state testdat)) < 206 'failed-to-insert)) < 207 ((failed-to-insert) < 208 (debug:print 0 "ERROR: Failed to insert the record into t < 209 ((NOT_STARTED COMPLETED) < 210 (debug:print 6 "Got here, " (test:get-state testdat)) < 211 (let ((runflag #f)) < 212 (cond < 213 ;; i.e. this is the parent test to a suite of items, n < 214 (parent-test < 215 (set! runflag #f)) < 216 ;; -force, run no matter what < 217 ((args:get-arg "-force")(set! runflag #t)) < 218 ;; NOT_STARTED, run no matter what < 219 ((equal? (test:get-state testdat) "NOT_STARTED")(set! < 220 ;; not -rerun and PASS, WARN or CHECK, do no run < 221 ((and (or (not (args:get-arg "-rerun")) < 222 (args:get-arg "-keepgoing")) < 223 (member (test:get-status testdat) '("PASS" "WARN < 224 (set! runflag #f)) < 225 ;; -rerun and status is one of the specifed, run it < 226 ((and (args:get-arg "-rerun") < 227 (let ((rerunlst (string-split (args:get-arg "-re < 228 (member (test:get-status testdat) rerunlst))) < 229 (set! runflag #t)) < 230 ;; -keepgoing, do not rerun FAIL < 231 ((and (args:get-arg "-keepgoing") < 232 (member (test:get-status testdat) '("FAIL"))) < 233 (set! runflag #f)) < 234 ((and (not (args:get-arg "-rerun")) < 235 (member (test:get-status testdat) '("FAIL" "n/a" < 236 (set! runflag #t)) < 237 (else (set! runflag #f))) < 238 (debug:print 6 "RUNNING => runflag: " runflag " STATE: < 239 (if (not runflag) < 240 (if (not parent-test) < 241 (debug:print 1 "NOTE: Not starting test " new-t < 242 (let* ((get-prereqs-cmd (lambda () < 243 (db-get-prereqs-not-met d < 244 (launch-cmd (lambda () < 245 (launch-test db run-id (a < 246 (testrundat (list get-prereqs-cmd launc < 247 (if (or (args:get-arg "-force") < 248 (let ((preqs-not-yet-met ((car testrundat < 249 (debug:print 2 "Preqrequesites for " te < 250 (null? preqs-not-yet-met))) ;; are ther < 251 (if (not ((cadr testrundat))) ;; this is the < 252 (begin < 253 (print "ERROR: Failed to launch the tes < 254 (set! *globalexitstatus* 1) ;; < 255 (process-signal (current-process-id) si < 256 ;(exit 1) < 257 )) < 258 (if (not (args:get-arg "-keepgoing")) < 259 (hash-table-set! *waiting-queue* new-test < 260 ((KILLED) < 261 (debug:print 1 "NOTE: " new-test-name " is already runnin < 262 ((LAUNCHED REMOTEHOSTSTART RUNNING) < 263 (if (> (- (current-seconds)(+ (db:test-get-event_time tes < 264 (db:test-get-run_duration t < 265 100) ;; i.e. no update for more than 100 seconds < 266 (begin < 267 (debug:print 0 "WARNING: Test " test-name " appears < 268 (test-set-status! db run-id test-name "INCOMPLETE" < 269 (debug:print 2 "NOTE: " test-name " is already runnin < 270 (else (debug:print 0 "ERROR: Failed to launch test " < 271 (if (not (null? tal)) < 272 (loop (car tal)(cdr tal))))))))) < 273 < 274 (define (run-waiting-tests db) < 275 (let ((numtries 0) < 276 (last-try-time (current-seconds)) < 277 (times (list 1))) ;; minutes to wait before trying again to < 278 ;; BUG this hack of brute force retrying works quite well for many cases but < 279 ;; what is needed is to check the db for tests that have failed less tha < 280 ;; N times or never been started and kick them off again < 281 (let loop ((waiting-test-names (hash-table-keys *waiting-queue*))) < 282 (cond < 283 ((not (runs:can-run-more-tests db)) < 284 (thread-sleep! 2) < 285 (loop waiting-test-names)) < 286 ((null? waiting-test-names) < 287 (debug:print 1 "All tests launched")) < 288 (else < 289 (set! numtries (+ numtries 1)) < 290 (for-each (lambda (testname) < 291 (if (runs:can-run-more-tests db) < 292 (let* ((testdat (hash-table-ref *waiting-queue* testname < 293 (prereqs ((car testdat))) < 294 (ldb (if db db (open-db)))) < 295 (debug:print 2 "prereqs remaining: " prereqs) < 296 (if (null? prereqs) < 297 (begin < 298 (debug:print 2 "Prerequisites met, launching " t < 299 ((cadr testdat)) < 300 (hash-table-delete! *waiting-queue* testname))) < 301 (if (not db) < 302 (sqlite3:finalize! ldb))))) < 303 waiting-test-names) < 304 ;; (sleep 10) ;; no point in rushing things at this stage? < 305 (loop (hash-table-keys *waiting-queue*))))))) <

Modified runs.scm from [5d46e1bbed85c030] to [ec19d61978fa0140].

20 (declare (uses runconfig)) 20 (declare (uses runconfig)) 21 (declare (uses tests)) 21 (declare (uses tests)) 22 22 23 (include "common_records.scm") 23 (include "common_records.scm") 24 (include "key_records.scm") 24 (include "key_records.scm") 25 (include "db_records.scm") 25 (include "db_records.scm") 26 (include "run_records.scm") 26 (include "run_records.scm") 27 < 28 ;; stuff to be deprecated then removed < 29 (include "old-runs.scm") | 27 (include "test_records.scm") 30 < 31 28 32 ;; runs:get-runs-by-patt 29 ;; runs:get-runs-by-patt 33 ;; get runs by list of criteria 30 ;; get runs by list of criteria 34 ;; register a test run with the db 31 ;; register a test run with the db 35 ;; 32 ;; 36 ;; Use: (db-get-value-by-header (db:get-header runinfo)(db:get-row runinfo)) 33 ;; Use: (db-get-value-by-header (db:get-header runinfo)(db:get-row runinfo)) 37 ;; to extract info from the structure returned 34 ;; to extract info from the structure returned ................................................................................................................................................................................ 91 88 92 (define (set-item-env-vars itemdat) 89 (define (set-item-env-vars itemdat) 93 (for-each (lambda (item) 90 (for-each (lambda (item) 94 (debug:print 2 "setenv " (car item) " " (cadr item)) 91 (debug:print 2 "setenv " (car item) " " (cadr item)) 95 (setenv (car item) (cadr item))) 92 (setenv (car item) (cadr item))) 96 itemdat)) 93 itemdat)) 97 94 98 (define (runs:can-run-more-tests db) | 95 (define (runs:can-run-more-tests db test-record) > 96 (let* ((tconfig (tests:testqueue-get-testconfig test-record)) > 97 (jobgroup (config-lookup tconfig "requirements" "jobgrou 99 (let ((num-running (db:get-count-tests-running db)) | 98 (num-running (db:get-count-tests-running db)) > 99 (num-running-in-jobgroup (db:get-count-tests-running-in-jobgroup db job 100 (max-concurrent-jobs (config-lookup *configdat* "setup" "max_concurrent_ | 100 (max-concurrent-jobs (config-lookup *configdat* "setup" "max_co > 101 (job-group-limit (config-lookup *configdat* "jobgroups" jobgrou 101 (debug:print 2 "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " 102 (debug:print 2 "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " 102 (if (not (eq? 0 *globalexitstatus*)) 103 (if (not (eq? 0 *globalexitstatus*)) 103 #f 104 #f > 105 (let ((can-not-run-more (cond 104 (if (or (not max-concurrent-jobs) | 106 ;; if max-concurrent-jobs is set and the number > 107 ;; than it than cannot run more jobs 105 (and max-concurrent-jobs | 108 ((and max-concurrent-jobs 106 (string->number max-concurrent-jobs) | 109 (string->number max-concurrent-jobs) 107 (not (>= num-running (string->number max-concurrent-jobs))) | 110 (>= num-running (string->number max-concu 108 #t < 109 (begin < 110 (debug:print 0 "WARNING: Max running jobs exceeded, current number | 111 (debug:print 0 "WARNING: Max running jobs exce 111 ", max_concurrent_jobs: " max-concurrent-jobs) | 112 ", max_concurrent_jobs: " max-con > 113 #t) > 114 ;; if job-group-limit is set and number of jobs > 115 ;; than the limit then cannot run more jobs of > 116 ((and job-group-limit > 117 (>= num-running-in-jobgroup job-group-lim > 118 (debug:print 1 "WARNING: number of jobs " num- > 119 " in " jobgroup " exceeded, will > 120 #t) 112 #f))))) | 121 (else #f)))) 113 < > 122 (not can-not-run-more))))) 114 123 115 ;;====================================================================== 124 ;;====================================================================== 116 ;; New methodology. These routines will replace the above in time. For 125 ;; New methodology. These routines will replace the above in time. For 117 ;; now the code is duplicated. This stuff is initially used in the monitor 126 ;; now the code is duplicated. This stuff is initially used in the monitor 118 ;; based code. 127 ;; based code. 119 ;;====================================================================== 128 ;;====================================================================== 120 129 ................................................................................................................................................................................ 152 ;; This is a duplicate of run-tests (which has been deprecated). Use this one in 161 ;; This is a duplicate of run-tests (which has been deprecated). Use this one in 153 ;; keyvals 162 ;; keyvals 154 (define (runs:run-tests db target runname test-patts item-patts user flags) 163 (define (runs:run-tests db target runname test-patts item-patts user flags) 155 (let* ((keys (db-get-keys db)) 164 (let* ((keys (db-get-keys db)) 156 (keyvallst (keys:target->keyval keys target)) 165 (keyvallst (keys:target->keyval keys target)) 157 (run-id (runs:register-run db keys keyvallst runname "new" "n/a" u 166 (run-id (runs:register-run db keys keyvallst runname "new" "n/a" u 158 (deferred '()) ;; delay running these since they have a waiton claus 167 (deferred '()) ;; delay running these since they have a waiton claus > 168 ;; keepgoing is the defacto modality now, will add hit-n-run a bit late 159 (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) | 169 ;; (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) 160 (test-names '()) 170 (test-names '()) 161 (runconfigf (conc *toppath* "/runconfigs.config")) 171 (runconfigf (conc *toppath* "/runconfigs.config")) 162 (required-tests '())) | 172 (required-tests '()) > 173 (test-records (make-hash-table))) 163 174 164 (set-megatest-env-vars db run-id) ;; these may be needed by the launching pr 175 (set-megatest-env-vars db run-id) ;; these may be needed by the launching pr 165 176 166 (if (file-exists? runconfigf) 177 (if (file-exists? runconfigf) 167 (setup-env-defaults db runconfigf run-id *already-seen-runconfig-info* " 178 (setup-env-defaults db runconfigf run-id *already-seen-runconfig-info* " 168 (debug:print 0 "WARNING: You do not have a run config file: " runconfigf 179 (debug:print 0 "WARNING: You do not have a run config file: " runconfigf 169 180 ................................................................................................................................................................................ 173 (lambda (patt) 184 (lambda (patt) 174 (let ((tests (glob (conc *toppath* "/tests/" (string-translate patt "%" " 185 (let ((tests (glob (conc *toppath* "/tests/" (string-translate patt "%" " 175 (set! tests (filter (lambda (test)(file-exists? (conc test "/testconfig 186 (set! tests (filter (lambda (test)(file-exists? (conc test "/testconfig 176 (set! test-names (append test-names 187 (set! test-names (append test-names 177 (map (lambda (testp) 188 (map (lambda (testp) 178 (last (string-split testp "/"))) 189 (last (string-split testp "/"))) 179 tests))))) 190 tests))))) 180 (string-split test-patts ",")) | 191 (if test-patts (string-split test-patts ",")(list "%"))) 181 192 182 ;; now remove duplicates 193 ;; now remove duplicates 183 (set! test-names (delete-duplicates test-names)) 194 (set! test-names (delete-duplicates test-names)) 184 195 185 (debug:print 0 "INFO: test names " test-names) 196 (debug:print 0 "INFO: test names " test-names) 186 197 > 198 ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if > 199 ;; -keepgoing is specified > 200 (if (eq? *passnum* 0) > 201 (begin > 202 ;; have to delete test records where NOT_STARTED since they can cause > 203 ;; get stuck due to becoming inaccessible from a failed test. I.e. if > 204 ;; on test A but test B reached the point on being registered as NOT_S > 205 ;; A failed for some reason then on re-run using -keepgoing the run ca > 206 (db:delete-tests-in-state db run-id "NOT_STARTED") > 207 (db:set-tests-state-status db run-id test-names #f "FAIL" "NOT_STARTED > 208 187 ;; now add non-directly referenced dependencies (i.e. waiton) 209 ;; now add non-directly referenced dependencies (i.e. waiton) 188 ;; could cache all these since they need to be read again ... < 189 ;; FIXME SOMEDAY < 190 (if (not (null? test-names)) 210 (if (not (null? test-names)) 191 (let loop ((hed (car test-names)) 211 (let loop ((hed (car test-names)) 192 (tal (cdr test-names))) | 212 (tal (cdr test-names))) ;; 'return-procs tells the co 193 (let* ((config (test:get-testconfig hed #f)) | 213 (let* ((config (test:get-testconfig hed 'return-procs)) 194 (waitons (string-split (let ((w (config-lookup config "requirem 214 (waitons (string-split (let ((w (config-lookup config "requirem 195 (if w w ""))))) 215 (if w w ""))))) > 216 ;; (items (items:get-items-from-config config))) > 217 (if (not (hash-table-ref/default test-records hed #f)) > 218 (hash-table-set! test-records > 219 hed (vector hed ;; 0 > 220 config ;; 1 > 221 waitons ;; 2 > 222 (config-lookup config "requirements > 223 (let ((items (hash-table-ref/d > 224 (itemstable (hash-table-ref/d > 225 ;; if either items or items table > 226 ;; process can know to call items > 227 ;; if either is a list and none i > 228 ;; otherwise return #f - this is > 229 (cond > 230 ((procedure? items) items) > 231 ((procedure? itemstable) itemsta > 232 ((or (list? items)(list? itemsta > 233 (items:get-items-from-config co > 234 (else #f))) > 235 #f ;; itemsdat 5 > 236 ;; #f ;; spare > 237 ))) 196 (for-each 238 (for-each 197 (lambda (waiton) 239 (lambda (waiton) 198 (if (and waiton (not (member waiton test-names))) 240 (if (and waiton (not (member waiton test-names))) 199 (begin 241 (begin 200 (set! required-tests (cons waiton required-tests)) 242 (set! required-tests (cons waiton required-tests)) 201 (set! test-names (append test-names (list waiton)))))) 243 (set! test-names (append test-names (list waiton)))))) 202 waitons) 244 waitons) 203 (let ((remtests (delete-duplicates (append waitons tal)))) 245 (let ((remtests (delete-duplicates (append waitons tal)))) 204 (if (not (null? remtests)) 246 (if (not (null? remtests)) 205 (loop (car remtests)(cdr remtests))))))) 247 (loop (car remtests)(cdr remtests))))))) 206 248 207 (if (not (null? required-tests)) 249 (if (not (null? required-tests)) 208 (debug:print 1 "INFO: Adding " required-tests " to the run queue")) 250 (debug:print 1 "INFO: Adding " required-tests " to the run queue")) > 251 ;; NOTE: these are all parent tests, items are not expanded yet. > 252 (runs:run-tests-queue db run-id runname test-records keyvallst flags))) 209 | 253 210 ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if < 211 ;; -keepgoing is specified < > 254 (define (runs:run-tests-queue db run-id runname test-records keyvallst flags) > 255 ;; At this point the list of parent tests is expanded > 256 ;; NB// Should expand items here and then insert into the run queue. > 257 (debug:print 5 "test-records: " test-records ", keyvallst: " keyvallst) > 258 (let ((sorted-test-names (tests:sort-by-priority-and-waiton test-records)) > 259 (item-patts (hash-table-ref/default flags "-itempatt" #f))) > 260 (let loop (; (numtimes 0) ;; shouldn't need this > 261 (hed (car sorted-test-names)) > 262 (tal (cdr sorted-test-names))) > 263 (let* ((test-record (hash-table-ref test-records hed)) > 264 (tconfig (tests:testqueue-get-testconfig test-record)) > 265 (waitons (tests:testqueue-get-waitons test-record)) > 266 (priority (tests:testqueue-get-priority test-record)) > 267 (itemdat (tests:testqueue-get-itemdat test-record)) > 268 (items (tests:testqueue-get-items test-record)) > 269 (item-path (item-list->path itemdat))) > 270 (debug:print 6 > 271 "itemdat: " itemdat > 272 "\n items: " items > 273 "\n item-path: " item-path) > 274 (cond > 275 ((not items) ;; when false the test is ok to be handed off to launch (b > 276 (let ((have-resources (runs:can-run-more-tests db test-record)) ;; lo > 277 (prereqs-not-met (db:get-prereqs-not-met db run-id waitons item- 212 (if (and (eq? *passnum* 0) | 278 (if (and have-resources 213 keepgoing) < > 279 (null? prereqs-not-met)) > 280 ;; no loop - drop though and use the loop at the bottom > 281 (run:test db run-id runname keyvallst test-record flags #f) > 282 ;; else the run is stuck, temporarily or permanently > 283 (let ((newtal (append tal (list hed)))) > 284 ;; couldn't run, take a breather > 285 (thread-sleep! 1) > 286 (loop (car tal)(cdr tal)))))) > 287 > 288 ;; case where an items came in as a list been processed > 289 ((and (list? items) ;; thus we know our items are already calculate > 290 (not itemdat)) ;; and not yet expanded into the list of things > 291 (if (>= *verbosity* 1)(pp items)) > 292 ;; (if (>= *verbosity* 5) 214 (begin | 293 ;; (begin 215 ;; have to delete test records where NOT_STARTED since they can cause < 216 ;; get stuck due to becoming inaccessible from a failed test. I.e. if < 217 ;; on test A but test B reached the point on being registered as NOT_S < 218 ;; A failed for some reason then on re-run using -keepgoing the run ca < 219 (db:delete-tests-in-state db run-id "NOT_STARTED") < 220 (db:set-tests-state-status db run-id test-names #f "FAIL" "NOT_STARTED < 221 (set! *passnum* (+ *passnum* 1)) < 222 (let loop ((numtimes 0)) < > 294 ;; (print "items: ") (pp (item-assoc->item-list items)) > 295 ;; (print "itemstable: ")(pp (item-table->item-list itemstable)) 223 (for-each | 296 (for-each > 297 (lambda (my-itemdat) > 298 (let* ((new-test-record (let ((newrec (make-tests:testqueue))) > 299 (vector-copy! test-record newrec) > 300 newrec)) > 301 (my-item-path (item-list->path my-itemdat)) > 302 (item-matches (if item-patts ;; here we are filtering > 303 (let ((res #f)) ;; look through all the > 304 (for-each 224 (lambda (test-name) | 305 (lambda (patt) > 306 (if (string-search (glob->regexp > 307 (string-translate > 308 item-path) > 309 (set! res #t))) > 310 (string-split item-patts ",")) > 311 res) > 312 #t))) > 313 (if item-matches ;; yes, we want to process this item > 314 (let ((newtestname (conc hed "/" my-item-path))) > 315 (tests:testqueue-set-items! new-test-record #f) > 316 (tests:testqueue-set-itemdat! new-test-record my-itemdat) > 317 (hash-table-set! test-records newtestname new-test-record) > 318 (set! tal (cons newtestname tal)))))) ;; since these are it > 319 items) > 320 (loop (car tal)(cdr tal))) > 321 > 322 ;; if items is a proc then need to run items:get-items-from-config, get > 323 ;; - but only do that if resources exist to kick off the job > 324 ((procedure? items) 225 (if (runs:can-run-more-tests db) | 325 (if (runs:can-run-more-tests db test-record) 226 (run:test db run-id runname test-name keyvallst item-patts flags) < 227 )) < 228 (tests:sort-by-priority-and-waiton test-names)) < 229 ;; (run-waiting-tests db) < 230 (if keepgoing < 231 (let ((estrem (db:estimated-tests-remaining db run-id))) < 232 (if (and (> estrem 0) < 233 (eq? *globalexitstatus* 0)) < > 326 (let ((items-list (items:get-items-from-config tconfig))) > 327 (if (list? items-list) 234 (begin | 328 (begin 235 (debug:print 1 "Keep going, estimated " estrem " tests remaini < > 329 (tests:testqueue-set-items test-record items-list) > 330 (loop hed tal)) > 331 (begin > 332 (debug:print 0 "ERROR: The proc from reading the setup did > 333 (exit 1)))) > 334 (let ((newtal (append tal (list hed)))) > 335 ;; if can't run more tests, lets take a breather 236 (thread-sleep! 3) | 336 (thread-sleep! 1) 237 (run-waiting-tests db) < 238 (loop (+ numtimes 1))))))))) < > 337 (loop (car newtal)(cdr newtal))))) 239 | 338 > 339 ;; this case should not happen, added to help catch any bugs > 340 ((and (list? items) itemdat) > 341 (debug:print 0 "ERROR: Should not have a list of items in a test and t > 342 (exit 1))) > 343 > 344 ;; we get here on "drop through" - loop for next test in queue > 345 (if (null? tal) > 346 (debug:print 1 "INFO: All tests launched") > 347 (loop (car tal)(cdr tal))))))) > 348 > 349 ;; parent-test is there as a placeholder for when parent-tests can be run as a s 240 (define (run:test db run-id runname test-name keyvallst item-patts flags) | 350 (define (run:test db run-id runname keyvallst test-record flags parent-test) 241 (debug:print 1 "Launching test " test-name) < 242 ;; All these vars might be referenced by the testconfig file reader 351 ;; All these vars might be referenced by the testconfig file reader 243 (setenv "MT_TEST_NAME" test-name) ;; | 352 (let* ((test-name (tests:testqueue-get-testname test-record)) 244 (setenv "MT_RUNNAME" runname) | 353 (test-waitons (tests:testqueue-get-waitons test-record)) 245 (set-megatest-env-vars db run-id) ;; these may be needed by the launching proc | 354 (test-conf (tests:testqueue-get-testconfig test-record)) 246 (change-directory *toppath*) | 355 (itemdat (tests:testqueue-get-itemdat test-record)) 247 (let* ((test-path (conc *toppath* "/tests/" test-name)) ;; could use test:g | 356 (test-path (conc *toppath* "/tests/" test-name)) ;; could use test:g 248 (test-configf (conc test-path "/testconfig")) < 249 (testexists (and (file-exists? test-configf)(file-read-access? test-c < 250 (test-conf (if testexists (read-config test-configf #f #t) (make-has < 251 (waiton (let ((w (config-lookup test-conf "requirements" "waiton" < 252 (if (string? w)(string-split w)'()))) < 253 (force (hash-table-ref/default flags "-force" #f)) 357 (force (hash-table-ref/default flags "-force" #f)) 254 (rerun (hash-table-ref/default flags "-rerun" #f)) 358 (rerun (hash-table-ref/default flags "-rerun" #f)) 255 (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) 359 (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) 256 ;; Are these tags still used? I don't think so... | 360 (item-path "")) 257 ;;(tags (let ((t (config-lookup test-conf "setup" "tags"))) | 361 (debug:print 5 258 ;; ;; we want our tags to be separated by commas and fully | 362 "test-config: " (hash-table->alist test-conf) 259 ;; ;; so that queries with "like" can tie to the commas at | 363 "\n itemdat: " itemdat 260 ;; ;; while also allowing the end user to freely use space < 261 ;; (if (string? t)(string-substitute (regexp "[,\\s]+") ", < 262 ;; '())))) < 263 ) | 364 ) > 365 ;; setting itemdat to a list if it is #f > 366 (if (not itemdat)(set! itemdat '())) > 367 (set! item-path (item-list->path itemdat)) 264 (if (not testexists) | 368 (debug:print 1 "Attempting to launch test " test-name "/" item-path) 265 ;; if the test is ill defined spit out an error but keep going (differen | 369 (setenv "MT_TEST_NAME" test-name) ;; 266 (debug:print 0 "ERROR: Can't find config file " test-configf) | 370 (setenv "MT_RUNNAME" runname) 267 ;; put top vars into convenient variables and open the db | 371 (set-megatest-env-vars db run-id) ;; these may be needed by the launching pr 268 (let* (;; db is always at *toppath*/db/megatest.db | 372 (change-directory *toppath*) 269 (items (hash-table-ref/default test-conf "items" '())) < 270 (itemstable (hash-table-ref/default test-conf "itemstable" '())) < 271 (allitems (if (or (not (null? items))(not (null? itemstable))) < 272 (append (item-assoc->item-list items) < 273 (item-table->item-list itemstable)) < 274 '(())))) ;; a list with one null list is a test < 275 ;; (runconfigf (conc *toppath* "/runconfigs.config"))) < 276 (debug:print 1 "items: ") < 277 (if (>= *verbosity* 1)(pp allitems)) < 278 (if (>= *verbosity* 5) < 279 (begin < 280 (print "items: ")(pp (item-assoc->item-list items)) < 281 (print "itemstable: ")(pp (item-table->item-list itemstable)))) < 282 | 373 283 ;; Comments are loaded by the test run, not at launch time (in general < 284 ;;(if (args:get-arg "-m") < 285 ;; (db:set-comment-for-run db run-id (args:get-arg "-m"))) < 286 < 287 ;; Here is where the test_meta table is best updated | 374 ;; Here is where the test_meta table is best updated 288 (runs:update-test_meta db test-name test-conf) | 375 (runs:update-test_meta db test-name test-conf) 289 | 376 290 ;; braindead work-around for poorly specified allitems list BUG!!! FIX < 291 (if (null? allitems)(set! allitems '(()))) < 292 (let loop ((itemdat (car allitems)) < 293 (tal (cdr allitems))) < 294 ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") | 377 ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season 295 ;; Handle lists of items < 296 (let* ((item-path (item-list->path itemdat)) ;; (string-interspe < 297 (new-test-path (string-intersperse (cons test-path (map cadr | 378 (let* ((new-test-path (string-intersperse (cons test-path (map cadr itemdat) 298 (new-test-name (if (equal? item-path "") test-name (conc test | 379 (new-test-name (if (equal? item-path "") test-name (conc test-name "/ 299 (testdat #f) < 300 (num-running (db:get-count-tests-running db)) < 301 (max-concurrent-jobs (config-lookup *configdat* "setup" "max_ < 302 (parent-test (and (not (null? items))(equal? item-path ""))) < 303 (single-test (and (null? items) (equal? item-path ""))) < 304 (item-test (not (equal? item-path ""))) < 305 ;; look through all the item-patts if defined, format is patt < 306 (item-matches (if item-patts < 307 (let ((res #f)) < 308 (for-each < 309 (lambda (patt) < 310 (if (string-search (glob->regexp < 311 (string-translate < 312 item-path) < 313 (set! res #t))) < 314 (string-split item-patts ",")) < 315 res) < 316 #t))) < 317 (debug:print 3 "max-concurrent-jobs: " max-concurrent-jobs ", num- < 318 (if (and item-matches (runs:can-run-more-tests db)) < 319 (begin < 320 (let loop2 ((ts (db:get-test-info db run-id test-name item-p | 380 (testdat (db:get-test-info db run-id test-name item-path))) 321 (ct 0)) < 322 (if (and (not ts) | 381 (if (not testdat) 323 (< ct 10)) < 324 (begin | 382 (begin 325 (register-test db run-id test-name item-path) | 383 (register-test db run-id test-name item-path) 326 ;; Why did I set the comment here?!? POSSIBLE BUG BU < 327 ;; (db:test-set-comment db run-id test-name item-pat < 328 (loop2 (db:get-test-info db run-id test-name item-pa | 384 (set! testdat (db:get-test-info db run-id test-name item-path)))) 329 (+ ct 1))) < 330 (if ts < 331 (set! testdat ts) < 332 (begin < 333 (debug:print 0 "WARNING: Couldn't register test < 334 (if (not (null? tal)) < 335 (loop (car tal)(cdr tal))))))) < 336 (change-directory test-path) | 385 (change-directory test-path) 337 ;; this block is here only to inform the user early on < 338 < 339 ;; Moving this to the run calling block < 340 < 341 ;; (if (file-exists? runconfigf) < 342 ;; (setup-env-defaults db runconfigf run-id *already-see < 343 ;; (debug:print 0 "WARNING: You do not have a run config < 344 (debug:print 4 "run-id: " run-id " test-name: " test-name " < 345 (case (if force ;; (args:get-arg "-force") | 386 (case (if force ;; (args:get-arg "-force") 346 'NOT_STARTED | 387 'NOT_STARTED 347 (if testdat | 388 (if testdat 348 (string->symbol (test:get-state testdat)) | 389 (string->symbol (test:get-state testdat)) 349 'failed-to-insert)) | 390 'failed-to-insert)) 350 ((failed-to-insert) | 391 ((failed-to-insert) 351 (debug:print 0 "ERROR: Failed to insert the record into t | 392 (debug:print 0 "ERROR: Failed to insert the record into the db")) 352 ((NOT_STARTED COMPLETED) | 393 ((NOT_STARTED COMPLETED) 353 (debug:print 6 "Got here, " (test:get-state testdat)) | 394 (debug:print 6 "Got here, " (test:get-state testdat)) 354 (let ((runflag #f)) | 395 (let ((runflag #f)) 355 (cond | 396 (cond 356 ;; i.e. this is the parent test to a suite of items, n < 357 (parent-test < 358 (set! runflag #f)) < 359 ;; -force, run no matter what | 397 ;; -force, run no matter what 360 (force (set! runflag #t)) | 398 (force (set! runflag #t)) 361 ;; NOT_STARTED, run no matter what | 399 ;; NOT_STARTED, run no matter what 362 ((equal? (test:get-state testdat) "NOT_STARTED")(set! | 400 ((equal? (test:get-state testdat) "NOT_STARTED")(set! runflag #t)) 363 ;; not -rerun and PASS, WARN or CHECK, do no run | 401 ;; not -rerun and PASS, WARN or CHECK, do no run 364 ((and (or (not rerun) | 402 ((and (or (not rerun) 365 keepgoing) | 403 keepgoing) 366 (member (test:get-status testdat) '("PASS" "WARN | 404 (member (test:get-status testdat) '("PASS" "WARN" "CHECK"))) 367 (set! runflag #f)) | 405 (set! runflag #f)) 368 ;; -rerun and status is one of the specifed, run it | 406 ;; -rerun and status is one of the specifed, run it 369 ((and rerun | 407 ((and rerun 370 (let ((rerunlst (string-split rerun ","))) ;; FA | 408 (let ((rerunlst (string-split rerun ","))) ;; FAIL, 371 (member (test:get-status testdat) rerunlst))) | 409 (member (test:get-status testdat) rerunlst))) 372 (set! runflag #t)) | 410 (set! runflag #t)) 373 ;; -keepgoing, do not rerun FAIL | 411 ;; -keepgoing, do not rerun FAIL 374 ((and keepgoing | 412 ((and keepgoing 375 (member (test:get-status testdat) '("FAIL"))) | 413 (member (test:get-status testdat) '("FAIL"))) 376 (set! runflag #f)) | 414 (set! runflag #f)) 377 ((and (not rerun) | 415 ((and (not rerun) 378 (member (test:get-status testdat) '("FAIL" "n/a" | 416 (member (test:get-status testdat) '("FAIL" "n/a"))) 379 (set! runflag #t)) | 417 (set! runflag #t)) 380 (else (set! runflag #f))) | 418 (else (set! runflag #f))) 381 (debug:print 6 "RUNNING => runflag: " runflag " STATE: | 419 (debug:print 6 "RUNNING => runflag: " runflag " STATE: " (test:get-st 382 (if (not runflag) | 420 (if (not runflag) 383 (if (not parent-test) | 421 (if (not parent-test) 384 (debug:print 1 "NOTE: Not starting test " new-t | 422 (debug:print 1 "NOTE: Not starting test " new-test-name " as 385 (let* ((get-prereqs-cmd (lambda () < 386 (db-get-prereqs-not-met d < 387 (launch-cmd (lambda () < > 423 ;; NOTE: No longer be checking prerequisites here! Will never get > 424 ;; already met. 388 (launch-test db run-id ru | 425 (if (not (launch-test db run-id runname test-conf keyvallst test- 389 (testrundat (list get-prereqs-cmd launc < 390 (if (or force < 391 (let ((preqs-not-yet-met ((car testrundat < 392 (debug:print 2 "Preqrequesites for " te < 393 (null? preqs-not-yet-met))) ;; are ther < 394 (if (not ((cadr testrundat))) ;; this is the < 395 (begin | 426 (begin 396 (print "ERROR: Failed to launch the tes | 427 (print "ERROR: Failed to launch the test. Exiting as soon a 397 (set! *globalexitstatus* 1) ;; | 428 (set! *globalexitstatus* 1) ;; 398 (process-signal (current-process-id) si | 429 (process-signal (current-process-id) signal/kill)))))) 399 ;(exit 1) < 400 )) < 401 (if (not keepgoing) < 402 (hash-table-set! *waiting-queue* new-test < 403 ((KILLED) | 430 ((KILLED) 404 (debug:print 1 "NOTE: " new-test-name " is already runnin | 431 (debug:print 1 "NOTE: " new-test-name " is already running or was expli 405 ((LAUNCHED REMOTEHOSTSTART RUNNING) | 432 ((LAUNCHED REMOTEHOSTSTART RUNNING) 406 (if (> (- (current-seconds)(+ (db:test-get-event_time tes | 433 (if (> (- (current-seconds)(+ (db:test-get-event_time testdat) 407 (db:test-get-run_duration t | 434 (db:test-get-run_duration testdat))) 408 100) ;; i.e. no update for more than 100 seconds | 435 600) ;; i.e. no update for more than 600 seconds 409 (begin | 436 (begin 410 (debug:print 0 "WARNING: Test " test-name " appears | 437 (debug:print 0 "WARNING: Test " test-name " appears to be dead. F 411 (test-set-status! db run-id test-name "INCOMPLETE" | 438 (test-set-status! db run-id test-name "INCOMPLETE" "STUCK/DEAD" i 412 (debug:print 2 "NOTE: " test-name " is already runnin | 439 (debug:print 2 "NOTE: " test-name " is already running"))) 413 (else (debug:print 0 "ERROR: Failed to launch test " | 440 (else (debug:print 0 "ERROR: Failed to launch test " new-test-name 414 (if (not (null? tal)) < 415 (loop (car tal)(cdr tal))))))))) < 416 441 417 ;;====================================================================== 442 ;;====================================================================== 418 ;; END OF NEW STUFF 443 ;; END OF NEW STUFF 419 ;;====================================================================== 444 ;;====================================================================== 420 445 421 (define (get-dir-up-n dir . params) 446 (define (get-dir-up-n dir . params) 422 (let ((dparts (string-split dir "/")) 447 (let ((dparts (string-split dir "/")) ................................................................................................................................................................................ 509 ;;====================================================================== 534 ;;====================================================================== 510 ;; Routines for manipulating runs 535 ;; Routines for manipulating runs 511 ;;====================================================================== 536 ;;====================================================================== 512 537 513 ;; Since many calls to a run require pretty much the same setup 538 ;; Since many calls to a run require pretty much the same setup 514 ;; this wrapper is used to reduce the replication of code 539 ;; this wrapper is used to reduce the replication of code 515 (define (general-run-call switchname action-desc proc) 540 (define (general-run-call switchname action-desc proc) 516 (if (not (args:get-arg ":runname")) | 541 (let ((runname (args:get-arg ":runname")) 517 (begin | 542 (target (if (args:get-arg "-target") > 543 (args:get-arg "-target") > 544 (args:get-arg "-reqtarg")))) > 545 (cond > 546 ((not target) > 547 (debug:print 0 "ERROR: Missing required parameter for " switchname ", you > 548 (exit 3)) > 549 ((not runname) 518 (debug:print 0 "ERROR: Missing required parameter for " switchname ", yo | 550 (debug:print 0 "ERROR: Missing required parameter for " switchname ", you 519 (exit 2)) | 551 (exit 3)) > 552 (else 520 (let ((db #f) 553 (let ((db #f) 521 (keys #f)) 554 (keys #f)) 522 (if (not (setup-for-run)) 555 (if (not (setup-for-run)) 523 (begin 556 (begin 524 (debug:print 0 "Failed to setup, exiting") 557 (debug:print 0 "Failed to setup, exiting") 525 (exit 1))) 558 (exit 1))) 526 (set! db (open-db)) 559 (set! db (open-db)) ................................................................................................................................................................................ 541 (begin 574 (begin 542 (debug:print 0 "ERROR: Attempted to " action-desc " but run area c 575 (debug:print 0 "ERROR: Attempted to " action-desc " but run area c 543 (exit 1)) 576 (exit 1)) 544 ;; Extract out stuff needed in most or many calls 577 ;; Extract out stuff needed in most or many calls 545 ;; here then call proc 578 ;; here then call proc 546 (let* ((keynames (map key:get-fieldname keys)) 579 (let* ((keynames (map key:get-fieldname keys)) 547 (keyvallst (keys->vallist keys #t))) 580 (keyvallst (keys->vallist keys #t))) 548 (proc db keys keynames keyvallst))) | 581 (proc db target runname keys keynames keyvallst))) 549 (sqlite3:finalize! db) 582 (sqlite3:finalize! db) 550 (set! *didsomething* #t)))) | 583 (set! *didsomething* #t)))))) 551 584 552 ;;====================================================================== 585 ;;====================================================================== 553 ;; Rollup runs 586 ;; Rollup runs 554 ;;====================================================================== 587 ;;====================================================================== 555 588 556 ;; Update the test_meta table for this test 589 ;; Update the test_meta table for this test 557 (define (runs:update-test_meta db test-name test-conf) 590 (define (runs:update-test_meta db test-name test-conf) ................................................................................................................................................................................ 561 (set! currrecord (make-vector 10 #f)) 594 (set! currrecord (make-vector 10 #f)) 562 (db:testmeta-add-record db test-name))) 595 (db:testmeta-add-record db test-name))) 563 (for-each 596 (for-each 564 (lambda (key) 597 (lambda (key) 565 (let* ((idx (cadr key)) 598 (let* ((idx (cadr key)) 566 (fld (car key)) 599 (fld (car key)) 567 (val (config-lookup test-conf "test_meta" fld))) 600 (val (config-lookup test-conf "test_meta" fld))) > 601 ;; (debug:print 5 "idx: " idx " fld: " fld " val: " val) 568 (if (and val (not (equal? (vector-ref currrecord idx) val))) 602 (if (and val (not (equal? (vector-ref currrecord idx) val))) 569 (begin 603 (begin 570 (print "Updating " test-name " " fld " to " val) 604 (print "Updating " test-name " " fld " to " val) 571 (db:testmeta-update-field db test-name fld val))))) 605 (db:testmeta-update-field db test-name fld val))))) 572 '(("author" 2)("owner" 3)("description" 4)("reviewed" 5)("tags" 9))))) 606 '(("author" 2)("owner" 3)("description" 4)("reviewed" 5)("tags" 9))))) 573 607 574 ;; Update test_meta for all tests 608 ;; Update test_meta for all tests ................................................................................................................................................................................ 589 (debug:print 4 "runs:rollup-run, keys: " keys " keyvallst: " keyvallst " :runn 623 (debug:print 4 "runs:rollup-run, keys: " keys " keyvallst: " keyvallst " :runn 590 (let* (; (keyvalllst (keys:target->keyval keys target)) 624 (let* (; (keyvalllst (keys:target->keyval keys target)) 591 (new-run-id (runs:register-run db keys keyvallst runname "new" "n/ 625 (new-run-id (runs:register-run db keys keyvallst runname "new" "n/ 592 (prev-tests (test:get-matching-previous-test-run-records db new-ru 626 (prev-tests (test:get-matching-previous-test-run-records db new-ru 593 (curr-tests (db-get-tests-for-run db new-run-id "%" "%" '() '())) 627 (curr-tests (db-get-tests-for-run db new-run-id "%" "%" '() '())) 594 (curr-tests-hash (make-hash-table))) 628 (curr-tests-hash (make-hash-table))) 595 (db:update-run-event_time db new-run-id) 629 (db:update-run-event_time db new-run-id) 596 ;; index the already saved tests by testname and itempath in curr-tests-hash | 630 ;; index the already saved tests by testname and itemdat in curr-tests-hash 597 (for-each 631 (for-each 598 (lambda (testdat) 632 (lambda (testdat) 599 (let* ((testname (db:test-get-testname testdat)) 633 (let* ((testname (db:test-get-testname testdat)) 600 (item-path (db:test-get-item-path testdat)) 634 (item-path (db:test-get-item-path testdat)) 601 (full-name (conc testname "/" item-path))) 635 (full-name (conc testname "/" item-path))) 602 (hash-table-set! curr-tests-hash full-name testdat))) 636 (hash-table-set! curr-tests-hash full-name testdat))) 603 curr-tests) 637 curr-tests)

Added test_records.scm version [7236ce28391e9ea2]

> 1 ;; make-vector-record tests testqueue testname testconfig waitons priority items > 2 (define (make-tests:testqueue)(make-vector 6 #f)) > 3 (define-inline (tests:testqueue-get-testname vec) (vector-ref vec 0)) > 4 (define-inline (tests:testqueue-get-testconfig vec) (vector-ref vec 1)) > 5 (define-inline (tests:testqueue-get-waitons vec) (vector-ref vec 2)) > 6 (define-inline (tests:testqueue-get-priority vec) (vector-ref vec 3)) > 7 ;; items: #f=no items, list=list of items remaining, proc=need to call to get it > 8 (define-inline (tests:testqueue-get-items vec) (vector-ref vec 4)) > 9 (define-inline (tests:testqueue-get-itemdat vec) (vector-ref vec 5)) > 10 > 11 (define-inline (tests:testqueue-set-testname! vec val)(vector-set! vec 0 val) > 12 (define-inline (tests:testqueue-set-testconfig! vec val)(vector-set! vec 1 val) > 13 (define-inline (tests:testqueue-set-waitons! vec val)(vector-set! vec 2 val) > 14 (define-inline (tests:testqueue-set-priority! vec val)(vector-set! vec 3 val) > 15 (define-inline (tests:testqueue-set-items! vec val)(vector-set! vec 4 val) > 16 (define-inline (tests:testqueue-set-itemdat! vec val)(vector-set! vec 5 val)

Modified tests.scm from [f3725b9582a2fc23] to [42fb9b9880829006].

7 (declare (uses items)) 7 (declare (uses items)) 8 (declare (uses runconfig)) 8 (declare (uses runconfig)) 9 9 10 (include "common_records.scm") 10 (include "common_records.scm") 11 (include "key_records.scm") 11 (include "key_records.scm") 12 (include "db_records.scm") 12 (include "db_records.scm") 13 (include "run_records.scm") 13 (include "run_records.scm") > 14 (include "test_records.scm") 14 15 15 16 16 (define (register-test db run-id test-name item-path) 17 (define (register-test db run-id test-name item-path) 17 (let ((item-paths (if (equal? item-path "") 18 (let ((item-paths (if (equal? item-path "") 18 (list item-path) 19 (list item-path) 19 (list item-path "")))) 20 (list item-path "")))) 20 (for-each 21 (for-each ................................................................................................................................................................................ 319 (read-config test-configf #f system-allowed environ-patt: (if system-all 320 (read-config test-configf #f system-allowed environ-patt: (if system-all 320 "pre-launc 321 "pre-launc 321 #f)) 322 #f)) 322 #f))) 323 #f))) 323 324 324 ;; sort tests by priority and waiton 325 ;; sort tests by priority and waiton 325 ;; Move test specific stuff to a test unit FIXME one of these days 326 ;; Move test specific stuff to a test unit FIXME one of these days 326 (define (tests:sort-by-priority-and-waiton test-names) | 327 (define (tests:sort-by-priority-and-waiton test-records) 327 (let ((testdetails (make-hash-table)) < 328 (mungepriority (lambda (priority) | 328 (let ((mungepriority (lambda (priority) 329 (if priority 329 (if priority 330 (let ((tmp (any->number priority))) 330 (let ((tmp (any->number priority))) 331 (if tmp tmp (begin (debug:print 0 "ERROR: bad pri 331 (if tmp tmp (begin (debug:print 0 "ERROR: bad pri 332 0)))) 332 0)))) 333 (for-each (lambda (test-name) < 334 (let ((test-config (test:get-testconfig test-name #f))) < 335 (if test-config (hash-table-set! testdetails test-name test-co < 336 test-names) < 337 (sort 333 (sort 338 (hash-table-keys testdetails) ;; avoid dealing with deleted tests, look at | 334 (hash-table-keys test-records) ;; avoid dealing with deleted tests, look at 339 (lambda (a b) 335 (lambda (a b) 340 (let* ((tconf-a (hash-table-ref testdetails a)) | 336 (let* ((a-record (hash-table-ref test-records a)) 341 (tconf-b (hash-table-ref testdetails b)) | 337 (b-record (hash-table-ref test-records b)) 342 (a-waiton (config-lookup tconf-a "requirements" "waiton")) | 338 (a-waitons (tests:testqueue-get-waitons a-record)) 343 (b-waiton (config-lookup tconf-b "requirements" "waiton")) | 339 (b-waitons (tests:testqueue-get-waitons b-record)) > 340 (a-config (tests:testqueue-get-testconfig a-record)) > 341 (b-config (tests:testqueue-get-testconfig b-record)) > 342 (a-raw-pri (config-lookup a-config "requirements" "priority")) > 343 (b-raw-pri (config-lookup b-config "requirements" "priority")) 344 (a-priority (mungepriority (config-lookup tconf-a "requirements" " | 344 (a-priority (mungepriority a-raw-pri)) 345 (b-priority (mungepriority (config-lookup tconf-b "requirements" " | 345 (b-priority (mungepriority b-raw-pri))) 346 (if (and a-waiton (equal? a-waiton b)) < > 346 ;; (debug:print 5 "sort-by-priority-and-waiton, a: " a " b: " b > 347 ;; "\n a-record: " a-record > 348 ;; "\n b-record: " b-record > 349 ;; "\n a-waitons: " a-waitons > 350 ;; "\n b-waitons: " b-waitons > 351 ;; "\n a-config: " (hash-table->alist a-config) > 352 ;; "\n b-config: " (hash-table->alist b-config) > 353 ;; "\n a-raw-pri: " a-raw-pri > 354 ;; "\n b-raw-pri: " b-raw-pri > 355 ;; "\n a-priority: " a-priority > 356 ;; "\n b-priority: " b-priority) > 357 (tests:testqueue-set-priority! a-record a-priority) > 358 (tests:testqueue-set-priority! b-record b-priority) > 359 (if (and a-waitons (member (tests:testqueue-get-testname b-record) a-wa 347 #f ;; cannot have a which is waiting on b happening before b 360 #f ;; cannot have a which is waiting on b happening before b 348 (if (and b-waiton (equal? b-waiton a)) | 361 (if (and b-waitons (member (tests:testqueue-get-testname a-record) 349 #t ;; this is the correct order, b is waiting on a and b is bef 362 #t ;; this is the correct order, b is waiting on a and b is bef 350 (if (> a-priority b-priority) 363 (if (> a-priority b-priority) 351 #t ;; if a is a higher priority than b then we are good to 364 #t ;; if a is a higher priority than b then we are good to 352 #f)))))))) 365 #f)))))))) 353 366 354 367 355 ;;====================================================================== 368 ;;======================================================================