Overview
Comment: | Re-worked help, added -lock and -unlock for runs |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | v1.42 |
Files: | files | file ages | folders |
SHA1: |
ff89a30e63bdcb5c46e8f5bf20e7cb64 |
User & Date: | mrwellan on 2012-04-19 13:12:45 |
Other Links: | manifest | tags |
Context
2012-04-19
| ||
16:08 | Added comma separated filters to dashboard check-in: 46858112fb user: mrwellan tags: trunk | |
13:12 | Re-worked help, added -lock and -unlock for runs check-in: ff89a30e63 user: mrwellan tags: trunk, v1.42 | |
00:09 | Made xterms wider and shorter for run launching and test removal check-in: f195933f52 user: matt tags: trunk | |
Changes
Modified db.scm from [d9d220533b] to [d7e1a06604].
︙ | |||
375 376 377 378 379 380 381 382 383 384 385 386 387 388 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | + + + + + + + + + + | ;; does not (obviously!) removed dependent data. (define (db:delete-run db run-id) (sqlite3:execute db "DELETE FROM runs WHERE id=?;" run-id)) (define (db:update-run-event_time db run-id) (sqlite3:execute db "UPDATE runs SET event_time=strftime('%s','now') WHERE id=?;" run-id)) (define (db:lock/unlock-run db run-id lock unlock user) (let ((newlockval (if lock "locked" (if unlock "unlocked" "locked")))) ;; semi-failsafe (sqlite3:execute db "UPDATE runs SET state=? WHERE id=?;" newlockval run-id) (sqlite3:execute db "INSERT INTO access_log (user,accessed,args) VALUES(?,strftime('%s','now'),?);" user (conc newlockval " " run-id)) (debug:print 1 "INFO: " newlockval " run number " run-id))) ;;====================================================================== ;; K E Y S ;;====================================================================== ;; get key val pairs for a given run-id ;; ( (FIELDNAME1 keyval1) (FIELDNAME2 keyval2) ... ) (define (db:get-key-val-pairs db run-id) |
︙ |
Modified megatest.scm from [c096f14df6] to [8aefbc575b].
︙ | |||
32 33 34 35 36 37 38 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 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 105 106 107 108 109 110 111 112 113 | - + + + + + + + + + + + + + + + + - - - + + + - + - - - - - - - - + - - - - - - - - - - - - - - - - - - | Megatest, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright Matt Welland 2006-2012 Usage: megatest [options] -h : this help |
︙ | |||
177 178 179 180 181 182 183 184 185 186 187 188 189 190 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | + | "-load-test-data" "-summarize-items" "-gui" ;; misc "-archive" "-repl" "-lock" "-unlock" ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first "-runall" ;; run all tests "-remove-runs" "-usequeue" "-rebuild-db" |
︙ | |||
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | 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 445 446 447 448 449 450 451 452 | + + + + + + + + + + + + + + + + + + | (args:get-arg "-runtests") user args:arg-hash)))) ;;====================================================================== ;; Rollup into a run ;;====================================================================== (if (args:get-arg "-rollup") (general-run-call "-rollup" "rollup tests" (lambda (db target runname keys keynames keyvallst) (runs:rollup-run db keys (keys->alist keys "na") (args:get-arg ":runname") user)))) ;;====================================================================== ;; Lock or unlock a run ;;====================================================================== (if (or (args:get-arg "-lock")(args:get-arg "-unlock")) (general-run-call (if (args:get-arg "-lock") "-lock" "-unlock") "lock/unlock tests" (lambda (db target runname keys keynames keyvallst) (runs:handle-locking db target keys (args:get-arg ":runname") (args:get-arg "-lock") (args:get-arg "-unlock") user)))) ;;====================================================================== ;; Get paths to tests ;;====================================================================== ;; Get test paths matching target, runname, testpatt, and itempatt (if (args:get-arg "-test-paths") ;; if we are in a test use the MT_CMDINFO data |
︙ | |||
559 560 561 562 563 564 565 566 567 568 569 570 571 572 | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | + + + + | ;; - gathers host info and ;;====================================================================== (if (args:get-arg "-execute") (begin (launch:execute (args:get-arg "-execute")) (set! *didsomething* #t))) ;;====================================================================== ;; Test commands (i.e. for use inside tests) ;;====================================================================== (if (args:get-arg "-step") (if (not (getenv "MT_CMDINFO")) (begin (debug:print 0 "ERROR: MT_CMDINFO env var not set, -step must be called *inside* a megatest invoked environment!") (exit 5)) (let* ((step (args:get-arg "-step")) |
︙ | |||
715 716 717 718 719 720 721 722 723 724 725 726 727 728 | 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | + + + + | (sqlite3:finalize! db) (exit 6))) (let ((msg (args:get-arg "-m"))) (rtests:test-set-status! db test-id state newstatus msg otherdata)))) (sqlite3:finalize! db) (set! *didsomething* #t)))) ;;====================================================================== ;; Various helper commands can go below here ;;====================================================================== (if (args:get-arg "-showkeys") (let ((db #f) (keys #f)) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) |
︙ | |||
754 755 756 757 758 759 760 | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | - + + | (set! db (open-db)) (patch-db db) (sqlite3:finalize! db) (set! *didsomething* #t))) ;;====================================================================== ;; Update the tests meta data from the testconfig files |
︙ |
Modified runs.scm from [e2a9d896d7] to [002df5e7fd].
︙ | |||
497 498 499 500 501 502 503 504 505 506 507 508 509 510 | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | + + + | (take dparts (- (length dparts) count)) "/")))) ;; Remove runs ;; fields are passing in through ;; action: ;; 'remove-runs ;; 'set-state-status ;; ;; NB// should pass in keys? ;; (define (runs:operate-on db action runnamepatt testpatt itempatt #!key (state #f)(status #f)(new-state-status #f)) (let* ((keys (rdb:get-keys db)) (rundat (runs:get-runs-by-patt db keys runnamepatt)) (header (vector-ref rundat 0)) (runs (vector-ref rundat 1)) (states (if state (string-split state ",") '())) (statuses (if status (string-split status ",") '())) |
︙ | |||
642 643 644 645 646 647 648 649 650 651 652 653 654 655 | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | + + + + + + + + + + + + + + + + + + | (let* ((keynames (map key:get-fieldname keys)) (keyvallst (keys->vallist keys #t))) (proc db target runname keys keynames keyvallst))) (if th1 (thread-join! th1)) (sqlite3:finalize! db) (set! *didsomething* #t)))))) ;;====================================================================== ;; Lock/unlock runs ;;====================================================================== (define (runs:handle-locking db target keys runname lock unlock user) (let* ((rundat (runs:get-runs-by-patt db keys runname)) (header (vector-ref rundat 0)) (runs (vector-ref rundat 1))) (for-each (lambda (run) (let ((run-id (db:get-value-by-header run header "id"))) (if (or lock (and unlock (begin (print "Do you really wish to unlock run " run-id "?\n y/n: ") (equal? "y" (read-line))))) (db:lock/unlock-run db run-id lock unlock user) (debug:print 0 "INFO: Skipping lock/unlock on " run-id)))) runs))) ;;====================================================================== ;; Rollup runs ;;====================================================================== ;; Update the test_meta table for this test (define (runs:update-test_meta db test-name test-conf) (let ((currrecord (db:testmeta-get-record db test-name))) |
︙ |