Check-in [d940f56993]
Not logged in
Overview
SHA1 Hash:d940f569936770e8c7223dad4f02c08f509f47c5
Date: 2011-08-23 12:53:11
User: mrwellan
Comment:Fixes to support full rollup of values
Timelines: family | ancestors | descendants | both | rollup-runs
Diffs: root of this branch
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified db.scm from [b0c8bb015d762ac9] to [1b862e72a2f08ed0].

60 final_logf TEXT DEFAULT 'logs/final.log', 60 final_logf TEXT DEFAULT 'logs/final.log', 61 logdat BLOB, 61 logdat BLOB, 62 run_duration INTEGER DEFAULT 0, 62 run_duration INTEGER DEFAULT 0, 63 comment TEXT DEFAULT '', 63 comment TEXT DEFAULT '', 64 event_time TIMESTAMP, 64 event_time TIMESTAMP, 65 fail_count INTEGER DEFAULT 0, 65 fail_count INTEGER DEFAULT 0, 66 pass_count INTEGER DEFAULT 0, 66 pass_count INTEGER DEFAULT 0, 67 tags TEXT DEFAULT '', < 68 CONSTRAINT testsconstraint UNIQUE (run_id, testname, item_p 67 CONSTRAINT testsconstraint UNIQUE (run_id, testname, item_p 69 );") 68 );") 70 (sqlite3:execute db "CREATE INDEX tests_index ON tests (run_id, testna 69 (sqlite3:execute db "CREATE INDEX tests_index ON tests (run_id, testna 71 (sqlite3:execute db "CREATE VIEW runs_tests AS SELECT * FROM runs INNE 70 (sqlite3:execute db "CREATE VIEW runs_tests AS SELECT * FROM runs INNE 72 (sqlite3:execute db "CREATE TABLE test_steps 71 (sqlite3:execute db "CREATE TABLE test_steps 73 (id INTEGER PRIMARY KEY, 72 (id INTEGER PRIMARY KEY, 74 test_id INTEGER, 73 test_id INTEGER, ................................................................................................................................................................................ 342 ;; done with run when: 341 ;; done with run when: 343 ;; 0 tests in LAUNCHED, NOT_STARTED, REMOTEHOSTSTART, RUNNING 342 ;; 0 tests in LAUNCHED, NOT_STARTED, REMOTEHOSTSTART, RUNNING 344 (define (db:estimated-tests-remaining db run-id) 343 (define (db:estimated-tests-remaining db run-id) 345 (let ((res 0)) 344 (let ((res 0)) 346 (sqlite3:for-each-row 345 (sqlite3:for-each-row 347 (lambda (count) 346 (lambda (count) 348 (set! res count)) 347 (set! res count)) 349 db | 348 db ;; NB// KILLREQ means the jobs is still probably running 350 "SELECT count(id) FROM tests WHERE state in ('LAUNCHED','NOT_STARTED','REMO | 349 "SELECT count(id) FROM tests WHERE state in ('LAUNCHED','NOT_STARTED','REMO 351 res)) 350 res)) 352 351 353 ;; NB// Sync this with runs:get-test-info 352 ;; NB// Sync this with runs:get-test-info 354 (define (db:get-test-info db run-id testname item-path) 353 (define (db:get-test-info db run-id testname item-path) 355 (let ((res #f)) 354 (let ((res #f)) 356 (sqlite3:for-each-row 355 (sqlite3:for-each-row 357 (lambda (id run-id testname state status event-time host cpuload diskfree u 356 (lambda (id run-id testname state status event-time host cpuload diskfree u ................................................................................................................................................................................ 456 (lambda (id test-id stepname state status event-time) 455 (lambda (id test-id stepname state status event-time) 457 (set! res (cons (vector id test-id stepname state status event-time) res) 456 (set! res (cons (vector id test-id stepname state status event-time) res) 458 db 457 db 459 "SELECT id,test_id,stepname,state,status,event_time FROM test_steps WHERE t 458 "SELECT id,test_id,stepname,state,status,event_time FROM test_steps WHERE t 460 test-id) 459 test-id) 461 (reverse res))) 460 (reverse res))) 462 461 463 ;; check that *all* the prereqs are "COMPLETED" | 462 ;; ;; check that *all* the prereqs are "COMPLETED" 464 (define (db-get-prereqs-met db run-id waiton) | 463 ;; (define (db-get-prereqs-met db run-id waiton) 465 (let ((res #f) | 464 ;; (let ((res #f) 466 (not-complete 0) | 465 ;; (not-complete 0) 467 (tests (db-get-tests-for-run db run-id))) | 466 ;; (tests (db-get-tests-for-run db run-id))) 468 (for-each | 467 ;; (for-each 469 (lambda (test-name) | 468 ;; (lambda (test-name) 470 (for-each | 469 ;; (for-each 471 (lambda (test) | 470 ;; (lambda (test) 472 (if (equal? (db:test-get-testname test) test-name) | 471 ;; (if (equal? (db:test-get-testname test) test-name) 473 (begin | 472 ;; (begin 474 (set! res #t) | 473 ;; (set! res #t) 475 (if (not (equal? (db:test-get-state test) "COMPLETED")) | 474 ;; (if (not (equal? (db:test-get-state test) "COMPLETED")) 476 (set! not-complete (+ 1 not-complete)))))) | 475 ;; (set! not-complete (+ 1 not-complete)))))) 477 tests)) | 476 ;; tests)) 478 waiton) | 477 ;; waiton) 479 (and (or (null? waiton) res) | 478 ;; (and (or (null? waiton) res) 480 (eq? not-complete 0)))) | 479 ;; (eq? not-complete 0)))) 481 480 482 ;; USE: (lset-difference string=? '("a" "b" "c") '("d" "c" "e" "a")) 481 ;; USE: (lset-difference string=? '("a" "b" "c") '("d" "c" "e" "a")) 483 ;; 482 ;; 484 ;; Return a list of prereqs that were NOT met 483 ;; Return a list of prereqs that were NOT met 485 ;; Tests (and all items) in waiton list must be "COMPLETED" and "PASS" 484 ;; Tests (and all items) in waiton list must be "COMPLETED" and "PASS" 486 (define (db-get-prereqs-not-met db run-id waiton) 485 (define (db-get-prereqs-not-met db run-id waiton) 487 (if (null? waiton) 486 (if (null? waiton)

Modified launch.scm from [aadffc4da1b2c47b] to [f0e35ea73cd485b5].

143 (set! fullcmd (append launcher (car hosts)(list remote-megatest "-execute" 143 (set! fullcmd (append launcher (car hosts)(list remote-megatest "-execute" 144 (launcher 144 (launcher 145 (set! fullcmd (append launcher (list remote-megatest "-execute" cmdparms)) 145 (set! fullcmd (append launcher (list remote-megatest "-execute" cmdparms)) 146 (else 146 (else 147 (set! fullcmd (list remote-megatest "-execute" cmdparms)))) 147 (set! fullcmd (list remote-megatest "-execute" cmdparms)))) 148 (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) 148 (if (args:get-arg "-xterm")(set! fullcmd (append fullcmd (list "-xterm")))) 149 (debug:print 1 "Launching megatest for test " test-name " in " work-area" .. 149 (debug:print 1 "Launching megatest for test " test-name " in " work-area" .. 150 (test-set-status! db run-id test-name "LAUNCHED" "n/a" itemdat) ;; (if launc | 150 (test-set-status! db run-id test-name "LAUNCHED" "n/a" itemdat #f #f) ;; (if 151 ;; set 151 ;; set 152 ;; set pre-launch-env-vars before launching, keep the vars in prevvals and p 152 ;; set pre-launch-env-vars before launching, keep the vars in prevvals and p 153 (let* ((commonprevvals (alist->env-vars 153 (let* ((commonprevvals (alist->env-vars 154 (hash-table-ref/default *configdat* "env-override" ' 154 (hash-table-ref/default *configdat* "env-override" ' 155 (testprevvals (alist->env-vars 155 (testprevvals (alist->env-vars 156 (hash-table-ref/default test-conf "pre-launch-env-ov 156 (hash-table-ref/default test-conf "pre-launch-env-ov 157 (miscprevvals (alist->env-vars ;; consolidate this code with the co 157 (miscprevvals (alist->env-vars ;; consolidate this code with the co

Modified megatest-version.scm from [ebeb01abfb9afbb7] to [9a855b99f9cbc339].

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 (define megatest-version 1.20) | 3 (define megatest-version 1.21)

Modified megatest.scm from [3957f2b34f53c06d] to [3218809c9e0ffd4b].

35 -m comment : insert a comment for this test 35 -m comment : insert a comment for this test 36 36 37 Run data 37 Run data 38 :runname : required, name for this particular test run 38 :runname : required, name for this particular test run 39 :state : required if updating step state; e.g. start, end, co 39 :state : required if updating step state; e.g. start, end, co 40 :status : required if updating step status; e.g. pass, fail, n 40 :status : required if updating step status; e.g. pass, fail, n 41 41 > 42 Values and record errors and warnings > 43 -set-values : update or set values in the megatest db > 44 :value : value measured > 45 :expected_value : value expected > 46 :tol : tolerance |value-expect| <= tol > 47 :first_err : record an error message > 48 :first_warn : record a warning message > 49 42 Queries 50 Queries 43 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 51 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 44 -testpatt patt : in list-runs show only these tests, % is the wildcar 52 -testpatt patt : in list-runs show only these tests, % is the wildcar 45 -itempatt patt : in list-runs show only tests with items that match p 53 -itempatt patt : in list-runs show only tests with items that match p 46 -showkeys : show the keys used in this megatest setup 54 -showkeys : show the keys used in this megatest setup 47 55 48 Misc 56 Misc ................................................................................................................................................................................ 93 "-runstep" 101 "-runstep" 94 "-logpro" 102 "-logpro" 95 "-m" 103 "-m" 96 "-rerun" 104 "-rerun" 97 "-days" 105 "-days" 98 "-rename-run" 106 "-rename-run" 99 "-to" 107 "-to" > 108 ;; values and messages > 109 ":first_err" > 110 ":first_warn" > 111 ":value" > 112 ":expected_value" > 113 ":tol" > 114 ;; misc 100 "-debug" ;; for *verbosity* > 2 115 "-debug" ;; for *verbosity* > 2 101 ) 116 ) 102 (list "-h" 117 (list "-h" 103 "-force" 118 "-force" 104 "-xterm" 119 "-xterm" 105 "-showkeys" 120 "-showkeys" 106 "-test-status" 121 "-test-status" > 122 "-set-values" 107 "-summarize-items" 123 "-summarize-items" 108 "-gui" 124 "-gui" 109 "-runall" ;; run all tests 125 "-runall" ;; run all tests 110 "-remove-runs" 126 "-remove-runs" 111 "-keepgoing" 127 "-keepgoing" 112 "-usequeue" 128 "-usequeue" 113 "-rebuild-db" 129 "-rebuild-db" ................................................................................................................................................................................ 358 (set-run-config-vars db run-id) 374 (set-run-config-vars db run-id) 359 ;; environment overrides are done *before* the remaining critical en 375 ;; environment overrides are done *before* the remaining critical en 360 (alist->env-vars env-ovrd) 376 (alist->env-vars env-ovrd) 361 (set-megatest-env-vars db run-id) 377 (set-megatest-env-vars db run-id) 362 (set-item-env-vars itemdat) 378 (set-item-env-vars itemdat) 363 (save-environment-as-files "megatest") 379 (save-environment-as-files "megatest") 364 (test-set-meta-info db run-id test-name itemdat) 380 (test-set-meta-info db run-id test-name itemdat) 365 (test-set-status! db run-id test-name "REMOTEHOSTSTART" "n/a" itemda | 381 (test-set-status! db run-id test-name "REMOTEHOSTSTART" "n/a" itemda 366 (if (args:get-arg "-xterm") 382 (if (args:get-arg "-xterm") 367 (set! fullrunscript "xterm") 383 (set! fullrunscript "xterm") 368 (if (not (file-execute-access? fullrunscript)) 384 (if (not (file-execute-access? fullrunscript)) 369 (system (conc "chmod ug+x " fullrunscript)))) 385 (system (conc "chmod ug+x " fullrunscript)))) 370 ;; We are about to actually kick off the test 386 ;; We are about to actually kick off the test 371 ;; so this is a good place to remove the records for 387 ;; so this is a good place to remove the records for 372 ;; any previous runs 388 ;; any previous runs ................................................................................................................................................................................ 446 ;; (test-set-status! db ru 462 ;; (test-set-status! db ru 447 ;; itemdat (ar 463 ;; itemdat (ar 448 ;; (sqlite3:finalize! db) 464 ;; (sqlite3:finalize! db) 449 ;; (exit 1))))) 465 ;; (exit 1))))) 450 (begin 466 (begin 451 (debug:print 0 "WARNING: 467 (debug:print 0 "WARNING: 452 (test-set-status! db run- 468 (test-set-status! db run- 453 itemdat | 469 itemdat 454 (sqlite3:finalize! db) 470 (sqlite3:finalize! db) 455 (exit 1)))) 471 (exit 1)))) 456 ;; (thread-terminate! job-thr 472 ;; (thread-terminate! job-thr 457 (set! kill-tries (+ 1 kill-tries) 473 (set! kill-tries (+ 1 kill-tries) 458 (mutex-unlock! m))) 474 (mutex-unlock! m))) 459 ;; (handle-exceptions 475 ;; (handle-exceptions 460 ;; exn 476 ;; exn ................................................................................................................................................................................ 490 (test-set-status! db run-id test-name 506 (test-set-status! db run-id test-name 491 (if kill-job? "KILLED" "COMPLETED") 507 (if kill-job? "KILLED" "COMPLETED") 492 (if (vector-ref exit-info 1) ;; look at 508 (if (vector-ref exit-info 1) ;; look at 493 (if (and (not kill-job?) 509 (if (and (not kill-job?) 494 (eq? (vector-ref exit-info 510 (eq? (vector-ref exit-info 495 "PASS" 511 "PASS" 496 "FAIL") 512 "FAIL") 497 "FAIL") itemdat (args:get-arg "-m")) | 513 "FAIL") itemdat (args:get-arg "-m") 498 ;; for automated creation of the rollup html file this is a good 514 ;; for automated creation of the rollup html file this is a good 499 (if (not (equal? item-path "")) 515 (if (not (equal? item-path "")) 500 (tests:summarize-items db run-id test-name #f)) ;; don't forc 516 (tests:summarize-items db run-id test-name #f)) ;; don't forc 501 ) 517 ) 502 (mutex-unlock! m) 518 (mutex-unlock! m) 503 ;; (exec-results (cmd-run->list fullrunscript)) ;; (list ">" (con 519 ;; (exec-results (cmd-run->list fullrunscript)) ;; (list ">" (con 504 ;; (success exec-results)) ;; (eq? (cadr exec-results) 0))) 520 ;; (success exec-results)) ;; (eq? (cadr exec-results) 0))) ................................................................................................................................................................................ 538 (exit 6))) 554 (exit 6))) 539 (sqlite3:finalize! db) 555 (sqlite3:finalize! db) 540 (set! *didsomething* #t)))) 556 (set! *didsomething* #t)))) 541 557 542 (if (or (args:get-arg "-setlog") ;; since setting up is so costly lets pig 558 (if (or (args:get-arg "-setlog") ;; since setting up is so costly lets pig 543 (args:get-arg "-set-toplog") 559 (args:get-arg "-set-toplog") 544 (args:get-arg "-test-status") 560 (args:get-arg "-test-status") > 561 (args:get-arg "-set-values") 545 (args:get-arg "-runstep") 562 (args:get-arg "-runstep") 546 (args:get-arg "-summarize-items")) 563 (args:get-arg "-summarize-items")) 547 (if (not (getenv "MT_CMDINFO")) 564 (if (not (getenv "MT_CMDINFO")) 548 (begin 565 (begin 549 (debug:print 0 "ERROR: MT_CMDINFO env var not set, commands -test-stat 566 (debug:print 0 "ERROR: MT_CMDINFO env var not set, commands -test-stat 550 (exit 5)) 567 (exit 5)) 551 (let* ((startingdir (current-directory)) 568 (let* ((startingdir (current-directory)) ................................................................................................................................................................................ 616 (teststep-set-status! db run-id test-name stepname "end" exi 633 (teststep-set-status! db run-id test-name stepname "end" exi 617 (sqlite3:finalize! db) 634 (sqlite3:finalize! db) 618 (if (not (eq? exitstat 0)) 635 (if (not (eq? exitstat 0)) 619 (exit 254)) ;; (exit exitstat) doesn't work?!? 636 (exit 254)) ;; (exit exitstat) doesn't work?!? 620 ;; open the db 637 ;; open the db 621 ;; mark the end of the test 638 ;; mark the end of the test 622 ))) 639 ))) 623 (if (args:get-arg "-test-status") | 640 (if (or (args:get-arg "-test-status") > 641 (args:get-arg "-set-values")) 624 (let ((newstatus (cond 642 (let ((newstatus (cond 625 ((number? status) (if (equal? status 0) "P 643 ((number? status) (if (equal? status 0) "P > 644 ((and (string? status) 626 ((string->number status)(if (equal? (string->num | 645 (string->number status))(if (equal? (strin 627 (else status)))) | 646 (else status))) 628 (test-set-status! db run-id test-name state newstatus itemdat (a < 629 (if (and state status) | 647 ;; transfer relevant keys into a hash to be passed to test-s > 648 ;; could use an assoc list I guess. > 649 (otherdata (let ((res (make-hash-table))) > 650 (for-each (lambda (key) 630 (if (not (args:get-arg "-setlog")) | 651 (if (args:get-arg key) > 652 (hash-table-set! res key (args: > 653 (list ":value" ":tol" ":expected_valu > 654 res))) > 655 (if (and (args:get-arg "-test-status") > 656 (or (not state) > 657 (not status))) 631 (begin | 658 (begin 632 (debug:print 0 "ERROR: You must specify :state and :stat | 659 (debug:print 0 "ERROR: You must specify :state and :status 633 (sqlite3:finalize! db) | 660 (sqlite3:finalize! db) 634 (exit 6))))) | 661 (exit 6))) > 662 (test-set-status! db run-id test-name state newstatus itemdat (a 635 (sqlite3:finalize! db) 663 (sqlite3:finalize! db) 636 (set! *didsomething* #t)))) 664 (set! *didsomething* #t)))) 637 665 638 (if (args:get-arg "-showkeys") 666 (if (args:get-arg "-showkeys") 639 (let ((db #f) 667 (let ((db #f) 640 (keys #f)) 668 (keys #f)) 641 (if (not (setup-for-run)) 669 (if (not (setup-for-run))

Modified runs.scm from [3ae6b820e1c33c2c] to [0a86a73c3e24ba49].

71 (lambda (a . r) 71 (lambda (a . r) 72 (set! res (cons (list->vector (cons a r)) res))) 72 (set! res (cons (list->vector (cons a r)) res))) 73 db 73 db 74 (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") 74 (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") 75 runnamepatt) 75 runnamepatt) 76 (vector header res))) 76 (vector header res))) 77 77 78 (define (register-test db run-id test-name item-path tags) | 78 (define (register-test db run-id test-name item-path) 79 (let ((item-paths (if (equal? item-path "") 79 (let ((item-paths (if (equal? item-path "") 80 (list item-path) 80 (list item-path) 81 (list item-path "")))) 81 (list item-path "")))) 82 (for-each 82 (for-each 83 (lambda (pth) 83 (lambda (pth) 84 (sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_t | 84 (sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_t 85 run-id 85 run-id 86 test-name 86 test-name 87 pth 87 pth 88 (conc "," (string-intersperse tags ",") ","))) | 88 ;; (conc "," (string-intersperse tags ",") ",") > 89 )) 89 item-paths ))) 90 item-paths ))) 90 91 91 ;; (define db (open-db)) 92 ;; (define db (open-db)) 92 ;; (test-set-status! db 2 "runfirst" "COMPLETED" "PASS" "summer") 93 ;; (test-set-status! db 2 "runfirst" "COMPLETED" "PASS" "summer") 93 94 94 (define (test-set-status! db run-id test-name state status itemdat-or-path . com | 95 (define (test-set-status! db run-id test-name state status itemdat-or-path comme 95 (let ((item-path (if (string? itemdat-or-path) itemdat-or-path (item-list->pat | 96 (let ((item-path (if (string? itemdat-or-path) itemdat-or-path (item-list->pat > 97 (otherdat (if dat dat (make-hash-table)))) > 98 ;; update the primary record IF state AND status are defined > 99 (if (and state status) 96 (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strftime(' | 100 (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strfti 97 state status run-id test-name item-path) | 101 state status run-id test-name item-path)) > 102 ;; add metadata (need to do this way to avoid SQL injection issues) > 103 ;; :value > 104 (let ((val (hash-table-ref/default otherdat ":value" #f))) > 105 (if val > 106 (sqlite3:execute db "UPDATE tests SET value=? WHERE run_id=? AND testn > 107 ;; :expected_value > 108 (let ((val (hash-table-ref/default otherdat ":expected_value" #f))) > 109 (if val > 110 (sqlite3:execute db "UPDATE tests SET expected_value=? WHERE run_id=? > 111 ;; :tol > 112 (let ((val (hash-table-ref/default otherdat ":tol" #f))) > 113 (if val > 114 (sqlite3:execute db "UPDATE tests SET tol=? WHERE run_id=? AND testnam > 115 ;; :first_err > 116 (let ((val (hash-table-ref/default otherdat ":first_err" #f))) > 117 (if val > 118 (sqlite3:execute db "UPDATE tests SET first_err=? WHERE run_id=? AND t > 119 ;; :first_warn > 120 (let ((val (hash-table-ref/default otherdat ":first_warn" #f))) > 121 (if val > 122 (sqlite3:execute db "UPDATE tests SET first_warn=? WHERE run_id=? AND > 123 ;; :tol_perc > 124 (let ((val (hash-table-ref/default otherdat ":tol_perc" #f))) > 125 (if val > 126 (sqlite3:execute db "UPDATE tests SET tol_perc=? WHERE run_id=? AND te > 127 98 (if (and (not (equal? item-path "")) ;; need to update the top test record i | 128 ;; need to update the top test record if PASS or FAIL and this is a subtest > 129 (if (and (not (equal? item-path "")) 99 (or (equal? status "PASS") 130 (or (equal? status "PASS") 100 (equal? status "WARN") 131 (equal? status "WARN") 101 (equal? status "FAIL"))) 132 (equal? status "FAIL"))) 102 (begin 133 (begin 103 (sqlite3:execute 134 (sqlite3:execute 104 db 135 db 105 "UPDATE tests 136 "UPDATE tests ................................................................................................................................................................................ 112 "UPDATE tests 143 "UPDATE tests 113 SET state=CASE WHEN (SELECT count(id) FROM tests WHERE run_id=? AND 144 SET state=CASE WHEN (SELECT count(id) FROM tests WHERE run_id=? AND 114 'RUNNING' 145 'RUNNING' 115 ELSE 'COMPLETED' END, 146 ELSE 'COMPLETED' END, 116 status=CASE WHEN fail_count > 0 THEN 'FAIL' WHEN pass_count > 0 147 status=CASE WHEN fail_count > 0 THEN 'FAIL' WHEN pass_count > 0 117 WHERE run_id=? AND testname=? AND item_path='';" 148 WHERE run_id=? AND testname=? AND item_path='';" 118 run-id test-name run-id test-name))) 149 run-id test-name run-id test-name))) 119 (if (and (not (null? comment)) | 150 (if (and (string? comment) 120 (car comment)) | 151 (string-match (regexp "\\S+") comment)) 121 (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testn 152 (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testn 122 (car comment) run-id test-name item-path)))) | 153 (car comment) run-id test-name item-path)) > 154 )) 123 155 124 (define (test-set-log! db run-id test-name itemdat logf) 156 (define (test-set-log! db run-id test-name itemdat logf) 125 (let ((item-path (item-list->path itemdat))) 157 (let ((item-path (item-list->path itemdat))) 126 (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testna 158 (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testna 127 logf run-id test-name item-path))) 159 logf run-id test-name item-path))) 128 160 129 (define (test-set-toplog! db run-id test-name logf) 161 (define (test-set-toplog! db run-id test-name logf) ................................................................................................................................................................................ 402 (let* ((test-path (conc *toppath* "/tests/" test-name)) 434 (let* ((test-path (conc *toppath* "/tests/" test-name)) 403 (test-configf (conc test-path "/testconfig")) 435 (test-configf (conc test-path "/testconfig")) 404 (testexists (and (file-exists? test-configf)(file-read-access? test-c 436 (testexists (and (file-exists? test-configf)(file-read-access? test-c 405 (test-conf (if testexists (read-config test-configf #f #t) (make-has 437 (test-conf (if testexists (read-config test-configf #f #t) (make-has 406 (waiton (let ((w (config-lookup test-conf "requirements" "waiton" 438 (waiton (let ((w (config-lookup test-conf "requirements" "waiton" 407 (if (string? w)(string-split w)'()))) 439 (if (string? w)(string-split w)'()))) 408 (tags (let ((t (config-lookup test-conf "setup" "tags"))) 440 (tags (let ((t (config-lookup test-conf "setup" "tags"))) > 441 ;; we want our tags to be separated by commas and fully > 442 ;; so that queries with "like" can tie to the commas at > 443 ;; while also allowing the end user to freely use space 409 (if (string? t)(string-split t ",") '())))) | 444 (if (string? t)(string-substitute (regexp "[,\\s]+") ", > 445 '())))) 410 (if (not testexists) 446 (if (not testexists) 411 (begin 447 (begin 412 (debug:print 0 "ERROR: Can't find config file " test-configf) 448 (debug:print 0 "ERROR: Can't find config file " test-configf) 413 (exit 2)) 449 (exit 2)) 414 ;; put top vars into convenient variables and open the db 450 ;; put top vars into convenient variables and open the db 415 (let* (;; db is always at *toppath*/db/megatest.db 451 (let* (;; db is always at *toppath*/db/megatest.db 416 (items (hash-table-ref/default test-conf "items" '())) 452 (items (hash-table-ref/default test-conf "items" '())) ................................................................................................................................................................................ 451 (if (runs:can-run-more-tests db) 487 (if (runs:can-run-more-tests db) 452 (begin 488 (begin 453 (let loop2 ((ts (db:get-test-info db run-id test-name item-p 489 (let loop2 ((ts (db:get-test-info db run-id test-name item-p 454 (ct 0)) 490 (ct 0)) 455 (if (and (not ts) 491 (if (and (not ts) 456 (< ct 10)) 492 (< ct 10)) 457 (begin 493 (begin 458 (register-test db run-id test-name item-path tags) | 494 (register-test db run-id test-name item-path) 459 (db:test-set-comment db run-id test-name item-path " 495 (db:test-set-comment db run-id test-name item-path " 460 (loop2 (db:get-test-info db run-id test-name item-pa 496 (loop2 (db:get-test-info db run-id test-name item-pa 461 (+ ct 1))) 497 (+ ct 1))) 462 (if ts 498 (if ts 463 (set! testdat ts) 499 (set! testdat ts) 464 (begin 500 (begin 465 (debug:print 0 "WARNING: Couldn't register test 501 (debug:print 0 "WARNING: Couldn't register test

Modified tests/tests/runfirst/main.sh from [f575e06d2a25eb06] to [b033ad6b4d30ad16].

4 # sleep 20 4 # sleep 20 5 # megatest -step wasting_time :state end :status $? 5 # megatest -step wasting_time :state end :status $? 6 6 7 touch ../I_was_here 7 touch ../I_was_here 8 8 9 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all 9 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all 10 10 11 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c | 11 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c

Modified tests/tests/singletest/main.sh from [c23e537bd9ea1937] to [e63ffb76fadbc087].

2 2 3 # megatest -step wasting_time :state start :status n/a -m "This is a test step c 3 # megatest -step wasting_time :state start :status n/a -m "This is a test step c 4 # sleep 20 4 # sleep 20 5 # megatest -step wasting_time :state end :status $? 5 # megatest -step wasting_time :state end :status $? 6 6 7 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo all 7 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo all 8 8 9 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c | 9 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c

Modified tests/tests/singletest2/main.sh from [c23e537bd9ea1937] to [54d3e4ef494bd371].

2 2 3 # megatest -step wasting_time :state start :status n/a -m "This is a test step c 3 # megatest -step wasting_time :state start :status n/a -m "This is a test step c 4 # sleep 20 4 # sleep 20 5 # megatest -step wasting_time :state end :status $? 5 # megatest -step wasting_time :state end :status $? 6 6 7 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo all 7 $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 5;echo all 8 8 9 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c | 9 $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level c