Changes In Branch reorg-runs-code Through [ddc42ef201] Excluding Merge-Ins
This is equivalent to a diff from d1ee9f149a to ddc42ef201
2011-11-20
| ||
23:13 | Incrementally putting stuff back in place for re-written runs. check-in: a1e072dbd2 user: matt tags: reorg-runs-code | |
22:39 | Fixed compilation check-in: ddc42ef201 user: matt tags: reorg-runs-code | |
22:36 | commit of re-hacked run code. completely torn to shreds and rewritten check-in: 3aeabde95d user: matt tags: reorg-runs-code | |
2011-11-16
| ||
21:31 | Reorg'd code worked fine. Pulling the basic reorg back to trunk. Next batch of changes won't be so kind :) check-in: 47e2caaf9c user: matt tags: trunk | |
20:51 | Reorg runs code start check-in: aaf143afd7 user: matt tags: reorg-runs-code | |
10:49 | Fixed dashboard failing to update sometimes, minor tweak to Makefile check-in: d1ee9f149a user: mrwellan tags: trunk | |
2011-11-15
| ||
21:48 | Improved ez test tests and mt_ezstep script check-in: 1bb1c0782c user: matt tags: trunk | |
Modified Makefile from [ecff33bacb] to [b20ff2bde7].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | PREFIX=. SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ |
︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | + | csc $(OFILES) $(GOFILES) -o dboard # Special dependencies for the includes db.o launch.o runs.o dashboard-tests.o dashboard-guimonitor.o monitor.o dashboard.o megatest.o : db_records.scm runs.o dashboard.o dashboard-tests.o : run_records.scm keys.o db.o runs.o launch.o megatest.o : key_records.scm tasks.o dashboard-tasks.o : task_records.scm runs.o : old-runs.scm test_records.scm $(OFILES) $(GOFILES) : common_records.scm %.o : %.scm csc -c $< $(PREFIX)/bin/megatest : megatest |
︙ |
Modified configf.scm from [ef264b880e] to [e31d2a9565].
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + - - - - - - - - - - + + + + + + + + + + - + + + + + | (blank-l-rx _ (loop (read-line inp) curr-section-name #f #f)) (include-rx ( x include-file ) (begin (read-config include-file res allow-system environ-patt: environ-patt) (loop (read-line inp) curr-section-name #f #f))) (section-rx ( x section-name ) (loop (read-line inp) section-name #f #f)) (key-sys-pr ( x key cmd ) (if allow-system (let ((alist (hash-table-ref/default res curr-section-name '())) (val-proc (lambda () |
︙ |
Modified dashboard.scm from [55452f0f20] to [16c17747cc].
︙ | |||
451 452 453 454 455 456 457 | 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - + + | (define (update-search x val) ;; (print "Setting search for " x " to " val) (hash-table-set! *searchpatts* x val)) (define (mark-for-update) (set! *last-db-update-time* 0) |
︙ |
Modified db.scm from [65214cf6f3] to [97aae994b9].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - - + + - - - - - - - - - - - + + + + + + + + + + + - + | (let* ((keys (config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys))) (for-each (lambda (key) (let ((keyn (vector-ref key 0))) (if (member (string-downcase keyn) |
︙ | |||
111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | + | owner TEXT DEFAULT '', description TEXT DEFAULT '', reviewed TIMESTAMP, iterated TEXT DEFAULT '', avg_runtime REAL, avg_disk REAL, tags TEXT DEFAULT '', jobgroup TEXT DEFAULT 'default', CONSTRAINT test_meta_constraint UNIQUE (testname));") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRIMARY KEY, test_id INTEGER, category TEXT DEFAULT '', variable TEXT, value REAL, expected REAL, |
︙ | |||
171 172 173 174 175 176 177 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - - - - - - - + + + + + + + | (patch-db)) ((< mver 1.21) (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var TEXT, val TEXT, CONSTRAINT metadat_constraint UNIQUE (var));") (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the changes are already applied (sqlite3:execute db test-meta-def) |
︙ | |||
205 206 207 208 209 210 211 212 213 214 215 216 217 218 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | + + + | (db:set-var db "MEGATEST_VERSION" 1.27) (sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT '';") (patch-db)) ((< mver 1.29) (db:set-var db "MEGATEST_VERSION" 1.29) (sqlite3:execute db "ALTER TABLE test_steps ADD COLUMN logfile TEXT DEFAULT '';") (sqlite3:execute db "ALTER TABLE tests ADD COLUMN shortdir TEXT DEFAULT '';")) ((< mver 1.36) (db:set-var db "MEGATEST_VERSION" 1.36) (sqlite3:execute db "ALTER TABLER test_meta ADD COLUMN jobgroup TEXT DEFAULT 'default';")) ((< mver megatest-version) (db:set-var db "MEGATEST_VERSION" megatest-version)))))) ;;====================================================================== ;; meta get and set vars ;;====================================================================== |
︙ | |||
254 255 256 257 258 259 260 | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | - + | (if (null? header) #f (let loop ((hed (car header)) (tal (cdr header)) (n 0)) (if (equal? hed field) (vector-ref row n) (if (null? tal) #f (loop (car tal)(cdr tal)(+ n 1))))))) |
︙ | |||
361 362 363 364 365 366 367 | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | - - + + | ;; states and statuses are required to be lists, empty is ok (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) (let ((res '()) (states-str (conc "('" (string-intersperse states "','") "')")) (statuses-str (conc "('" (string-intersperse statuses "','") "')")) ) (sqlite3:for-each-row |
︙ | |||
391 392 393 394 395 396 397 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | - - - + + + + + + + + + + + + + + + + | ;; set tests with state currstate and status currstatus to newstate and newstatus ;; use currstate = #f and or currstatus = #f to apply to any state or status respectively ;; WARNING: SQL injection risk (define (db:set-tests-state-status db run-id testnames currstate currstatus newstate newstatus) (for-each (lambda (testname) (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " |
︙ | |||
453 454 455 456 457 458 459 | 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | - + - + | res)) (define (db:test-set-comment db run-id testname item-path comment) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" |
︙ | |||
517 518 519 520 521 522 523 | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | - - - + + + | (debug:print 4 "BEFORE: category: " category " variable: " variable " value: " value ", expected: " expected " tol: " tol " units: " units " status: " status " comment: " comment) (if (and (or (not expected)(equal? expected "")) (or (not tol) (equal? expected "")) (or (not units) (equal? expected ""))) (let-values (((new-expected new-tol new-units)(db:get-prev-tol-for-test db test-id category variable))) |
︙ | |||
541 542 543 544 545 546 547 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - + | ((<) (if (< value expected) "pass" "fail")) ((>=) (if (>= value expected) "pass" "fail")) ((<=) (if (<= value expected) "pass" "fail")) (else (conc "ERROR: bad tol comparator " tol)))))) (debug:print 4 "AFTER2: category: " category " variable: " variable " value: " value ", expected: " expected " tol: " tol " units: " units " status: " status " comment: " comment) (sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category,variable,value,expected,tol,units,comment,status) VALUES (?,?,?,?,?,?,?,?,?);" |
︙ | |||
569 570 571 572 573 574 575 | 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | - + | (if (not (eof-object? lin)) (begin (debug:print 4 lin) (db:csv->test-data db test-id lin) (loop (read-line)))))) ;; roll up the current results. (db:test-data-rollup db test-id))) |
︙ | |||
605 606 607 608 609 610 611 | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | - + | (values #f #f #f)) ;;====================================================================== ;; S T E P S ;;====================================================================== (define (db:step-get-time-as-string vec) |
︙ | |||
659 660 661 662 663 664 665 | 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | - - - + + + | ", get-status: " (db:step-get-status step)) (if (and (number? startt)(number? endt)) (seconds->hr-min-sec (- endt startt)) "-1"))) (if (> (string-length (db:step-get-logfile step)) 0) (vector-set! record 5 (db:step-get-logfile step)))) (else |
︙ | |||
696 697 698 699 700 701 702 703 704 705 706 707 708 709 | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (if (not (and (equal? (db:test-get-state test) "COMPLETED") (member (db:test-get-status test) '("PASS" "WARN" "CHECK")))) (set! result (cons waitontest-name result)))))) tests) (if (not ever-seen)(set! result (cons waitontest-name result))))) waiton) (delete-duplicates result)))) ;; the new prereqs calculation, looks also at itempath if specified ;; all prereqs must be met: ;; if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAIVED then prereq is met ;; if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met (define (db:get-prereqs-not-met db run-id waiton ref-item-path) (if (null? waiton) '() (let* ((unmet-pre-reqs '()) (result '())) (for-each (lambda (waitontest-name) ;; by getting the tests with matching name we are looking only at the matching test ;; and related sub items (let ((tests (db-get-tests-for-run db run-id waitontest-name #f '() '())) (ever-seen #f) (parent-waiton-met #f) (item-waiton-met #f)) (for-each (lambda (test) ;; (if (equal? waitontest-name (db:test-get-testname test)) ;; by defintion this had better be true ... (let* ((state (db:test-get-state test)) (status (db:test-get-status test)) (item-path (db:test-get-item-path test)) (is-completed (equal? state "COMPLETED")) (is-ok (member status '("PASS" "WARN" "CHECK" "WAIVED"))) (same-itempath (equal? ref-item-path item-path))) (set! ever-seen #t) (cond ;; case 1, non-item (parent test) is ((and (equal? item-path "") ;; this is the parent test is-completed is-ok) (set! waiton-met #t)) ((and same-itempath is-completed is-ok) (set! item-waiton-met #t))))) tests) (if (not (or waiton-met item-waiton-met)) (set! result (cons waitontest-name result))) ;; if the test is not found then clearly the waiton is not met... (if (not ever-seen)(set! result (cons waitontest-name result))))) waiton) (delete-duplicates result)))) ;;====================================================================== ;; Extract ods file from the db ;;====================================================================== ;; runspatt is a comma delimited list of run patterns ;; keypatt-alist must contain *all* keys with an associated pattern: '( ("KEY1" "%") .. ) |
︙ | |||
739 740 741 742 743 744 745 | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | (results (list runsheader)) (testdata-header (list "Run Id" "Testname" "Item Path" "Category" "Variable" "Value" "Expected" "Tol" "Units" "Status" "Comment"))) (debug:print 2 "Using " tempdir " for constructing the ods file. keyqry: " keyqry " keystr: " keysstr " with keys: " (map cadr keypatt-alist)) ;; "Expected Value" ;; "Value Found" ;; "Tolerance" (apply sqlite3:for-each-row |
︙ |
Added docs/monitor-state-diagram.svg version [5c370cf9de].