Comment: | Merged v1.60 into trunk |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
da78ef98bbf46700ab5f64350cd68a97 |
User & Date: | mrwellan on 2015-07-01 11:34:33 |
Other Links: | manifest | tags |
2015-07-08
| ||
10:52 | Merged v1.60 into trunk check-in: 5e62539116 user: mrwellan tags: trunk | |
2015-07-01
| ||
11:34 | Merged v1.60 into trunk check-in: da78ef98bb user: mrwellan tags: trunk | |
11:30 | Updated docs check-in: 3d83362e7e user: mrwellan tags: v1.60 | |
2015-05-20
| ||
16:52 | Fixed problem in dbdir example in megatest.config check-in: d2d93cd7ce user: mrwellan tags: trunk | |
Modified .fossil-settings/ignore-glob from [32534fbc23] to [4907666f99].
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 | + + + | tests/installall/megatest.db tests/installall/monitor.db tests/megatest.db tests/fdktestqa/simplelinks/* tests/fdktestqa/testqa/megatest.db tests/fdktestqa/testqa/monitor.db megatest-fossil-hash.scm tests/release/runs/* tests/release/links/* tests/release/megatest.db |
Modified Makefile from [9b7ed373de] to [1d989205bc].
34 35 36 37 38 39 40 | 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 | - + + + + | # BASH_MACHTYPE=$(shell bash -c "echo \$$MACHTYPE") # ARCHSTR=$(BASH_MACHTYPE)_$(shell lsb_release -sr) ARCHSTR=$(shell lsb_release -sr) # ARCHSTR=$(shell bash -c "echo \$$MACHTYPE") all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard |
81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + + | $(PREFIX)/bin/.$(ARCHSTR)/ndboard : ndboard $(INSTALL) ndboard $(PREFIX)/bin/.$(ARCHSTR)/ndboard $(PREFIX)/bin/newdashboard : $(PREFIX)/bin/.$(ARCHSTR)/ndboard utils/mk_wrapper $(PREFIX) ndboard $(PREFIX)/bin/newdashboard chmod a+x $(PREFIX)/bin/newdashboard $(PREFIX)/bin/.$(ARCHSTR)/mdboard : multi-dboard $(INSTALL) multi-dboard $(PREFIX)/bin/.$(ARCHSTR)/mdboard $(PREFIX)/bin/mdboard : $(PREFIX)/bin/.$(ARCHSTR)/mdboard utils/mk_wrapper $(PREFIX) mdboard $(PREFIX)/bin/mdboard chmod a+x $(PREFIX)/bin/mdboard # $(HELPERS) : utils/% # $(INSTALL) $< $@ # chmod a+x $@ $(PREFIX)/bin/mt_laststep : utils/mt_laststep $(INSTALL) $< $@ |
136 137 138 139 140 141 142 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | - + | utils/mk_wrapper $(PREFIX) dboard $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard $(INSTALL) dboard $(PREFIX)/bin/.$(ARCHSTR)/dboard install : $(PREFIX)/bin/.$(ARCHSTR) $(PREFIX)/bin/.$(ARCHSTR)/mtest $(PREFIX)/bin/megatest \ $(PREFIX)/bin/.$(ARCHSTR)/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake \ $(PREFIX)/bin/nbfind $(PREFIX)/bin/loadrunner $(PREFIX)/bin/mt_xterm \ |
Added all-exceptions.ods version [9f8aefbaf1].
cannot compute difference between binary files
Modified api.scm from [8963db51e7] to [ef0a5aac98].
38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | + | get-run-status register-run get-tests-for-run get-test-id get-tests-for-runs-mindata get-run-name-from-id get-runs get-num-runs get-all-run-ids get-prev-run-ids get-run-ids-matching-target get-runs-by-patt get-steps-data get-steps-for-test login |
129 130 131 132 133 134 135 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + | ;; TESTS ((test-set-state-status-by-id) (apply db:test-set-state-status-by-id dbstruct params)) ((delete-test-records) (apply db:delete-test-records dbstruct params)) ((delete-old-deleted-test-records) (apply db:delete-old-deleted-test-records dbstruct params)) ((test-set-status-state) (apply db:test-set-status-state dbstruct params)) ((test-set-top-process-pid) (apply db:test-set-top-process-pid dbstruct params)) ((roll-up-pass-fail-counts) (apply db:roll-up-pass-fail-counts dbstruct params)) |
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + + | ;;====================================================================== ;; READ ONLY QUERIES ;;====================================================================== ;; KEYS ((get-key-val-pairs) (apply db:get-key-val-pairs dbstruct params)) ((get-keys) (db:get-keys dbstruct)) ((get-key-vals) (apply db:get-key-vals dbstruct params)) ((get-targets) (db:get-targets dbstruct)) ;; ARCHIVES ((test-get-archive-block-info) (apply db:test-get-archive-block-info dbstruct params)) ;; TESTS ((test-toplevel-num-items) (apply db:test-toplevel-num-items dbstruct params)) ((get-test-info-by-id) (apply db:get-test-info-by-id dbstruct params)) |
203 204 205 206 207 208 209 210 211 212 213 214 215 216 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | + | ((get-run-info) (apply db:get-run-info dbstruct params)) ((get-run-status) (apply db:get-run-status dbstruct params)) ((set-run-status) (apply db:set-run-status dbstruct params)) ((get-tests-for-run) (apply db:get-tests-for-run dbstruct params)) ((get-test-id) (apply db:get-test-id dbstruct params)) ((get-tests-for-run-mindata) (apply db:get-tests-for-run-mindata dbstruct params)) ((get-runs) (apply db:get-runs dbstruct params)) ((get-num-runs) (apply db:get-num-runs dbstruct params)) ((get-all-run-ids) (db:get-all-run-ids dbstruct)) ((get-prev-run-ids) (apply db:get-prev-run-ids dbstruct params)) ((get-run-ids-matching-target) (apply db:get-run-ids-matching-target dbstruct params)) ((get-runs-by-patt) (apply db:get-runs-by-patt dbstruct params)) ((get-run-name-from-id) (apply db:get-run-name-from-id dbstruct params)) ;; STEPS |
Modified bin/sleeprunner from [7ef4797782] to [64ce489f3b].
1 2 3 | 1 2 3 4 5 6 7 | - + | #!/bin/bash if [[ $SLEEPRUNNER == "" ]];then |
Modified client.scm from [c1867a27a6] to [ecbc2f1355].
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (client:setup run-id remaining-tries: (- remaining-tries 1))))))))) ;; keep this as a function to ease future (define (client:start run-id server-info) (http-transport:client-connect (tasks:hostinfo-get-interface server-info) (tasks:hostinfo-get-port server-info))) |
Modified common.scm from [163b8623d2] to [ec352267c4].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - - + + + + + + + + + | ;;====================================================================== ;; Copyright 2006-2012, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== |
149 150 151 152 153 154 155 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | - + | (if (> (- currtime lasttime) waitval) (begin (hash-table-set! *common:denoise* key currtime) #t) #f))) (define (common:get-megatest-exe) |
240 241 242 243 244 245 246 247 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + + - + | (or (configf:lookup *configdat* "setup" "testsuite" ) (pathname-file *toppath*))) ;;====================================================================== ;; E X I T H A N D L I N G ;;====================================================================== (define (common:legacy-sync-recommended) (or (args:get-arg "-runtests") (args:get-arg "-server") (args:get-arg "-set-run-status") (args:get-arg "-remove-runs") (args:get-arg "-get-run-status") )) (define (common:legacy-sync-required) (configf:lookup *configdat* "setup" "megatest-db")) (define (std-exit-procedure) (let ((no-hurry (if *time-to-exit* ;; hurry up #f (begin (set! *time-to-exit* #t) #t)))) |
354 355 356 357 358 359 360 | 393 394 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 | + + - + + - + | "disks" '("none" ""))) ;;====================================================================== ;; T A R G E T S ;;====================================================================== (define (common:args-get-target #!key (split #f)) (let* ((keys (keys:config-get-fields *configdat*)) (numkeys (length keys)) |
707 708 709 710 711 712 713 | 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 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 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 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ((equal? status "FAIL") "red") ((equal? status "WARN") "orange") ((equal? status "KILLED") "orange") ((equal? status "KILLREQ") "purple") ((equal? status "RUNNING") "blue") ((equal? status "ABORT") "brown") (else "black"))) ;;====================================================================== ;; N A N O M S G C L I E N T ;;====================================================================== (define (server:get-best-guess-address hostname) (let ((res #f)) (for-each (lambda (adr) (if (not (eq? (u8vector-ref adr 0) 127)) (set! res adr))) ;; NOTE: This can fail when there is no mention of the host in /etc/hosts. FIXME (vector->list (hostinfo-addresses (hostname->hostinfo hostname)))) (string-intersperse (map number->string (u8vector->list (if res res (hostname->ip hostname)))) "."))) (define (common:open-nm-req addr) (let* ((req (nn-socket 'req)) (res (nn-connect req addr))) req)) ;; (with-output-to-string (lambda ()(serialize obj))) (define (common:nm-send-receive soc msg) (nn-send soc msg) (nn-recv soc)) (define (common:close-nm-req soc) (nn-close soc)) (define (common:send-dboard-main-changed) (let* ((dashboard-ips (mddb:get-dashboards))) (for-each (lambda (ipadr) (let* ((soc (common:open-nm-req (conc "tcp://" ipadr))) (msg (conc "main " *toppath*)) (res (common:nm-send-receive-timeout soc msg))) (if (not res) ;; couldn't reach that dashboard - remove it from db (print "ERROR: couldn't reach dashboard " ipadr)) res)) dashboard-ips))) (define (common:nm-send-receive-timeout req msg) (let* ((key "ping") (success #f) (keepwaiting #t) (result #f) (sendrec (make-thread (lambda () (nn-send req msg) (set! result (nn-recv req)) (set! success #t)) "send-receive")) (timeout (make-thread (lambda () (let loop ((count 0)) (thread-sleep! 1) (print "still waiting after count seconds...") (if (and keepwaiting (< count 10)) (loop (+ count 1)))) (if keepwaiting (begin (print "timeout waiting for reply") (thread-terminate! sendrec)))) "timeout"))) (handle-exceptions exn (begin (print-call-chain) (print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) (print "exn=" (condition->list exn))) (thread-start! timeout) (thread-start! sendrec) (thread-join! sendrec) (if success (thread-terminate! timeout))) result)) (define (common:ping-nm req) ;; send a random number and check that we get it back (let* ((key "ping") (success #f) (keepwaiting #t) (ping (make-thread (lambda () (print "ping: sending string \"" key "\", expecting " (current-process-id)) (nn-send req key) (let ((result (nn-recv req))) (if (equal? (conc (current-process-id)) result) (begin (print "ping, success: received \"" result "\"") (set! success #t)) (begin (print "ping, failed: received key \"" result "\"") (set! keepwaiting #f) (set! success #f))))) "ping")) (timeout (make-thread (lambda () (let loop ((count 0)) (thread-sleep! 1) (print "still waiting after count seconds...") (if (and keepwaiting (< count 10)) (loop (+ count 1)))) (if keepwaiting (begin (print "timeout waiting for ping") (thread-terminate! ping)))) "timeout"))) (handle-exceptions exn (begin (print-call-chain) (print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) (print "exn=" (condition->list exn)) (print "ping failed to connect to tcp://" hostport)) (thread-start! timeout) (thread-start! ping) (thread-join! ping) (if success (thread-terminate! timeout))) (if return-socket (if success req #f) (begin (nn-close req) success)))) ;;====================================================================== ;; D A S H B O A R D D B ;;====================================================================== (define (mddb:open-db) (let* ((db (open-database (conc (get-environment-variable "HOME") "/.dashboard.db")))) (set-busy-handler! db (busy-timeout 10000)) (for-each (lambda (qry) (exec (sql db qry))) (list "CREATE TABLE IF NOT EXISTS vars (id INTEGER PRIMARY KEY,key TEXT, val TEXT, CONSTRAINT varsconstraint UNIQUE (key));" "CREATE TABLE IF NOT EXISTS dashboards ( id INTEGER PRIMARY KEY, pid INTEGER, username TEXT, hostname TEXT, ipaddr TEXT, portnum INTEGER, start_time TIMESTAMP DEFAULT (strftime('%s','now')), CONSTRAINT hostport UNIQUE (hostname,portnum) );" )) db)) ;; register a dashboard ;; (define (mddb:register-dashboard port) (let* ((pid (current-process-id)) (hostname (get-host-name)) (ipaddr (server:get-best-guess-address hostname)) (username (current-user-name)) ;; (car userinfo))) (db (mddb:open-db))) (print "Register monitor, pid: " pid ", hostname: " hostname ", port: " port ", username: " username) (exec (sql db "INSERT OR REPLACE INTO dashboards (pid,username,hostname,ipaddr,portnum) VALUES (?,?,?,?,?);") pid username hostname ipaddr port) (close-database db))) ;; unregister a monitor ;; (define (mddb:unregister-dashboard host port) (let* ((db (mddb:open-db))) (print "Register unregister monitor, host:port=" host ":" port) (exec (sql db "DELETE FROM dashboards WHERE hostname=? AND portnum=?;") host port) (close-database db))) ;; get registered dashboards ;; (define (mddb:get-dashboards) (let ((db (mddb:open-db))) (query fetch-column (sql db "SELECT ipaddr || ':' || portnum FROM dashboards;")))) |
Modified dashboard-tests.scm from [9124f50a29] to [89fa6fa483].
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + | (iup:label "TestComment " #:expand "HORIZONTAL") (lambda (testdat) (let ((newcomment (db:test-get-comment testdat))) (if *dashboard-comment-share-slot* (if (not (equal? (iup:attribute *dashboard-comment-share-slot* "VALUE") newcomment)) |
415 416 417 418 419 420 421 | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | - + - + | (exit 1)) (let* (;; (run-id (if testdat (db:test-get-run_id testdat) #f)) (keydat (if testdat (db:get-key-val-pairs dbstruct run-id) #f)) (rundat (if testdat (db:get-run-info dbstruct run-id) #f)) (runname (if testdat (db:get-value-by-header (db:get-rows rundat) (db:get-header rundat) "runname") #f)) |
460 461 462 463 464 465 466 | 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | - - - - - - + + + + + + | (conc "-e " (get-environment-variable "SHELL")) ""))) (system (conc "cd " rundir ";mt_xterm -T \"" (string-translate testfullname "()" " ") "\" " shell "&"))) (message-window (conc "Directory " rundir " not found"))))) (widgets (make-hash-table)) (refreshdat (lambda () |
692 693 694 695 696 697 698 | 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 | - + | (db:test-data-get-value x) (db:test-data-get-expected x) (db:test-data-get-tol x) (db:test-data-get-status x) (db:test-data-get-units x) (db:test-data-get-type x) (db:test-data-get-comment x))) |
Modified dashboard.scm from [7571891dc8] to [f416e75668].
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | + + + + + - + + + - + + | (exit))) (if (not (launch:setup-for-run)) (begin (print "Failed to find megatest.config, exiting") (exit 1))) (define *useserver* (or (args:get-arg "-use-server") (configf:lookup *configdat* "dashboard" "use-server"))) (define *dbdir* (db:dbfile-path #f)) ;; (conc (configf:lookup *configdat* "setup" "linktree") "/.db")) (define *dbstruct-local* (make-dbr:dbstruct path: *dbdir* local: #t)) (define *db-file-path* (db:dbfile-path 0)) ;; HACK ALERT: this is a hack, please fix. (define *read-only* (not (file-read-access? *db-file-path*))) (define toplevel #f) (define dlg #f) (define max-test-num 0) (define *keys* (if *useserver* (rmt:get-keys) |
207 208 209 210 211 212 213 | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | + + - - + + + + + + + + + - - - - - - + + + + + + + + - + | (c2 (map string->number (string-split color2))) (delta (map (lambda (a b)(abs (- a b))) c1 c2))) (null? (filter (lambda (x)(> x 3)) delta)))) ;; keypatts: ( (KEY1 "abc%def")(KEY2 "%") ) (define (update-rundat runnamepatt numruns testnamepatt keypatts) (let* ((referenced-run-ids '()) (allruns (if *useserver* (rmt:get-runs runnamepatt numruns *start-run-offset* keypatts) |
570 571 572 573 574 575 576 | 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | + + - + | (if (not (null? values)) (let ((newval (car values))) (iup:attribute-set! lb "VALUE" newval) newval)))))) (define (dashboard:update-target-selector key-lbs #!key (action-proc #f)) (let* ((runconf-targs (common:get-runconfig-targets)) (db-target-dat (if *useserver* (rmt:get-targets) |
802 803 804 805 806 807 808 | 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 | + + - + | #:dropdown "YES" #:action (lambda (obj val index lbstate) (iup:attribute-set! tb "VALUE" val) (dboard:data-set-run-name! *data* val) (dashboard:update-run-command)))) (refresh-runs-list (lambda () (let* ((target (dboard:data-get-target-string *data*)) (runs-for-targ (if *useserver* (rmt:get-runs-by-patt *keys* "%" target #f #f #f) |
1029 1030 1031 1032 1033 1034 1035 | 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 | - + - + + - + - + | #:expand "YES" #:addexpanded "NO" #:selection-cb (lambda (obj id state) ;; (print "obj: " obj ", id: " id ", state: " state) (let* ((run-path (tree:node->path obj id)) (run-id (tree-path->run-id (cdr run-path)))) |
1524 1525 1526 1527 1528 1529 1530 | 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 | - + + + + | (lambda (x) (on-exit std-exit-procedure) (examine-run *dbstruct-local* runid))) (begin (print "ERROR: runid is not a number " (args:get-arg "-run")) (exit 1))))) ((args:get-arg "-test") ;; run-id,test-id |
Modified db.scm from [272f710720] to [1f80fff6ba].
160 161 162 163 164 165 166 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + | (sqlite3:execute db (conc "PRAGMA synchronous = " (or syncprag 1) ";")))) ;; open an sql database inside a file lock ;; ;; returns: db existed-prior-to-opening ;; (define (db:lock-create-open fname initproc) |
201 202 203 204 205 206 207 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | - + | (inmem (if local #f (db:open-inmem-db))) (refdb (if local #f (db:open-inmem-db))) (db (db:lock-create-open dbpath ;; this is the database physically on disk (lambda (db) (handle-exceptions exn (begin |
484 485 486 487 488 489 490 | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - + + + + | '("description" #f) '("reviewed" #f) '("iterated" #f) '("avg_runtime" #f) '("avg_disk" #f) '("tags" #f) '("jobgroup" #f))))) |
564 565 566 567 568 569 570 | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | - + | (db:dbdat-get-db fromdb) full-sel) ;; tack on remaining records in fromdat (if (not (null? fromdat)) (set! fromdats (cons fromdat fromdats))) |
1250 1251 1252 1253 1254 1255 1256 | 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 | - + + + + + | ;; Now do rollups for the toplevel tests ;; (db:delay-if-busy dbdat) (for-each (lambda (toptest) (let ((test-name (list-ref toptest 3))) ;; (run-id (list-ref toptest 5))) |
1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 | 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 | + + + + + + + + + + + + + + + + | (lambda (a . x) (set! res (cons (apply vector a x) res))) db qrystr ))) (debug:print-info 11 "db:get-runs END qrystr: " qrystr " keypatts: " keypatts " offset: " offset " limit: " count) (vector header res))) (define (db:get-changed-run-ids since-time) (let* ((dbdir (db:dbfile-path #f)) ;; (configf:lookup *configdat* "setup" "dbdir")) (alldbs (glob (conc dbdir "/[0-9]*.db"))) (changed (filter (lambda (dbfile) (> (file-modification-time dbfile) since-time)) alldbs))) (delete-duplicates (map (lambda (dbfile) (let* ((res (string-match ".*\\/(\\d)*\\.db" dbfile))) (if res (string->number (cadr res)) (begin (debug:print 2 "WARNING: Failed to process " dbfile " for run-id") 0)))) changed)))) ;; db:get-runs-by-patt ;; get runs by list of criteria ;; register a test run with the db ;; ;; Use: (db:get-value-by-header (db:get-header runinfo)(db:get-rows runinfo)) ;; to extract info from the structure returned |
1726 1727 1728 1729 1730 1731 1732 | 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 | - + | (runs-info '())) ;; First get all the runname/run-ids (db:delay-if-busy dbdat) (sqlite3:for-each-row (lambda (run-id runname) (set! runs-info (cons (list run-id runname) runs-info))) db |
1765 1766 1767 1768 1769 1770 1771 | 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 | - - + + | ;; db:get-runs-by-patt ;; get runs by list of criteria ;; register a test run with the db ;; ;; Use: (db:get-value-by-header (db:get-header runinfo)(db:get-rows runinfo)) ;; to extract info from the structure returned ;; |
2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 | 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 | + + + + + + + + + + + + + + | (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) (db:delay-if-busy dbdat) (sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category,variable,value,expected,tol,units,comment,status,type) VALUES (?,?,?,?,?,?,?,?,?,?);" test-id category variable value expected tol units (if comment comment "") status type))) csvlist))) ;; This routine moved from tdb.scm, tdb:read-test-data ;; (define (db:read-test-data dbstruct run-id test-id categorypatt) (let* ((dbdat (db:get-db dbstruct run-id)) (db (db:dbdat-get-db dbdat)) (res '())) (db:delay-if-busy dbdat) (sqlite3:for-each-row (lambda (id test_id category variable value expected tol units comment status type) (set! res (cons (vector id test_id category variable value expected tol units comment status type) res))) db "SELECT id,test_id,category,variable,value,expected,tol,units,comment,status,type FROM test_data WHERE test_id=? AND category LIKE ? ORDER BY category,variable;" test-id categorypatt) (reverse res))) ;;====================================================================== ;; Misc. test related queries ;;====================================================================== (define (db:get-run-ids-matching-target dbstruct keynames target res runname testpatt statepatt statuspatt) (let* ((dbdat (db:get-db dbstruct #f)) |
2709 2710 2711 2712 2713 2714 2715 | 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 | + + - - + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + | (let ((dbdat (db:get-db dbstruct run-id))) (if (member state '("LAUNCHED" "REMOTEHOSTSTART")) (db:general-call dbdat 'set-test-start-time (list test-id))) (if msg (db:general-call dbdat 'state-status-msg (list state status msg test-id)) (db:general-call dbdat 'state-status (list state status test-id))))) ;; call with state = #f to roll up with out accounting for state/status of this item ;; |
2783 2784 2785 2786 2787 2788 2789 | 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 | - + + + + + + + + + + + + + + + - + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | '(tests:test-set-toplog "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path='';") '(update-cpuload-diskfree "UPDATE tests SET cpuload=?,diskfree=? WHERE id=?;") ;; DONE '(update-uname-host "UPDATE tests SET uname=?,host=? WHERE id=?;") ;; DONE '(update-test-state "UPDATE tests SET state=? WHERE state=? AND run_id=? AND testname=? AND NOT (item_path='' AND testname IN (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));") '(update-test-status "UPDATE tests SET status=? WHERE status like ? AND run_id=? AND testname=? AND NOT (item_path='' AND testname IN (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));") ;; stuff for roll-up-pass-fail-counts '(update-pass-fail-counts "UPDATE tests |
2850 2851 2852 2853 2854 2855 2856 | 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 | + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (let ((query (let ((q (alist-ref (if (string? stmtname) (string->symbol stmtname) stmtname) db:queries))) (if q (car q) #f)))) (db:delay-if-busy dbdat) (apply sqlite3:execute (db:dbdat-get-db dbdat) query params) #t)) |
3035 3036 3037 3038 3039 3040 3041 | 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 | - + | ;; if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met ;; ;; Note: mode 'normal means that tests must be COMPLETED and ok (i.e. PASS, WARN, CHECK, SKIP or WAIVED) ;; mode 'toplevel means that tests must be COMPLETED only ;; mode 'itemmatch or 'itemwait means that tests items must be COMPLETED and (PASS|WARN|WAIVED|CHECK) [[ NB// NOT IMPLEMENTED YET ]] ;; ;; (define (db:get-prereqs-not-met dbstruct run-id waitons ref-item-path mode) |
Modified docs/manual/Makefile from [038153bc89] to [ed0d48b31e].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + + + + + + + + + + + + + - + - - + + - - - - - + + + + + | ASCPATH = $(shell which asciidoc) EXEPATH = $(shell realpath $(ASCPATH)) BINPATH = $(shell dirname $(EXEPATH)) DISPATH = $(shell dirname $(BINPATH)) # broad_goals.csv needed_features.csv : tables/*.dat # ./refdb2csv tables # in a makefile recipe, $< denotes the first dependency; $@ the target # design_spec.html : $(SRCFILES) $(CSVFILES) # asciidoc -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 design_spec.txt # |
Modified docs/manual/megatest_manual.html from [cab8faf307] to [7c0b2d6913].
| 1 2 3 4 5 6 7 8 9 10 11 12 | - + - - + - - + + |
|
83 84 85 86 87 88 89 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | - + - - - - - - | ul, ol, li > p { margin-top: 0; } ul > li { color: #aaa; } ul > li > * { color: black; } |
221 222 223 224 225 226 227 | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | - + | div.exampleblock > div.content { border-left: 3px solid #dddddd; padding-left: 0.5em; } div.imageblock div.content { padding-left: 0; } |
416 417 418 419 420 421 422 423 424 425 426 427 428 429 | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | + + + + + + | div.unbreakable { page-break-inside: avoid; } /* * xhtml11 specific * * */ tt { font-family: "Courier New", Courier, monospace; font-size: inherit; color: navy; } div.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } div.tableblock > table { border: 3px solid #527bbd; |
449 450 451 452 453 454 455 456 457 458 459 460 461 462 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | + + + + + + | } /* * html5 specific * * */ .monospaced { font-family: "Courier New", Courier, monospace; font-size: inherit; color: navy; } table.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } thead, p.tableblock.header { font-weight: bold; |
529 530 531 532 533 534 535 | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | body.manpage div.sectionbody { margin-left: 3em; } @media print { body.manpage div#toc { display: none; } } @media screen { body { max-width: 50em; /* approximately 80 characters wide */ margin-left: 16em; |
723 724 725 726 727 728 729 | 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | - + - - + + + + + + | if (document.addEventListener) document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); else window.onload = reinstallAndRemoveTimer; } } |
861 862 863 864 865 866 867 | 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | - + - + - + - - - - + + + + - - - + + - - + + - - + + - - + + - - + | <div class="sectionbody"> <div class="sect2"> <h3 id="_dependencies">Dependencies</h3> <div class="paragraph"><p>Chicken scheme and a number of "eggs" are required for building Megatest. See the script installall.sch in the utils directory of the distribution for a mostly automated way to install everything needed for building Megatest on Linux.</p></div> |
958 959 960 961 962 963 964 | 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 | - - - + + + - - + + - + - - - + + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - - + + + - + + + + + + + + + + + + + - - - - + + + + - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + - + | </div> <div class="sect1"> <h2 id="_limiting_your_running_jobs">Limiting your running jobs</h2> <div class="sectionbody"> <div class="paragraph"><p>The following example will limit a test in the jobgroup "group1" to no more than 10 tests simultaneously.</p></div> <div class="paragraph"><p>In your testconfig:</p></div> <div class="listingblock"> |
1358 1359 1360 1361 1362 1363 1364 | 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 | - + - - + + - | </div> <div class="sect1"> <h2 id="_example_index">Example Index</h2> <div class="sectionbody"> </div> </div> </div> |
Modified docs/manual/reference.txt from [3e61aa4f93] to [457cb0a364].
181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | + + + + + + + + + + + + + + | ----------------- [triggers] COMPLETED/ xterm -e bash -s -- ----------------- NOTE: There is a trailing space after the -- Override the Toplevel HTML File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Megatest generates a simple html file summary for top level tests of iterated tests. The generation can be overridden. .For test "runfirst" override the toplevel generation with a script "mysummary.sh" ----------------- # Override the rollup for specific tests [testrollup] runfirst mysummary.sh ----------------- Programming API --------------- These routines can be called from the megatest repl. .API Server Management Calls [width="70%",cols="^,2m,2m,2m",frame="topbot",options="header,footer"] |
Deleted docs/manual/server.pdf version [710fc5512e].
cannot compute difference between binary files
Modified docs/manual/server.png from [8012d70e5a] to [ae7d7ee58e].
cannot compute difference between binary files
Modified http-transport.scm from [bbdcef7659] to [8ea8f1dd96].
45 46 47 48 49 50 51 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - - - - - - - - - - - - - | ;;====================================================================== ;; Call this to start the actual server ;; (define *db:process-queue-mutex* (make-mutex)) |
420 421 422 423 424 425 426 | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | - + | (loop count server-state (+ bad-sync-count 1))))) ((exn) (debug:print 0 "ERROR: error from sync code other than 'sync-failed. Attempting to gracefully shutdown the server") (tasks:server-delete-record (db:delay-if-busy tdbdat) server-id " http-transport:keep-running crashed") (exit))) (set! sync-time (- (current-milliseconds) start-time)) (set! rem-time (quotient (- 4000 sync-time) 1000)) |
Modified launch.scm from [6b1778f659] to [0b946dd28d].
320 321 322 323 324 325 326 | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | - + | ;; Since we should have a clean slate at this time there is no need to do ;; any of the other stuff that tests:test-set-status! does. Let's just ;; force RUNNING/n/a ;; (thread-sleep! 0.3) (tests:test-force-state-status! run-id test-id "RUNNING" "n/a") |
846 847 848 849 850 851 852 | 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 | - + | (begin (debug:print-info 0 "attempting to preclean directory " (db:test-get-rundir testinfo) " for test " test-name "/" item-path) (runs:remove-test-directory testinfo 'remove-data-only))) ;; remove data only, do not perturb the record ;; prevent overlapping actions - set to LAUNCHED as early as possible ;; (tests:test-set-status! run-id test-id "LAUNCHED" "n/a" #f #f) ;; (if launch-results launch-results "FAILED")) |
Added loadwatch/Makefile version [d2fa89fb63].
1 2 3 4 5 6 7 8 9 10 11 | + + + + + + + + + + + | all : launch-many queuefeeder queuefeeder-server launch-many : launch-many.scm csc launch-many.scm queuefeeder : queuefeeder.scm csc queuefeeder.scm queuefeeder-server : queuefeeder-server.scm csc queuefeeder-server.scm |
Added loadwatch/bjob-count.sh version [0c8ad639ee].
1 2 3 | + + + | #!/bin/bash bqueues | grep normal |awk '{print $8}' |
Added loadwatch/launch-many.scm version [141ac70432].
1 2 3 4 5 6 7 8 9 | + + + + + + + + + | (use posix) (let loop ((count 0)) (if (> count 500000) (print "DONE") (let ((cmd (conc "./queuefeeder xena:22022 bsub ./testopenlava.sh " count " " (random 30)))) (print "Running: " cmd) (system cmd) (loop (+ count 1))))) |
Added loadwatch/loadwatch.scm version [d281425009].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (use regex srfi-69) (define-record processdat %cpu virt res %mem count ) (define (pp-processdat dat) (print "(processdat" " %cpu=" (processdat-%cpu dat) " virt=" (processdat-virt dat) " res=" (processdat-res dat) " %mem=" (processdat-%mem dat) " count=" (processdat-count dat))) (define nrex (regexp "^(\\d+[\\d\\.]*)([mkgMKG])$")) (define (get-number numstr) (let ((n (string->number numstr))) (if n n (let ((nmatch (string-match nrex numstr))) (if nmatch (* (string->number (cadr nmatch)) (case (string->symbol (caddr nmatch)) ((k) 1024) ((m) 1048576) ((g) 1073741824) (else (print "ERROR: Unrecognised unit: " (caddr nmatch) ", extracted for " numstr) 1))) #f))))) (define (snagload) (let ((dat (make-hash-table)) ;; user => hash-of-processdat (hdr (regexp "^\\s+PID")) (rx (regexp "\\s+")) (wht (regexp "^\\s+")) ) (with-input-from-pipe "top -n 1 -b" (lambda () (let loop ((inl (read-line)) (inbod #f)) (if (eof-object? inl) dat (if (not inbod) (if (string-search hdr inl) (loop (read-line) #t) (loop (read-line) #f)) (let* ((lparts (map (lambda (x) (let ((num (get-number x))) (if num num x))) (string-split-fields rx (string-substitute wht "" inl) #:infix)))) (if (> (length lparts) 10) (let* ((user (list-ref lparts 1)) (virt (list-ref lparts 4)) (res (list-ref lparts 5)) (%cpu (list-ref lparts 8)) (%mem (list-ref lparts 9)) (time (list-ref lparts 10)) (pname (list-ref lparts 11)) (udat (or (hash-table-ref/default dat user #f) (let ((u (make-hash-table))) (hash-table-set! dat user u) u))) (pdat (or (hash-table-ref/default udat pname #f) (let ((p (make-processdat 0 0 0 0 0))) (hash-table-set! udat pname p) p)))) (print "User: " user ", pname: " pname ", virt: " virt ", res: " res ", %cpu: " %cpu ", %mem: " %mem) (processdat-%cpu-set! pdat (+ (processdat-%cpu pdat) %cpu)) (processdat-%mem-set! pdat (+ (processdat-%mem pdat) %mem)) (processdat-virt-set! pdat (+ (processdat-virt pdat) virt)) (processdat-res-set! pdat (+ (processdat-res pdat) res)) (processdat-count-set! pdat (+ (processdat-count pdat) 1)) (loop (read-line) inbod)) dat))))))))) (define x (snagload)) ;; (processdat-%cpu (hash-table-ref (hash-table-ref x "matt") "evolution-calen")) |
Added loadwatch/queuefeeder-server.scm version [4584852f4e].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;;====================================================================== ;; Copyright 2015-2015, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== ;; Queue Feeder. Use a crude droop curve to limit feeding jobs into a queue ;; to prevent slamming the queue ;;====================================================================== ;; Methodology ;; ;; Connect to the server, the server delays the appropriate time (if ;; any) and then launch the task. ;; (use nanomsg posix regex) ;; (use trace) ;; (trace nn-bind nn-socket nn-assert nn-recv nn-send thread-terminate! nn-close ) (define port 22022) ;; get needed stuff from commandline ;; (define queuelen #f) (define cmd '()) ;; cmd is run to give a count of the queue length => returns number in queue (define usage "Usage: queuefeeder-server port target_queue_length command where command is a script or program that gives an integer on stdout of current queue length") (let ((args (argv))) (if (> (length args) 3) (begin (set! port (cadr args)) (set! queuelen (string->number (caddr args))) (set! cmd (cadddr args))) ;; no params supported (begin (print usage) (exit)))) (if (not queuelen) (begin (print "queuelen must be a number") (print usage) (exit))) (print "Running queue feeder with port=" port ", command=" cmd) (define rep (nn-socket 'rep)) (print "connecting, got: " (nn-bind rep (conc "tcp://" "*" ":" port))) (define *current-delay* 0) (define (exp-droop-calc x targ) (cond ((> (- x targ) 1) 136) ;; top off at 136 seconds (else (let ((res (* 50 (exp (- x targ))))) (cond ((and (> res 0)(< res 0.01)) 0.01) ((> res 45) 45) ;; cap at 45 seconds (else res)))))) ;; x input value (current number in the queue) ;; targ is the desired queue length ;; (define (piecewise-droop-calc x targ) (let ((top 50)) (cond ((> (- x targ) 0) top) ;; top off at top seconds ((> x (- targ top)) (+ (* 1 (- x (- targ top))) (/ (- top targ) targ))) (else (let ((res (/ x targ))) (if (< res 0.01) 0.01 res)))))) (define (server soc) (print "server starting") (let loop ((msg-in (nn-recv soc)) (count 0)) (if (eq? 0 (modulo count 1000)) (print "server received: " msg-in ", count=" count)) (cond ((equal? msg-in "quit") (nn-send soc "Ok, quitting")) ((and (>= (string-length msg-in) 4) (equal? (substring msg-in 0 4) "ping")) (nn-send soc (conc (current-process-id))) (loop (nn-recv soc)(+ count 1))) (else (mutex-lock! *current-delay-mutex*) (let ((current-delay *current-delay*)) (mutex-unlock! *current-delay-mutex*) ;; (thread-sleep! current-delay) (nn-send soc (conc current-delay " hello " msg-in " you waited " current-delay " seconds")) (loop (nn-recv soc)(if (> count 20000000) 0 (+ count 1)))))))) (define (ping-self host port #!key (return-socket #t)) ;; send a random number along with pid and check that we get it back (let* ((req (nn-socket 'req)) (key "ping") (success #f) (keepwaiting #t) (ping (make-thread (lambda () (print "ping: sending string \"" key "\", expecting " (current-process-id)) (nn-send req key) (let ((result (nn-recv req))) (if (equal? (conc (current-process-id)) result) (begin (print "ping, success: received \"" result "\"") (set! success #t)) (begin (print "ping, failed: received key \"" result "\"") (set! keepwaiting #f) (set! success #f))))) "ping")) (timeout (make-thread (lambda () (let loop ((count 0)) (thread-sleep! 1) (print "still waiting after " count " seconds...") (if (and keepwaiting (< count 10)) (loop (+ count 1)))) (if keepwaiting (begin (print "timeout waiting for ping") (thread-terminate! ping)))) "timeout"))) (nn-connect req (conc "tcp://" host ":" port)) (handle-exceptions exn (begin (print-call-chain) (print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) (print "exn=" (condition->list exn)) (print "ping failed to connect to " host ":" port)) (thread-start! timeout) (thread-start! ping) (thread-join! ping) (if success (thread-terminate! timeout))) (if return-socket (if success req #f) (begin (nn-close req) success)))) (define *current-delay-mutex* (make-mutex)) ;; update the *current-delay* value every minute or QUEUE_CHK_DELAY seconds (thread-start! (make-thread (lambda () (let ((delay-time (string->number (or (get-environment-variable "QUEUE_CHK_DELAY") "30")))) (let loop () (with-input-from-pipe cmd ;;; my query to get queue length (lambda () (let* ((val (read)) (droop-val (if (number? val)(piecewise-droop-calc val queuelen) #f))) ;; val is number of jobs in queue. Use a linear droop of val/40 (mutex-lock! *current-delay-mutex*) (set! *current-delay* (or droop-val 30)) ;; (/ (or droop-val 100) 50)) (mutex-unlock! *current-delay-mutex*) (print "droop-val=" droop-val) (thread-sleep! delay-time)))) (loop)))))) (let ((server-thread (make-thread (lambda ()(server rep)) "server"))) (thread-start! server-thread) (if (ping-self (get-host-name) port) (begin (thread-join! server-thread) (nn-close rep)) (print "ping failed"))) (exit) |
Added loadwatch/queuefeeder.scm version [b7ca858163].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;;====================================================================== ;; Copyright 2015-2015, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== ;; Queue Feeder. Use a crude droop curve to limit feeding jobs into a queue ;; to prevent slamming the queue ;;====================================================================== ;; Methodology ;; ;; Connect to the server, the server delays the appropriate time (if ;; any) and then launch the task. ;; (use nanomsg posix regex message-digest md5) (define req (nn-socket 'req)) ;; get needed stuff from commandline ;; (define hostport #f) (define cmd '()) (let ((args (argv))) (if (> (length args) 2) (begin (set! hostport (cadr args)) (set! cmd (cddr args))) (begin (print "Usage: queuefeeder host:port command params ....") (exit)))) (nn-connect req (conc "tcp://" hostport)) ;; xena:22022") (define (client-send-receive soc msg) (nn-send soc msg) (nn-recv soc)) ;; Generate a unique signature for this client location ;; (define (make-signature) (message-digest-string (md5-primitive) (with-output-to-string (lambda () (write (current-directory)))))) ;; (define ((talk-to-server soc)) ;; (let loop ((cnt 200000)) ;; (let ((name (list-ref '("Matt" "Tom" "Bob" "Jill" "James" "Jane")(random 6)))) ;; ;; (print "Sending " name) ;; ;; (print ;; (client-send-receive req name) ;; ) ;; (if (> cnt 0)(loop (- cnt 1))))) ;; (print (client-send-receive req "quit")) ;; (nn-close req) ;; (exit)) ;; (define (get-delay signature) (let* ((full-msg (client-send-receive req (conc (current-user-name) "@" (get-host-name) ":" signature)))) (print "Got " full-msg) (let* ((reply-msg (string-match "^([\\d\\.]+)\\s+(.*)$" full-msg)) (delay-time (if (> (length reply-msg) 2) (string->number (cadr reply-msg)) 1)) ;; fall back to one sec delay (msg (if (> (length reply-msg) 2) (caddr reply-msg) full-msg))) (values delay-time msg)))) (let ((signature (make-signature))) (thread-start! (lambda () (thread-sleep! 60) (print "Give up on waiting for the server") ;; (nn-close req) ;; (exit) )) (thread-join! (thread-start! (lambda () (let-values (((delay-time msg)(get-delay signature))) (print "INFO: sleeping " delay-time " seconds per request of queuefeeder server") (thread-sleep! delay-time) (print "INFO: done waiting, now executing requested task."))))) (nn-close req)) (process-execute (car cmd) (cdr cmd)) |
Added loadwatch/testopenlava.sh version [1f61657fdf].
1 2 3 4 5 6 7 8 9 | + + + + + + + + + | #!/bin/bash job_order=$1 job_length=$2 echo "START: $job_order" > $job_order.log sleep $job_length echo "END: $job_order" >> $job_order.log |
Modified megatest-version.scm from [456f37ff9a] to [a98e35a9bb].
1 2 3 4 5 | 1 2 3 4 5 6 7 | - + | ;; Always use two or four digit decimal ;; 1.01, 1.02...1.10,1.11,1,1101 ... 1.99,2.00.. (declare (unit megatest-version)) |
Modified megatest.scm from [2b7acd1b9e] to [6c0791ddb1].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + + + + | ;; Copyright 2006-2012, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;; (include "common.scm") ;; (include "megatest-version.scm") (define (toplevel-command . a) #f) (define (toplevel-command . a) #f) ;; fake out readline usage of toplevel-command (define (toplevel-command . a) #f) (use sqlite3 srfi-1 posix regex regex-case srfi-69 base64 readline apropos json http-client directory-utils rpc ;; (srfi 18) extras) http-client srfi-18 extras format) ;; zmq extras) |
66 67 68 69 70 71 72 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - + - - | license GPL, Copyright Matt Welland 2006-2012 Usage: megatest [options] -h : this help -version : print megatest version (currently " megatest-version ") Launching and managing runs |
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | + + | -list-db-targets : list the target combinations used in the db -show-config : dump the internal representation of the megatest.config file -show-runconfig : dump the internal representation of the runconfigs.config file -dumpmode json : dump in json format instead of sexpr -show-cmdinfo : dump the command info for a test (run in test environment) -section sectionName -var varName : for config and runconfig lookup value for sectionName varName -since N : get list of runs changed since time N (Unix seconds) -fields fieldspec : fields to include in json dump; runs:id,runame+tests:testname+steps Misc -start-dir path : switch to this directory before running megatest -rebuild-db : bring the database schema up to date -cleanup-db : remove any orphan records, vacuum the db -import-megatest.db : migrate a database from v1.55 series to v1.60 series -sync-to-megatest.db : migrate data back to megatest.db |
241 242 243 244 245 246 247 248 249 250 251 252 253 254 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | + + | "-dumpmode" "-run-id" "-ping" "-refdb2dat" "-o" "-log" "-archive" "-since" "-fields" ) (list "-h" "-help" "--help" "-version" "-force" "-xterm" "-showkeys" "-show-keys" |
274 275 276 277 278 279 280 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | - + + | "-show-config" "-show-cmdinfo" "-get-run-status" ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first |
302 303 304 305 306 307 308 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; The watchdog is to keep an eye on things like db sync etc. ;; (define *time-zero* (current-seconds)) (define *watchdog* (make-thread (lambda () (thread-sleep! 0.05) ;; delay for startup |
732 733 734 735 736 737 738 | 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | + + - - - - + + + + + + + + | ;;====================================================================== ;; Weird special calls that need to run *after* the server has started? ;;====================================================================== (if (args:get-arg "-list-targets") (let ((targets (common:get-runconfig-targets))) (print "Found "(length targets) " targets") (case (string->symbol (or (args:get-arg "-dumpmode") "alist")) ((alist) |
766 767 768 769 770 771 772 | 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | - + | ((and (args:get-arg "-section") (args:get-arg "-var")) (let ((val (configf:lookup data (args:get-arg "-section")(args:get-arg "-var")))) (if val (print val)))) ((not (args:get-arg "-dumpmode")) (pp (hash-table->alist data))) ((string=? (args:get-arg "-dumpmode") "json") |
792 793 794 795 796 797 798 | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 | - - + + | (json-write data)) (else (debug:print 0 "ERROR: -dumpmode of " (args:get-arg "-dumpmode") " not recognised"))) (set! *didsomething* #t) (pop-directory))) (if (args:get-arg "-show-cmdinfo") |
857 858 859 860 861 862 863 | 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + + + + + + + + + + + + - - - - + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + + + - - - - + + + + + + + + + + + + + | (args:get-arg "-get-run-status")) (general-run-call "-set-run-status" "set run status" (lambda (target runname keys keyvals) (let* ((runsdat (rmt:get-runs-by-patt keys runname (common:args-get-target) |
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | + + + + + + + + + + + - + | (tdb:step-get-event_time step))) steps))))))))) tests))))) runs) (if (eq? dmode 'json)(json-write data)) (set! *didsomething* #t)))) ;; Don't think I need this. Incorporated into -list-runs instead ;; ;; (if (and (args:get-arg "-since") ;; (launch:setup-for-run)) ;; (let* ((since-time (string->number (args:get-arg "-since"))) ;; (run-ids (db:get-changed-run-ids since-time))) ;; ;; (rmt:get-tests-for-runs-mindata run-ids testpatt states status not-in) ;; (print (sort run-ids <)) ;; (set! *didsomething* #t))) ;;====================================================================== ;; full run ;;====================================================================== ;; get lock in db for full run for this directory ;; for all tests with deps ;; walk tree of tests to find head tasks ;; add head tasks to task queue ;; add dependant tasks to task queue ;; add remaining tasks to task queue ;; for each task in task queue ;; if have adequate resources ;; launch task ;; else ;; put task in deferred queue ;; if still ok to run tasks ;; process deferred tasks per above steps ;; run all tests are are Not COMPLETED and PASS or CHECK |
Modified mt.scm from [82ea79d650] to [a598f8fbca].
39 40 41 42 43 44 45 | 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 | - + - + | ;; get runs by list of criteria ;; register a test run with the db ;; ;; Use: (db-get-value-by-header (db:get-header runinfo)(db:get-rows runinfo)) ;; to extract info from the structure returned ;; (define (mt:get-runs-by-patt keys runnamepatt targpatt) |
Added multi-dboard.scm version [a922f9abf1].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 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 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 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 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 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 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;;====================================================================== ;; Copyright 2006-2013, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== (use format numbers sql-de-lite srfi-1 posix regex regex-case srfi-69 nanomsg srfi-18 call-with-environment-variables) (require-library iup) (import (prefix iup iup:)) (use canvas-draw) (declare (uses margs)) (declare (uses megatest-version)) (declare (uses gutils)) (declare (uses tree)) (declare (uses configf)) (declare (uses portlogger)) (declare (uses keys)) (declare (uses common)) (include "common_records.scm") ;; (include "db_records.scm") ;; (include "key_records.scm") (define help (conc "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright (C) Matt Welland 2011 Usage: dashboard [options] -h : this help -group groupname : display this group of areas -test testid : control test identified by testid -guimonitor : control panel for runs Misc -rows N : set number of rows ")) ;; process args (define remargs (args:get-args (argv) (list "-group" ;; display this group of areas "-debug" ) (list "-h" "-v" "-q" ) args:arg-hash 0)) (if (args:get-arg "-h") (begin (print help) (exit))) ;; (if (args:get-arg "-host") ;; (begin ;; (set! (common:get-remote remote) (string-split (args:get-arg "-host" ":"))) ;; (client:launch)) ;; (client:launch)) (define *runremote* #f) (define *windows* (make-hash-table)) (define *changed-main* (make-hash-table)) ;; set path/... => #t (define *changed-mutex* (make-mutex)) ;; use for all incoming change requests (debug:setup) (define *tim* (iup:timer)) (define *ord* #f) (iup:attribute-set! *tim* "TIME" 300) (iup:attribute-set! *tim* "RUN" "YES") (define (message-window msg) (iup:show (iup:dialog (iup:vbox (iup:label msg #:margin "40x40"))))) (define (iuplistbox-fill-list lb items . default) (let ((i 1) (selected-item (if (null? default) #f (car default)))) (iup:attribute-set! lb "VALUE" (if selected-item selected-item "")) (for-each (lambda (item) (iup:attribute-set! lb (number->string i) item) (if selected-item (if (equal? selected-item item) (iup:attribute-set! lb "VALUE" item))) ;; (number->string i)))) (set! i (+ i 1))) items) i)) (define (pad-list l n)(append l (make-list (- n (length l))))) (define (mkstr . x) (string-intersperse (map conc x) ",")) (define (update-search x val) (hash-table-set! *searchpatts* x val)) ;;====================================================================== ;; R E C O R D S ;;====================================================================== ;; NOTE: Consider switching to defstruct. ;; data for an area (regression or testsuite) ;; (define-record areadat name ;; area name path ;; mt run area home configdat ;; megatest config denoise ;; focal point for not putting out same messages over and over client-signature ;; key for client-server conversation remote ;; hash of all the client side connnections run-keys ;; target keys for this area runs ;; used in dashboard, hash of run-ids -> rundat read-only ;; can I write to this area? monitordb ;; db handle for monitor.db maindb ;; db handle for main.db ) ;; rundat, basic run data ;; (define-record rundat id ;; the run-id target ;; val1/val2 ... corrosponding to run-keys in areadat runname state ;; state of the run, symbol status ;; status of the run, symbol event-time ;; when the run was initiated tests ;; hash of test-id -> testdat, QUESTION: separate by run-id? db ;; db handle ) ;; testdat, basic test data (define-record testdat run-id ;; what run is this from id ;; test id testname ;; test name itempath ;; item path state ;; test state, symbol status ;; test status, symbol event-time ;; when the test started duration ;; how long the test took ) ;; general data for the dboard application ;; (define-record data cfgdat ;; data from ~/.megatest/<group>.dat areas ;; hash of areaname -> area-rec current-window-id ;; current-tab-id ;; update-needed ;; flag to indicate that the tab pointed to by current tab id needs refreshing immediately tabs ;; hash of tab-id -> areaname (??) should be of type "tab" ) ;; all the components of an area display, all fits into a tab but ;; parts may be swapped in/out as needed ;; (define-record tab tree matrix ;; the spreadsheet areadat ;; the one-structure (one day dbstruct will be put in here) view-path ;; <target/path>/<runname>/... view-type ;; standard, etc. controls ;; the controls data ;; all the data kept in sync with db filters ;; user filters, alist name -> filter record, eventually store these in ~/.megatest/<group>.dat? run-id ;; the current run-id test-ids ;; the current test id hash, run-id => test-id command ;; the command from the entry field headers ;; hash of header -> colnum rows ;; hash of rowname -> rownum ) (define-record filter target ;; hash of widgets for the target runname ;; the runname widget testpatt ;; the testpatt widget ) ;;====================================================================== ;; D B ;;====================================================================== ;; These are all using sql-de-lite and independent of area so cannot use stuff ;; from db.scm ;; NB// run-id=#f => return dbdir only ;; (define (areadb:dbfile-path areadat run-id) (let* ((cfgdat (areadat-configdat areadat)) (dbdir (or (configf:lookup cfgdat "setup" "dbdir") (conc (configf:lookup cfgdat "setup" "linktree") "/.db"))) (fname (if run-id (case run-id ((-1) "monitor.db") ((0) "main.db") (else (conc run-id ".db"))) #f))) (handle-exceptions exn (begin (debug:print 0 "ERROR: Couldn't create path to " dbdir) (exit 1)) (if (not (directory? dbdir))(create-directory dbdir #t))) (if fname (conc dbdir "/" fname) dbdir))) ;; -1 => monitor.db ;; 0 => main.db ;; >1 => <run-id>.db ;; (define (areadb:open areadat run-id) (let* ((runs (areadat-runs areadat)) (rundat (if (> run-id 0) ;; it is a run (hash-table-ref/default runs run-id #f) #f)) (db (case run-id ;; if already opened, get the db and return it ((-1) (areadat-monitordb areadat)) ((0) (areadat-maindb areadat)) (else (if rundat (rundat-db rundat) #f))))) (if db db ;; merely return the already opened db (let* ((dbfile (areadb:dbfile-path areadat run-id)) ;; not already opened, so open it (db (if (file-exists? dbfile) (open-database dbfile) (begin (debug:print 0 "ERROR: I was asked to open " dbfile ", but file does not exist or is not readable.") #f)))) (case run-id ((-1)(areadat-monitordb-set! areadat db)) ((0) (areadat-maindb-set! areadat db)) (else (rundat-db-set! rundat db))) db)))) ;; populate the areadat tests info, does NOT fill the tests data itself unless asked ;; (define (areadb:populate-run-info areadat) (let* ((runs (or (areadat-runs areadat) (make-hash-table))) (keys (areadat-run-keys areadat)) (maindb (areadb:open areadat 0))) (query (for-each-row (lambda (row) (let ((id (list-ref row 0)) (dat (apply make-rundat (append row (list #f #f))))) ;; add placeholders for tests and db (print row) (hash-table-set! runs id dat)))) (sql maindb (conc "SELECT id," (string-intersperse keys "||'/'||") ",runname,state,status,event_time FROM runs WHERE state != 'deleted';"))) areadat)) ;; given an areadat and target/runname patt fill up runs data ;; ;; ?????/ ;; given a list of run-ids refresh/retrieve runs data into areadat ;; (define (areadb:fill-tests areadat #!key (run-ids #f)) (let* ((runs (or (areadat-runs areadat) (make-hash-table)))) (for-each (lambda (run-id) (let* ((rundat (hash-table-ref/default runs run-id #f)) (tests (if (and rundat (rundat-tests rundat)) ;; re-use existing hash table? (rundat-tests rundat) (let ((ht (make-hash-table))) (rundat-tests-set! rundat ht) ht))) (rundb (areadb:open areadat run-id))) (query (for-each-row (lambda (row) (let* ((id (list-ref row 0)) (testname (list-ref row 1)) (itempath (list-ref row 2)) (state (list-ref row 3)) (status (list-ref row 4)) (eventtim (list-ref row 5)) (duration (list-ref row 6))) (hash-table-set! tests id (make-testdat run-id id testname itempath state status eventtim duration))))) (sql rundb "SELECT id,testname,item_path,state,status,event_time,run_duration FROM tests WHERE state != 'DELETED';")))) (or run-ids (hash-table-keys runs))) areadat)) ;; initialize and refresh data ;; (define (dboard:general-updater con port) (for-each (lambda (window-id) ;; (print "Processing for window-id " window-id) (let* ((window-dat (hash-table-ref *windows* window-id)) (areas (data-areas window-dat)) ;; (keys (areadat-run-keys area-dat)) (tabs (data-tabs window-dat)) (tab-ids (hash-table-keys tabs)) (current-tab (if (null? tab-ids) #f (hash-table-ref tabs (car tab-ids)))) (current-tree (if (null? tab-ids) #f (tab-tree current-tab))) (current-node (if (null? tab-ids) 0 (string->number (iup:attribute current-tree "VALUE")))) (current-path (if (eq? current-node 0) "Areas" (string-intersperse (tree:node->path current-tree current-node) "/"))) (current-matrix (if (null? tab-ids) #f (tab-matrix current-tab))) (seen-nodes (make-hash-table)) (path-changed (if current-tab (equal? current-path (tab-view-path current-tab)) #t))) ;; (debug:print-info 0 "Current path: " current-path) ;; now for each area in the window gather the data (if path-changed (begin (debug:print-info 0 "clearing matrix - path changed") (dboard:clear-matrix current-tab))) (for-each (lambda (area-name) ;; (print "Processing for area-name " area-name) (let* ((area-dat (hash-table-ref areas area-name)) (area-path (areadat-path area-dat)) (runs (areadat-runs area-dat))) (if (hash-table-ref/default *changed-main* area-path 'processed) (begin (print "Processing " area-dat " for area-name " area-name) (hash-table-set! *changed-main* area-path #f) (areadb:populate-run-info area-dat) (for-each (lambda (run-id) (let* ((run (hash-table-ref runs run-id)) (target (rundat-target run)) (runname (rundat-runname run))) (if current-tree (let* ((partial-path (append (string-split target "/")(list runname))) (full-path (cons area-name partial-path))) (if (not (hash-table-exists? seen-nodes full-path)) (begin (print "INFO: Adding node " partial-path " to section " area-name) (tree:add-node current-tree "Areas" full-path) (areadb:fill-tests area-dat run-ids: (list run-id)))) (hash-table-set! seen-nodes full-path #t))))) (hash-table-keys runs)))) (if (or (equal? "Areas" current-path) (string-match (conc "^Areas/" area-name "(|\\/.*)$") current-path)) (dboard:redraw-area area-name area-dat current-tab current-matrix current-path)))) (hash-table-keys areas)))) (hash-table-keys *windows*))) ;;====================================================================== ;; D A S H B O A R D D B ;;====================================================================== ;; All moved to common.scm ;;====================================================================== ;; T R E E ;;====================================================================== ;; <area> - <target - ... > - <runname> - <test> - <itempath - ...> (define (dashboard:tree-browser data adat window-id) ;; (iup:split (let* ((tb (iup:treebox #:value 0 #:title "Areas" #:expand "YES" #:addexpanded "NO" #:selection-cb (lambda (obj id state) ;; (print "obj: " obj ", id: " id ", state: " state) (let* ((tree-path (tree:node->path obj id)) (area (car tree-path)) (areadat-path (cdr tree-path))) #f ;; (test-id (tree-path->test-id (cdr run-path)))) ;; (if test-id ;; (hash-table-set! (dboard:data-get-curr-test-ids *data*) ;; window-id test-id)) ;; (print "path: " (tree:node->path obj id) " test-id: " test-id)))))) ))))) ;; (iup:attribute-set! tb "VALUE" "0") ;; (iup:attribute-set! tb "NAME" "Runs") ;; (iup:attribute-set! tb "ADDEXPANDED" "NO") ;; (dboard:data-set-tests-tree! *data* tb) tb)) ;;====================================================================== ;; M A I N M A T R I X ;;====================================================================== ;; General displayer ;; (define (dashboard:main-matrix data adat window-id) (let* (;; (tab-dat (areadat- (view-matrix (iup:matrix ;; (runs-for-targ (db:get-runs-by-patt *dbstruct-local* *keys* "%" target #f #f #f)) #:expand "YES" ;; #:fittosize "YES" #:resizematrix "YES" #:scrollbar "YES" #:numcol 100 #:numlin 100 #:numcol-visible 3 #:numlin-visible 20 #:click-cb (lambda (obj lin col status) (print "obj: " obj " lin: " lin " col: " col " status: " status " value: " (iup:attribute obj "VALUE")))))) ;; (iup:attribute-set! view-matrix "RESIZEMATRIX" "YES") (iup:attribute-set! view-matrix "WIDTH0" "100") ;; (dboard:data-set-runs-matrix! *data* runs-matrix) ;; (iup:hbox ;; (iup:frame ;; #:title "Runs browser" ;; (iup:vbox view-matrix)) ;;====================================================================== ;; A R E A S ;;====================================================================== (define (dashboard:init-area data area-name apath) (let* ((mtconf (dboard:read-mtconf apath)) (area-dat (let ((ad (make-areadat area-name ;; area name apath ;; path to area ;; 'http ;; transport mtconf ;; megatest.config (make-hash-table) ;; denoise hash #f ;; client-signature #f ;; remote connections (keys:config-get-fields mtconf) ;; run keys (make-hash-table) ;; run-id -> (hash of test-ids => dat) (and (file-exists? apath)(file-write-access? apath)) ;; read-only #f #f ))) (hash-table-set! (data-areas data) area-name ad) ad))) area-dat)) ;; given the keys for an area and a path from the tree browser ;; return the level: areas area runs run tests test ;; (define (dboard:get-view-type keys current-path) (let* ((path-parts (string-split current-path "/")) (path-len (length path-parts))) (cond ((equal? current-path "Areas") 'areas) ((eq? path-len 2) 'area) ((<= (+ (length keys) 2) path-len) 'runs) (else 'run)))) (define (dboard:clear-matrix tab) (if tab (begin (iup:attribute-set! (tab-matrix tab) "CLEARVALUE" "ALL") (tab-headers-set! tab (make-hash-table)) (tab-rows-set! tab (make-hash-table))))) ;; full redraw of a given area ;; (define (dboard:redraw-area area-name area-dat tab-dat current-matrix current-path) (let* ((keys (areadat-run-keys area-dat)) (runs (areadat-runs area-dat)) (headers (tab-headers tab-dat)) (rows (tab-rows tab-dat)) (used-cols (hash-table-values headers)) (used-rows (hash-table-values rows)) (touched (make-hash-table)) ;; (vector row col) ==> true, touched cell (view-type (dboard:get-view-type keys current-path)) (changed #f) (state-statuses (list "PASS" "FAIL" "WARN" "CHECK" "SKIP" "RUNNING" "LAUNCHED"))) (debug:print 0 "current-matrix=" current-matrix) (case view-type ((areas) ;; find row for this area, if not found, create new entry (let* ((curr-rownum (hash-table-ref/default rows area-name #f)) (next-rownum (+ (apply max (cons 0 used-rows)) 1)) (rownum (or curr-rownum next-rownum)) (coord (conc rownum ":0"))) (if (not curr-rownum)(hash-table-set! rows area-name rownum)) (if (not (equal? (iup:attribute current-matrix coord) area-name)) (begin (let loop ((hed (car state-statuses)) (tal (cdr state-statuses)) (count 1)) (if (not (equal? (iup:attribute current-matrix (conc "0:" count)) hed)) (iup:attribute-set! current-matrix (conc "0:" count) hed)) (iup:attribute-set! current-matrix (conc rownum ":" count) "0") (if (not (null? tal)) (loop (car tal)(cdr tal)(+ count 1)))) (debug:print-info 0 "view-type=" view-type ", rownum=" rownum ", curr-rownum=" curr-rownum ", next-rownum=" next-rownum ", coord=" coord ", area-name=" area-name) (iup:attribute-set! current-matrix coord area-name) (set! changed #t)))))) (if changed (iup:attribute-set! current-matrix "REDRAW" "ALL")))) ;; (dboard:clear-matrix current-matrix used-cols used-rows touched) ;; clear all ;;====================================================================== ;; D A S H B O A R D ;;====================================================================== (define (dashboard:area-panel aname data window-id) (let* ((apath (configf:lookup (data-cfgdat data) aname "path")) ;; (hash-table-ref (dboard:data-cfgdat data) area-name)) ;; (hash-table-ref (dboard:data-cfgdat data) aname)) (area-dat (dashboard:init-area data aname apath)) (tb (dashboard:tree-browser data area-dat window-id)) ;; (dboard:areas-tree-browser data) (ad (dashboard:main-matrix data area-dat window-id)) (areas (data-areas data)) (dboard-dat (make-tab #f ;; tree #f ;; matrix area-dat ;; #f ;; view path 'default ;; view type #f ;; controls (make-hash-table) ;; cached data? not sure how to use this yet :) #f ;; filters #f ;; the run-id (make-hash-table) ;; run-id -> test-id, for current test id "" (make-hash-table) ;; headername -> colnum (make-hash-table) ;; rowname -> rownum ))) (hash-table-set! (data-areas data) aname area-dat) ;; dboard-dat) (hash-table-set! (data-tabs data) window-id dboard-dat) (tab-tree-set! dboard-dat tb) (tab-matrix-set! dboard-dat ad) (iup:split #:value 200 tb ad))) ;; Main Panel ;; (define (dashboard:main-panel data window-id) (iup:dialog #:title "Megatest Control Panel" ;; #:menu (dcommon:main-menu data) #:shrink "YES" (iup:vbox (let* ((area-names (hash-table-keys (data-cfgdat data))) (area-panels (map (lambda (aname) (dashboard:area-panel aname data window-id)) area-names)) (tabtop (apply iup:tabs #:tabchangepos-cb (lambda (obj curr prev) (data-current-tab-id-set! data curr) (data-update-needed-set! data #t) (print "Tab is: " curr ", prev was " prev)) area-panels)) (tabs (data-tabs data))) (if (not (null? area-names)) (let loop ((index 0) (hed (car area-names)) (tal (cdr area-names))) ;; (hash-table-set! tabs index hed) (debug:print 0 "Adding area " hed " with index " index " to dashboard") (iup:attribute-set! tabtop (conc "TABTITLE" index) hed) (if (not (null? tal)) (loop (+ index 1)(car tal)(cdr tal))))) tabtop)))) ;;====================================================================== ;; N A N O M S G S E R V E R ;;====================================================================== (define (dboard:server-service soc port) (print "server starting") (let loop ((msg-in (nn-recv soc)) (count 0)) (if (eq? 0 (modulo count 1000)) (print "server received: " msg-in ", count=" count)) (cond ;; ;; quit ;; ((equal? msg-in "quit") (nn-send soc "Ok, quitting")) ;; ;; ping ;; ((and (>= (string-length msg-in) 4) (equal? (substring msg-in 0 4) "ping")) (nn-send soc (conc (current-process-id))) (loop (nn-recv soc)(+ count 1))) ;; ;; main changed ;; ((and (>= (string-length msg-in) 4) (equal? (substring msg-in 0 4) "main")) (let ((parts (string-split msg-in " "))) (hash-table-set! *changed-main* (cadr parts) #t) (nn-send soc "got it!"))) ;; ;; ?? ;; (else (nn-send soc "hello " msg-in " you got to the else clause!"))) (loop (nn-recv soc)(if (> count 20000000) 0 (+ count 1))))) (define (dboard:one-time-ping-receive soc port) (let ((msg-in (nn-recv soc))) (if (and (>= (string-length msg-in) 4) (equal? (substring msg-in 0 4) "ping")) (nn-send soc (conc (current-process-id)))))) (define (dboard:server-start given-port #!key (num-tries 200)) (let* ((rep (nn-socket 'rep)) (port (or given-port (portlogger:main "find"))) (con (conc "tcp://*:" port))) ;; register this connect here .... (nn-bind rep con) (thread-start! (make-thread (lambda () (dboard:one-time-ping-receive rep port)) "one time receive thread")) (if (dboard:ping-self "localhost" port) (begin (print "INFO: dashboard nanomsg server started on " port) (values rep port)) (begin (print "WARNING: couldn't create server on port " port) (portlogger:main "set" "failed") (if (> num-tries 0) (dboard:server-start #f (- num-tries 1)) (begin (print "ERROR: failed to start nanomsg server") (values #f #f))))))) (define (dboard:server-close con port) (nn-close con) (portlogger:main "set" port "released")) (define (dboard:ping-self host port #!key (return-socket #t)) ;; send a random number along with pid and check that we get it back (let* ((req (nn-socket 'req)) (key "ping") (success #f) (keepwaiting #t) (ping (make-thread (lambda () (print "ping: sending string \"" key "\", expecting " (current-process-id)) (nn-send req key) (let ((result (nn-recv req))) (if (equal? (conc (current-process-id)) result) (begin (print "ping, success: received \"" result "\"") (set! success #t)) (begin (print "ping, failed: received key \"" result "\"") (set! keepwaiting #f) (set! success #f))))) "ping")) (timeout (make-thread (lambda () (let loop ((count 0)) (thread-sleep! 1) (print "still waiting after " count " seconds...") (if (and keepwaiting (< count 10)) (loop (+ count 1)))) (if keepwaiting (begin (print "timeout waiting for ping") (thread-terminate! ping)))) "timeout"))) (nn-connect req (conc "tcp://" host ":" port)) (handle-exceptions exn (begin (print-call-chain) (print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) (print "exn=" (condition->list exn)) (print "ping failed to connect to " host ":" port)) (thread-start! timeout) (thread-start! ping) (thread-join! ping) (if success (thread-terminate! timeout))) (if return-socket (if success req #f) (begin (nn-close req) success)))) ;;====================================================================== ;; C O N F I G U R A T I O N ;;====================================================================== ;; Get the configuration file for a group name, if the group name is "default" and it doesn't ;; exist, create it and add the current path if it contains megatest.config ;; (define (dboard:get-config group-name) (let* ((fname (conc (getenv "HOME") "/.megatest/" group-name ".dat"))) (if (file-exists? fname) (read-config fname (make-hash-table) #t) (if (dboard:create-config fname) (dboard:get-config group-name) (make-hash-table))))) (define (dboard:create-config fname) ;; (handle-exceptions ;; exn ;; ;; #f ;; failed to create - just give up (let* ((dirname (pathname-directory fname)) (file-name (pathname-strip-directory fname)) (curr-mtcfgdat (find-config "megatest.config" toppath: (or (get-environment-variable "MT_RUN_AREA_HOME")(current-directory)))) (curr-mtcfg (if (and curr-mtcfgdat (not (null? curr-mtcfgdat)))(cadr curr-mtcfgdat) #f)) (curr-mtpath (if curr-mtcfg (car curr-mtcfgdat) #f))) (if curr-mtpath (begin (debug:print-info 0 "Creating config file " fname) (if (not (file-exists? dirname)) (create-directory dirname #t)) (with-output-to-file fname (lambda () (let ((aname (pathname-strip-directory curr-mtpath))) (print "[" aname "]") (print "path " curr-mtpath)))) #t) (begin (debug:print-info 0 "Need to create a config but no megatest.config found: " curr-mtcfgdat) #f)))) ;; ) (define (dboard:read-mtconf apath) (let* ((mtconffile (conc apath "/megatest.config"))) (call-with-environment-variables (list (cons "MT_RUN_AREA_HOME" apath)) (lambda () (read-config mtconffile (make-hash-table) #f)) ;; megatest.config ))) ;;====================================================================== ;; G U I S T U F F ;;====================================================================== ;;; main. Theoretically could have multiple windows (each with a group of tags, thus window-id ;;; (define (dboard:make-window window-id) (let* (;; (window-id 0) (groupn (or (args:get-arg "-group") "default")) (cfgdat (dboard:get-config groupn)) ;; (cfgdat (if (file-exists? cfname)(read-config cfname (make-hash-table) #t)(make-hash-table))) (data (make-data cfgdat ;; this is the data from ~/.megatest for the selected group (make-hash-table) ;; areaname -> area-rec 0 ;; current window id 0 ;; current tab id #f ;; redraw needed for current tab id (make-hash-table) ;; tab-id -> areaname ))) (hash-table-set! *windows* window-id data) (iup:show (dashboard:main-panel data window-id)) (iup:main-loop))) ;; ease debugging by loading ~/.dashboardrc (let ((debugcontrolf (conc (get-environment-variable "HOME") "/.dashboardrc"))) (if (file-exists? debugcontrolf) (load debugcontrolf))) (let-values (((con port)(dboard:server-start #f))) (let ((portnum (if (string? port)(string->number port) port))) ;; got here, monitor/dashboard was started (mddb:register-dashboard portnum) (thread-start! (make-thread (lambda ()(dboard:server-service con portnum)) "server service")) (thread-start! (make-thread (lambda () (let loop () (dboard:general-updater con portnum) (thread-sleep! 1) (loop))) "general updater")) (dboard:make-window 0) (mddb:unregister-dashboard (get-host-name) portnum) (dboard:server-close con port))) |
Modified portlogger.scm from [c19f5a6299] to [f3f2be6883].
158 159 160 161 162 163 164 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + - - - - - - - - - + + + + + + + + + + + | (handle-exceptions exn (begin (debug:print 0 "EXCEPTION: portlogger database at " dbfname " probably overloaded or unreadable. Try removing it.") (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn)) (print "exn=" (condition->list exn)) (debug:print 0 " status: " ((condition-property-accessor 'sqlite3 'status) exn)) |
Modified rmt.scm from [9a3ff4c76e] to [0f735396a5].
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | (declare (uses nmsg-transport)) ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; ;; For debugging add the following to ~/.megatestrc |
154 155 156 157 158 159 160 | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | + + + + + + - - - + + + + + + | (hash-table-delete! *runremote* run-id) ;; (mutex-unlock! *send-receive-mutex*) (if (and faststart (equal? faststart "no")) (begin (tasks:start-and-wait-for-server (db:delay-if-busy (tasks:open-db)) run-id 10) (thread-sleep! (random 5)) ;; give some time to settle and minimize collison? (rmt:send-receive cmd rid params attemptnum: (+ attemptnum 1))) (let ((start-time (current-milliseconds)) (max-query (string->number (or (configf:lookup *configdat* "server" "server-query-threshold") "300"))) (newres (rmt:open-qry-close-locally cmd run-id params))) (let ((delta (- (current-milliseconds) start-time))) (if (> delta max-query) |
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | + + + + + + + + + + | ;; (define (rmt:get-key-val-pairs run-id) (rmt:send-receive 'get-key-val-pairs run-id (list run-id))) (define (rmt:get-keys) (rmt:send-receive 'get-keys #f '())) (define (rmt:get-key-vals run-id) (rmt:send-receive 'get-key-vals #f (list run-id))) (define (rmt:get-targets) (rmt:send-receive 'get-targets #f '())) ;;====================================================================== ;; T E S T S ;;====================================================================== ;; Just some syntatic sugar (define (rmt:register-test run-id test-name item-path) (rmt:general-call 'register-test run-id run-id test-name item-path)) (define (rmt:get-test-id run-id testname item-path) (rmt:send-receive 'get-test-id run-id (list run-id testname item-path))) (define (rmt:get-test-info-by-id run-id test-id) (if (and (number? run-id)(number? test-id)) (rmt:send-receive 'get-test-info-by-id run-id (list run-id test-id)) (begin |
483 484 485 486 487 488 489 | 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | - - + + + + - - + + - + + + + | (map (lambda (run-id) (rmt:send-receive 'test-get-paths-matching-keynames-target-new run-id (list run-id keynames target res testpatt statepatt statuspatt runname))) run-ids)))) (define (rmt:get-run-ids-matching keynames target res) (rmt:send-receive #f 'get-run-ids-matching (list keynames target res))) |
551 552 553 554 555 556 557 | 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | - - + + | (define (rmt:set-run-status run-id run-status #!key (msg #f)) (rmt:send-receive 'set-run-status #f (list run-id run-status msg))) (define (rmt:update-run-event_time run-id) (rmt:send-receive 'update-run-event_time #f (list run-id))) |
Modified runs.scm from [e4e58cdff9] to [d899deed31].
220 221 222 223 224 225 226 | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - + + + + - + | (test-names #f) ;; (tests:filter-test-names all-test-names test-patts)) (required-tests #f) ;;(lset-intersection equal? (string-split test-patts ",") test-names))) ;; test-names)) ;; Added test-names as initial for required-tests but that failed to work (task-key (conc (hash-table->alist flags) " " (get-host-name) " " (current-process-id))) (tdbdat (tasks:open-db))) (if (tasks:need-server run-id)(tasks:start-and-wait-for-server tdbdat run-id 10)) |
457 458 459 460 461 462 463 | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - + | '() reg))) (define runs:nothing-left-in-queue-count 0) (define (runs:expand-items hed tal reg reruns regfull newtal jobgroup max-concurrent-jobs run-id waitons item-path testmode test-record can-run-more items runname tconfig reglen test-registry test-records itemmap) (let* ((loop-list (list hed tal reg reruns)) |
542 543 544 545 546 547 548 | 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | - + | ;; (not (member x allinqueue))) ;; prereqstrs)) (give-up #f)) ;; We can get here when a prereq has not been run due to *it* having a prereq that failed. ;; We need to use this to dequeue this item as CANNOTRUN ;; |
645 646 647 648 649 650 651 | 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | - + + + - + - + + + + + | (define (runs:process-expanded-tests hed tal reg reruns reglen regfull test-record runname test-name item-path jobgroup max-concurrent-jobs run-id waitons item-path testmode test-patts required-tests test-registry registry-mutex flags keyvals run-info newtal all-tests-registry itemmap) (let* ((run-limits-info (runs:can-run-more-tests run-id jobgroup max-concurrent-jobs)) ;; look at the test jobgroup and tot jobs running (have-resources (car run-limits-info)) (num-running (list-ref run-limits-info 1)) (num-running-in-jobgroup (list-ref run-limits-info 2)) (max-concurrent-jobs (list-ref run-limits-info 3)) (job-group-limit (list-ref run-limits-info 4)) |
691 692 693 694 695 696 697 | 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 | - + - + | ;; Register tests ;; ((not (hash-table-ref/default test-registry (db:test-make-full-name test-name item-path) #f)) (debug:print-info 4 "Pre-registering test " test-name "/" item-path " to create placeholder" ) ;; always do firm registration now in v1.60 and greater ;; (eq? *transport-type* 'fs) ;; no point in parallel registration if use fs (let register-loop ((numtries 15)) |
744 745 746 747 748 749 750 | 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | - + | ;; could have done hed tal here but doing car/cdr of newtal to rotate tests (list (car newtal)(cdr newtal) reg reruns)) ;; This is the final stage, everything is in place so launch the test ;; ((and have-resources (or (null? prereqs-not-met) |
777 778 779 780 781 782 783 | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | - + + | ;; a message and drop hed from the items to be processed. ;; (runs:mixed-list-testname-and-testrec->list-of-strings prereqs-not-met) (if (and (not (null? prereqs-not-met)) (runs:lownoise (conc "waiting on tests " prereqs-not-met hed) 60)) (debug:print-info 1 "waiting on tests; " (string-intersperse (runs:mixed-list-testname-and-testrec->list-of-strings prereqs-not-met) ", "))) |
849 850 851 852 853 854 855 | 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 | + - + | reruns)))) (else (if (runs:lownoise (conc "FAILED prerequitests and we tried" hed) 60) (debug:print 0 "WARNING: test " hed " has FAILED prerequitests and we've tried at least 10 times to run it. Giving up now.")) ;; (debug:print 0 " prereqs: " prereqs-not-met) (hash-table-set! test-registry hed 'removed) (mt:test-set-state-status-by-testname run-id test-name item-path "NOT_STARTED" "TEN_STRIKES" #f) ;; I'm unclear on if this roll up is needed - it may be the root cause of the "all set to FAIL" bug. |
871 872 873 874 875 876 877 | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | - + | (define (runs:runable-tests tests) (filter (lambda (t) (if (not (vector? t)) t (let ((state (db:test-get-state t)) (status (db:test-get-status t))) (case (string->symbol state) |
973 974 975 976 977 978 979 | 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | - + | (hash-table-set! *max-tries-hash* tfullname (+ (hash-table-ref/default *max-tries-hash* tfullname 0) 1))) ;; (debug:print 0 "max-tries-hash: " (hash-table->alist *max-tries-hash*)) ;; Ensure all top level tests get registered. This way they show up as "NOT_STARTED" on the dashboard ;; and it is clear they *should* have run but did not. (if (not (hash-table-ref/default test-registry (db:test-make-full-name test-name "") #f)) (begin |
1150 1151 1152 1153 1154 1155 1156 | 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 | - + - + - - - - - - + + + + + + | ;; LET* ((test-record ;; we get here on "drop through". All done! (debug:print-info 1 "All tests launched"))) (define (runs:calc-fails prereqs-not-met) (filter (lambda (test) (and (vector? test) ;; not (string? test)) |
1255 1256 1257 1258 1259 1260 1261 | 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 | - + | ;; ;; NB// for the above line. I want the test to be registered long before this routine gets called! ;; (if (not test-id)(set! test-id (rmt:get-test-id run-id test-name item-path))) (if (not test-id) (begin (debug:print 2 "WARN: Test not pre-created? test-name=" test-name ", item-path=" item-path ", run-id=" run-id) |
1279 1280 1281 1282 1283 1284 1285 | 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | - + - + | (case (if force ;; (args:get-arg "-force") 'NOT_STARTED (if testdat (string->symbol (test:get-state testdat)) 'failed-to-insert)) ((failed-to-insert) (debug:print 0 "ERROR: Failed to insert the record into the db")) |
1343 1344 1345 1346 1347 1348 1349 | 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 | - + | (set! skip-test (conc "Skipping due to existance of file " (configf:lookup test-conf "skip" "fileexists"))))) ((and skip-check (configf:lookup test-conf "skip" "rundelay")) ;; run-ids = #f means *all* runs (let* ((numseconds (common:hms-string->seconds (configf:lookup test-conf "skip" "rundelay"))) (running-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("RUNNING" "REMOTEHOSTSTART" "LAUNCHED") '() #f)) |
Modified tasks.scm from [a2f9968b1b] to [7cea7f81b2].
495 496 497 498 499 500 501 | 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | - + - - + + | (lambda (id pid host last-update delta) (print "Going to delete stale record for monitor with pid " pid " on host " host " last updated " delta " seconds ago") (set! deadlist (cons id deadlist))) mdb "SELECT id,pid,hostname,last_update,strftime('%s','now')-last_update AS delta FROM monitors WHERE delta > 700;") (sqlite3:execute mdb (conc "DELETE FROM monitors WHERE id IN ('" (string-intersperse (map conc deadlist) "','") "');"))) ) |
Modified tdb.scm from [6d49ce2a57] to [9506a565ad].
38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + + + + | ;;====================================================================== ;;====================================================================== ;; T E S T S P E C I F I C D B ;;====================================================================== ;; Create the sqlite db for the individual test(s) ;; ;; Moved these tables into <runid>.db ;; THIS CODE TO BE REMOVED ;; (define (open-test-db work-area) (debug:print-info 11 "open-test-db " work-area) (if (and work-area (directory? work-area) (file-read-access? work-area)) (let* ((dbpath (conc work-area "/testdat.db")) (dbexists (file-exists? dbpath)) |
167 168 169 170 171 172 173 174 175 176 177 178 179 180 | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | + + | id INTEGER PRIMARY KEY, var TEXT, val TEXT, ackstate INTEGER DEFAULT 0, CONSTRAINT metadat_constraint UNIQUE (var));")))) (debug:print 11 "db:testdb-initialize END")) ;; This routine moved to db:read-test-data ;; (define (tdb:read-test-data tdb test-id categorypatt) (let ((res '())) (sqlite3:for-each-row (lambda (id test_id category variable value expected tol units comment status type) (set! res (cons (vector id test_id category variable value expected tol units comment status type) res))) tdb "SELECT id,test_id,category,variable,value,expected,tol,units,comment,status,type FROM test_data WHERE test_id=? AND category LIKE ? ORDER BY category,variable;" test-id categorypatt) |
219 220 221 222 223 224 225 226 227 228 229 230 231 232 | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | + + | ;; S T E P S ;;====================================================================== (define (tdb:step-get-time-as-string vec) (seconds->time-string (tdb:step-get-event_time vec))) ;; get a pretty table to summarize steps ;; ;; NOT USED, WILL BE REMOVED ;; (define (tdb:get-steps-table steps);; organise the steps for better readability (let ((res (make-hash-table))) (for-each (lambda (step) (debug:print 6 "step=" step) (let ((record (hash-table-ref/default |
Modified testnanomsg/req-rep-client.scm from [7998d54555] to [62cc97e2a5].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + - + - - + + + | ;; watch nanomsg's pipeline load-balancer in action. |
Modified testnanomsg/req-rep-server.scm from [d9de6da037] to [7ffb9a9d45].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + - - + + + + - + - - + + + + - + | ;; watch nanomsg's pipeline load-balancer in action. |
Modified testnanomsg/req-rep.scm from [b77ebf1421] to [d17a548c7a].
Modified tests.scm from [1b02d35c8f] to [e113e6dd48].
30 31 32 33 34 35 36 37 38 39 40 41 42 | 30 31 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 | + + + + + + + + + - + | (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") ;; Call this one to do all the work and get a standardized list of tests ;; gets paths from configs and finds valid tests ;; returns hash of testname --> fullpath ;; (define (tests:get-all) (let* ((test-search-path (tests:get-tests-search-path *configdat*))) (tests:get-valid-tests (make-hash-table) test-search-path))) (define (tests:get-tests-search-path cfgdat) (let ((paths (map cadr (configf:get-section cfgdat "tests-paths")))) (filter (lambda (d) (if (directory-exists? d) d (begin (debug:print 0 "WARNING: problem with directory " d ", dropping it from tests path") #f))) |
137 138 139 140 141 142 143 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | - + | (define (tests:check-waiver-eligibility testdat prev-testdat) (let* ((test-registry (make-hash-table)) (testconfig (tests:get-testconfig (db:test-get-testname testdat) test-registry #f)) (test-rundir ;; (sdb:qry 'passstr (db:test-get-rundir testdat)) ;; ) (prev-rundir ;; (sdb:qry 'passstr (db:test-get-rundir prev-testdat)) ;; ) |
282 283 284 285 286 287 288 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | - + | type ))) ;; This was run remote, don't think that makes sense. Perhaps not, but that is the easiest path for the moment. (rmt:csv->test-data run-id test-id dat)))) ;; need to update the top test record if PASS or FAIL and this is a subtest (if (not (equal? item-path "")) |
318 319 320 321 322 323 324 | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - + + + + + - + | (if (or (equal? logf "logs/final.log") (equal? logf outputfilename) force) (let ((my-start-time (current-seconds)) (lockf (conc outputfilename ".lock"))) (let loop ((have-lock (common:simple-file-lock lockf))) (if have-lock |
581 582 583 584 585 586 587 588 589 590 591 592 593 594 | 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | + | ;; (set! tests (filter (lambda (test)(file-exists? (conc test "/testconfig"))) tests)) ;; (delete-duplicates ;; (filter (lambda (testname) ;; (tests:match test-patts testname #f)) ;; (map (lambda (testp) ;; (last (string-split testp "/"))) ;; tests))))) (define (tests:get-testconfig test-name test-registry system-allowed) (let* ((test-path (hash-table-ref/default test-registry test-name (conc *toppath* "/tests/" test-name))) (test-configf (conc test-path "/testconfig")) (testexists (and (file-exists? test-configf)(file-read-access? test-configf))) (tcfg (if testexists (read-config test-configf #f system-allowed environ-patt: (if system-allowed |
668 669 670 671 672 673 674 | 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | - + | ;; from the runnable list (if keep-test (for-each (lambda (waiton) ;; for now we are waiting only on the parent test (let* ((parent-test-id (rmt:get-test-id run-id waiton "")) (wtdat (rmt:get-testinfo-state-status run-id test-id))) ;; (cdb:get-test-info-by-id *runremote* test-id))) (if (or (and (equal? (db:test-get-state wtdat) "COMPLETED") |
Modified tests/Makefile from [58d615ee76] to [0ec8867fd3].
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + - - + + + + + + + + + + + - - - | FS = $(shell df -T .|tail -1|awk '{print $$2}') VER = $(shell fsl info|grep checkout|awk '{print $$2}'|cut -c 1-5) # The NEWTARGET causes some tests to fail. Do not use until this is fixed. NEWTARGET = "$(OS)/$(FS)/$(VER)" TARGET = "ubuntu/nfs/none" |
147 148 149 150 151 152 153 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | - + + + + + + + + - + - + + + | for dpath in none tmp; do \ (cd fullrun;$(MEGATEST) -preclean -runtests priority_10_waiton_1 -target $$sys/$$fs/$$dpath :runname $(RUNNAME) &);\ done;done;done test11 : cd fullrun;time (for a in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 ;do (megatest -test-paths -target %/%/% > /dev/null ) & done; wait; ) |
Modified tests/fdktestqa/fdk.config from [2f7079bd4e] to [1449c69529].
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 | - - + + - + | # force server server-query-threshold 0 [jobtools] # launcher nbq -P ch_vp -C SLES11_EM64T_4G -Q /ciaf/fdk |
Modified tests/fdktestqa/testqa/Makefile from [d3de829000] to [2d20ab8370].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + - + - + - + + | BINDIR = $(PWD)/../../../bin PATH := $(BINDIR):$(PATH) MEGATEST = $(BINDIR)/megatest DASHBOARD = $(BINDIR)/dashboard NEWDASHBOARD = $(BINDIR)/newdashboard RUNNAME = a |
Modified tests/fullrun/megatest.config from [41cde5b503] to [9182ed7cc3].
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - - + + + + | # turn off faststart, put monitor.db in MT_RUN_AREA_HOME/db # and set the dbdir to /var/tmp/$USER/mt_db to enable keeping # the raw db in /var/tmp/$USER # faststart no monitordir #{getenv MT_RUN_AREA_HOME}/db |
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | + + + + + + + + | state start end 0 1 - 2 status pass fail n/a 0 1 running - 2 # These are set before all tests, override them # in the testconfig [pre-launch-env-overrides] section [env-override] ALL_TOPLEVEL_TESTS exit_0 exit_1 ez_exit2_fail ez_fail ez_pass ezlog_fail \ ezlog_fail_then_pass ezlog_pass ezlog_warn lineitem_fail lineitem_pass logpro_required_fail \ manual_example neverrun priority_1 priority_10 priority_10_waiton_1 \ priority_3 priority_4 priority_5 priority_6 priority_7 priority_8 \ priority_9 runfirst singletest singletest2 sqlitespeed test_mt_vars \ ez_fail_quick test1 test2 # This variable is honored by the loadrunner script. The value is in percent MAX_ALLOWED_LOAD 200 # MT_XTERM_CMD overrides the terminal command # MT_XTERM_CMD xterm -bg lightgreen -fg black SPECIAL_ENV_VARS overide them here - should be seen at launch and in the runs |
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | + + + + - + - + | MYRUNNAME2 /this/is/[system echo $MT_RUNNAME]/my/runname # XTERM [system xterm] # RUNDEAD [system exit 56] [server] # force use of server always required yes # Use http instead of direct filesystem access transport http # transport fs # transport nmsg synchronous 0 # If the server can't be started on this port it will try the next port until # it succeeds port 9080 # This server will keep running this number of hours after last access. # Three minutes is 0.05 hours # timeout 0.025 timeout 0.061 # faststart; unless no, start server but proceed with writes until server started faststart no |
213 214 215 216 217 218 219 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | - - - - + + + + + + + + + + + + + + + + + | # <testsuite>/<creationdate> # Within the archive the data is structured like this: # <target>/<runname>/<test>/ disk0 /tmp/#{getenv USER}/adisk1 # Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) [jobtools] |
Modified tests/fullrun/tests/all_toplevel/calcresults.logpro from [dfb57c6b97] to [7bd9c74d1a].
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + - + | ("ez_pass" 1 20) ("lineitem_pass" 1 20) ("priority_1" 1 20) ("priority_10" 1 20) ("priority_10_waiton_1" 1 20) ("priority_3" 1 20) ("priority_4" 1 20) |
38 39 40 41 42 43 44 45 46 47 48 | 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 | + - + + + - + + + + + | ("ezlog_fail" 1 20) ("lineitem_fail" 1 20) ("logpro_required_fail" 1 20) ("manual_example" 1 20) ("neverrun" 1 20))) (define warn-specs '(("ezlog_warn" 1 20))) (define nost-specs '(("wait_no_items1" 1 20) ("wait_no_items2" 1 20) ("wait_no_items3" 1 20) ("wait_no_items4" 1 20) |
79 80 81 82 83 84 85 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - + | (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) |
Modified tests/fullrun/tests/all_toplevel/testconfig from [4c397d46e3] to [deabaf2573].
1 2 3 4 | 1 2 3 4 5 6 7 8 | - + - - - - - | [ezsteps] calcresults megatest -list-runs $MT_RUNNAME -target $MT_TARGET [requirements] |
Added tests/fullrun/tests/db_sync/calcresults.logpro version [2b1b84e89b].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/fullrun/tests/db_sync/dbdelta.scm version [5e038e3a3e].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (use sql-de-lite) (define megatest.db (conc (get-environment-variable "MT_RUN_AREA_HOME") "/megatest.db")) (define runsquery "sysname||'/'||fsname||'/'||datapath||'/'||runname||'/'||runs.state||'-'||runs.status") (define bigquery (conc "SELECT " runsquery "||testname||'/'||item_path||'-'||'-'||tests.state||'-'||tests.status||'-'||runs.id AS outdat FROM runs INNER JOIN tests ON runs.id=tests.run_id WHERE runs.state NOT LIKE 'deleted' AND tests.state NOT LIKE 'deleted' AND testname NOT LIKE 'db_sync' ORDER BY outdat ASC ;")) (print "Creating file for legacy db") (with-output-to-file "legacy-db-dump" (lambda () (let ((db (open-database megatest.db))) (query (for-each-row (lambda (res) (print res))) (sql db bigquery)) (close-database db)))) (define main.db (conc (get-environment-variable "MT_DBDIR") "/main.db")) (print "Creating file for current db") (with-output-to-file "current-db-dump" (lambda () (let* ((mdb (open-database main.db)) (run-ids (query fetch-column (sql mdb (conc "select id," runsquery " AS rq from runs ORDER BY rq ASC;")))) (dbdir (get-environment-variable "MT_DBDIR"))) (for-each (lambda (rid) (let ((dbfile (conc dbdir "/" rid ".db"))) (if (file-exists? dbfile) (begin (exec (sql mdb (conc "ATTACH DATABASE '" dbfile "' AS testsdb;"))) (query (for-each-row (lambda (res) (print res))) (sql mdb bigquery)) (exec (sql mdb "DETACH DATABASE testsdb;"))) (print "ERROR: No file " dbfile " found")))) run-ids) (close-database mdb)))) |
Added tests/fullrun/tests/db_sync/getdbdir.scm version [2bb1c2296a].
1 | + | (db:dbfile-path #f) |
Added tests/fullrun/tests/db_sync/showdiff.logpro version [95bed654bf].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) (expect:error in "LogFileBody" = 0 "Any diff is failure" #/.+/) |
Added tests/fullrun/tests/db_sync/testconfig version [f92575e768].
1 2 3 4 5 6 7 8 9 10 11 12 13 | + + + + + + + + + + + + + | [pre-launch-env-vars] MT_DBDIR #{scheme (db:dbfile-path #f)} [ezsteps] calcresults csi -b dbdelta.scm showdiff diff current-db-dump legacy-db-dump [requirements] waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run mode toplevel |
Modified tests/fullrun/tests/priority_1/testconfig from [737fc2258c] to [5fb118212f].
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 | + + + | jobgroup sqlite3 author matt owner bob description This test checks that a multi-lineitem test with mix of pass and non-fail rolls up a PASS tags first,single reviewed 09/10/2011, by Matt [triggers] COMPLETED/ echo $MT_TEST_NAME > $MT_RUN_AREA_HOME/foo |
Added tests/release/Makefile version [0d13fa9945].
1 2 3 4 5 6 7 8 9 10 | + + + + + + + + + + | dashboard : compile dashboard -rows 24 & compile : runs cd ../..;make -j install runs : mkdir -p runs |
Added tests/release/megatest.config version [0bf84b11be].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + + + + + + + + + + + + + + + + + + + + + + | [fields] release TEXT iteration TEXT [setup] linktree #{getenv MT_RUN_AREA_HOME}/links max_concurrent_jobs 100 logviewer (%MTCMD%) 2> /dev/null > /dev/null # htmlviewercmd firefox -new-window htmlviewercmd arora [jobtools] # launcher #{shell if which bsub > /dev/null;then echo bsub;else echo nbfake;fi} launcher nbfake maxload 2.5 [server] required yes [disks] disk0 #{getenv MT_RUN_AREA_HOME}/runs |
Added tests/release/runconfigs.config version [45021e9fc7].
1 2 3 4 5 6 7 8 9 | + + + + + + + + + | [default] MTRUNNER #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/../../utils/mtrunner} MTTESTDIR #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/..} MTPATH #{shell readlink -f #{getenv MT_RUN_AREA_HOME}/../../bin} [v1.60/15] [include atwork.config] |
Added tests/release/tests/fullrun/results.logpro version [7bd9c74d1a].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ("exit_0" 1 20) ("ezlog_fail_then_pass" 1 20) ("ezlog_pass" 1 20) ("ez_pass" 1 20) ("lineitem_pass" 1 20) ("priority_1" 1 20) ("priority_10" 1 20) ("priority_10_waiton_1" 1 20) ("priority_3" 1 20) ("priority_4" 1 20) ;; ("priority_5" 1 20) ("priority_6" 1 20) ;; ("priority_7" 1 20) ("priority_8" 1 20) ("priority_9" 1 20) ("runfirst" 7 20) ("singletest" 1 20) ("singletest2" 1 20) ("special" 1 20) ("sqlitespeed" 10 20) ("test1" 1 20) ("test2" 6 20) ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ("exit_1" 1 20) ("ez_exit2_fail" 1 20) ("ez_fail" 1 20) ("ez_fail_quick" 1 20) ("ezlog_fail" 1 20) ("lineitem_fail" 1 20) ("logpro_required_fail" 1 20) ("manual_example" 1 20) ("neverrun" 1 20))) (define warn-specs '(("ezlog_warn" 1 20))) (define nost-specs '(("wait_no_items1" 1 20) ("wait_no_items2" 1 20) ("wait_no_items3" 1 20) ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/fullrun/testconfig version [be4bd3c0d9].
1 2 3 4 5 6 7 8 9 10 11 | + + + + + + + + + + + | [ezsteps] cleantop $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -target ubuntu/nfs/none -runname release_toplevel -testpatt % runall $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt % -target ubuntu/nfs/none -runname release_toplevel -runwait runtop $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt all_toplevel -target ubuntu/nfs/none -runname release_toplevel -rerun FAIL -preclean -runwait results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_toplevel -target ubuntu/nfs/none -runname release_toplevel [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run # mode toplevel |
Added tests/release/tests/itemwait/testconfig version [c976040a3b].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + + + + + + + + + + + + + + + + + + + + + + + | # test2 from the tests/Makefile [var] tname itemwait [pre-launch-env-vars] NUMTESTS 20 [ezsteps] # Set things up clean $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -remove-runs -testpatt % -target %/% -runname #{get var tname}% runbigrun3 $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH nbfake megatest -run -testpatt bigrun3 -target a/bigrun3 -runname #{get var tname} # watchrun watches until it sees at least one RUNNING in bigrun and one PASS in bigrun2 watchrun sleep 15;watchrun.sh #{get var tname} [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run # mode toplevel # test2 : fullprep |
Added tests/release/tests/itemwait/watchrun.sh version [3cd7d57805].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #!/bin/bash runname=$1 pass=no alldone=no while [[ $alldone == no ]];do sleep 5 $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -list-runs $runname > list-runs.log bigrun_running=$(cat list-runs.log | egrep 'bigrun\(.*RUNNING'|wc -l) bigrun2_pass=$(cat list-runs.log | egrep 'bigrun2.*COMPLETED.*PASS'|wc -l) echo "bigrun_running=$bigrun_running, bigrun2_pass=$bigrun2_pass" if [[ $bigrun_running -gt 0 ]] && [[ $bigrun2_pass -gt 0 ]];then pass=yes alldone=yes fi if [[ $bigrun_running -eq 0 ]];then echo "bigrun all done and no bigrun2 found with PASS." alldone=yes fi done if [[ $pass == yes ]];then echo PASS exit 0 else echo FAIL exit 1 fi |
Added tests/release/tests/rollup/firstres.logpro version [aa9c55c1c8].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 7 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/rollup/results.logpro version [ed47d73b48].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 5 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) (expect:required in logbody = 1 "Toplevel will be NOT_STARTED" #/Test: runfirst\s+State: (INCOMPLETE|NOT_STARTED)/) (expect:required in logbody = 1 "runfirst/b/2 will be NOT_STARTED/INCOMPLETE" #/Test: runfirst.b.2.\s+State: NOT_STARTED\s+Status: INCOMPLETE/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/rollup/testconfig version [3a08af0f00].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # test2 from the tests/Makefile [var] tname rollup [ezsteps] # Set things up clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname #{get var tname}% runfirst $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -runtests runfirst/% -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean firstres $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none # Set one test item to INCOMPLETE setstate $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -set-state-status INCOMPLETE,FAIL :state COMPLETED :status PASS -testpatt runfirst/b/2 -target ubuntu/nfs/none -runname #{get var tname} # Rerun a different test item rerun $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/spring -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean -rerun PASS results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run # mode toplevel # test2 : fullprep |
Added tests/release/tests/test2/results.logpro version [0604885ee3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 2 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/test2/results_a.logpro version [0604885ee3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 2 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/test2/results_b.logpro version [0604885ee3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 2 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/test2/testconfig version [94d7901019].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | # test2 from the tests/Makefile [var] tname test2 mtpath #{shell readlink -f ../../bin} [ezsteps] clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname #{get var tname}% part1 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt ez_pass,runfirst/a/% -reqtarg ubuntu/nfs/none -runname #{get var tname} -preclean part2 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt %/,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean part3 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -runtests %/,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_b -preclean part4 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/%,%/ai -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean part5 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt %/,%/winter -reqtarg ubuntu/nfs/none -runname #{get var tname}_a -preclean part6 $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -set-state-status COMPLETED,FORCED :state COMPLETED :status PASS -testpatt ez_p%s,runfirst/ -target ubuntu/nfs/none -runname #{get var tname} results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname} -target ubuntu/nfs/none results_a $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname}_a -target ubuntu/nfs/none results_b $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs #{get var tname}_b -target ubuntu/nfs/none [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run # mode toplevel # test2 : fullprep |
Added tests/release/tests/testpatt/cleanres.logpro version [8613c2bd62].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ;; ("runfirst" 2 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/testpatt/results.logpro version [0604885ee3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (define logbody "LogFileBody") (define pass-specs '( ;; testname num-expected max-runtime ;; ("exit_0" 1 20) ;; ("ezlog_fail_then_pass" 1 20) ;; ("ezlog_pass" 1 20) ;; ("ez_pass" 1 20) ;; ("lineitem_pass" 1 20) ;; ("priority_1" 1 20) ;; ("priority_10" 1 20) ;; ("priority_10_waiton_1" 1 20) ;; ("priority_3" 1 20) ;; ("priority_4" 1 20) ;; ;; ("priority_5" 1 20) ;; ("priority_6" 1 20) ;; ;; ("priority_7" 1 20) ;; ("priority_8" 1 20) ;; ("priority_9" 1 20) ("runfirst" 2 20) ;; ("singletest" 1 20) ;; ("singletest2" 1 20) ;; ("special" 1 20) ;; ("sqlitespeed" 10 20) ;; ("test1" 1 20) ;; ("test2" 6 20) ;; ("test_mt_vars" 6 20) )) (define fail-specs '( ;; testname num-expected max-runtime ;; ("exit_1" 1 20) ;; ("ez_exit2_fail" 1 20) ;; ("ez_fail" 1 20) ;; ("ez_fail_quick" 1 20) ;; ("ezlog_fail" 1 20) ;; ("lineitem_fail" 1 20) ;; ("logpro_required_fail" 1 20) ;; ("manual_example" 1 20) ;; ("neverrun" 1 20) )) (define warn-specs '( ;; ("ezlog_warn" 1 20) )) (define nost-specs '( ;; ("wait_no_items1" 1 20) ;; ("wait_no_items2" 1 20) ;; ("wait_no_items3" 1 20) ;; ("wait_no_items4" 1 20) ;; ("no_items" 1 20) )) (define (check-one-test estate estatus testname count runtime) (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) (msg1 (conc testname " expecting count of " count)) (msg2 (conc testname " expecting runtime less than " runtime))) (expect:required in logbody = count msg1 rxe) ;;(expect:value in logbody count < msg2 rxe) )) ;; Special cases ;; ;; (expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) ;; (expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) (expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) ;; (expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) ;; (expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) ;; (expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) ;; (expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) ;; (expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) ;; (expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) ;; General cases ;; (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "PASS" testdat)) pass-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "FAIL" testdat)) fail-specs) (for-each (lambda (testdat) (apply check-one-test "COMPLETED" "WARN" testdat)) warn-specs) (for-each (lambda (testdat) (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) nost-specs) ;; Catch all. ;; (expect:error in logbody = 0 "Tests not accounted for" #/Test: /) ;; ;; define your hooks ;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") ;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") ;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") ;; ;; ;; first ensure your run at least started ;; ;; ;; (trigger "Init" #/This is a header/) ;; (trigger "InitEnd" #/^\s*$/) ;; (section "Init" "Init" "InitEnd") ;; ;; (trigger "Body" #/^.*$/) ;; anything starts the body ;; ;; (trigger "EndBody" #/This had better never match/) ;; ;; (section "Body" "Body" "EndBody") ;; ;; (trigger "Blah2" #/^begin Blah2/) ;; (trigger "Blah2End" #/^end Blah2/) ;; (section "Blah2" "Blah2" "Blah2End") ;; ;; (expect:required in "Init" = 1 "Header" #/This is a header/) ;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) ;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) ;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) ;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) ;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) ;; ;; ;; Using match number ;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; ;; Comparison instead of tolerance ;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) ;; ;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) ;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) ;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) ;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors ;; ;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) |
Added tests/release/tests/testpatt/testconfig version [ddc5455f74].
1 2 3 4 5 6 7 8 9 10 11 12 | + + + + + + + + + + + + | [ezsteps] clean $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -remove-runs -testpatt % -target ubuntu/nfs/none -runname release_testpatt cleanres $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_testpatt -target ubuntu/nfs/none runitems $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -run -testpatt runfirst/%2 -target ubuntu/nfs/none -runname release_testpatt results $MTRUNNER $MTTESTDIR/fullrun $MTPATH megatest -list-runs release_testpatt -target ubuntu/nfs/none [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run # mode toplevel |
Modified tests/rununittest.sh from [d9bb67915f] to [1c13c943af].
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 | - - - | #!/bin/bash # Usage: rununittest.sh testname debuglevel # |
Added tests/unit.logpro version [64aefe97ac].
1 2 3 4 5 6 7 8 | + + + + + + + + | ;; You should have at least one expect:required. This ensures that your process ran (expect:required in "LogFileBody" > 0 "At least one PASS" #/\[.{0,4}PASS.{0,4}\]/) ;; You may need ignores to suppress false error or warning hits from the later expects ;; NOTE: Order is important here! (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) (expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) (expect:error in "LogFileBody" = 0 "Any error" (list #/error/i #/\[.{0,4}FAIL.{0,4}\]/)) ;; but disallow any other errors |
Modified tests/unittests/misc.scm from [68603bcdd2] to [f0ad22a5f3].
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 | + + + | ;; test:match->sqlqry (test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname GLOB '' AND item_path LIKE 'b%')" (tests:match->sqlqry "a/b,a%,/b%")) (test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname LIKE '%' AND item_path LIKE 'b%')" (tests:match->sqlqry "a/b,a%,%/b%")) (exit) |
Modified tests/unittests/runs.scm from [61908ea980] to [25943e33c5].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + - + - + - - + + - - + - + |
|
46 47 48 49 50 51 52 | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - - + + + + - + - - + - + - + - + - + - - + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + - - - - - - + - - + + + + - - + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + | (define test-id #f) ;; force keepgoing ; (hash-table-set! args:arg-hash "-keepgoing" #t) (hash-table-set! args:arg-hash "-itempatt" "%") (hash-table-set! args:arg-hash "-testpatt" "%") |
Modified tests/unittests/tests.scm from [da39a3ee5e] to [15fd3688ae].
1 2 3 4 5 6 7 8 9 10 11 12 13 | + + + + + + + + + + + + + | ;;====================================================================== ;; itemwait, itemmatch (db:compare-itempaths ref-item-path item-path itemmap) ;; prereqs-not-met (rmt:get-prereqs-not-met run-id waitons item-path mode: testmode itemmap: itemmap)) (fails (runs:calc-fails prereqs-not-met)) (prereq-fails (runs:calc-prereq-fail prereqs-not-met)) (non-completed (runs:calc-not-completed prereqs-not-met)) (runnables (runs:calc-runnable prereqs-not-met))) |
Modified tree.scm from [02f8628298] to [1c5a9172b0].
63 64 65 66 67 68 69 | 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 | + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + | (if (> depth node-depth) ;; (+ 1 node-depth)) #f (loop hed tal depth (+ nodenum 1))))) #f)))) ;; top is the top node name zeroeth node VALUE=0 (define (tree:add-node obj top nodelst #!key (userdata #f)) (let ((curr-top (iup:attribute obj "TITLE0"))) |
Modified utils/Makefile.installall from [c6531307ff] to [df8e3cb2ff].
32 33 34 35 36 37 38 39 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + - + | ifeq ($(PREFIX),) PREFIX=$(PWD)/target endif # Set this on the command line of your make call if needed: make PROXY=host.com:1234 PROXY= # http://code.call-cc.org/dev-snapshots/2015/06/07/chicken-4.10.0rc1.tar.gz # Select version of chicken, sqlite3 etc |
134 135 136 137 138 139 140 141 142 143 144 145 146 147 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | + + + | chicken-4.9.0rc1.tar.gz : wget http://code.call-cc.org/dev-snapshots/2014/04/17/chicken-4.9.0rc1.tar.gz chicken-4.9.0.1.tar.gz : wget http://code.call-cc.org/releases/4.9.0/chicken-4.9.0.1.tar.gz chicken-4.10.0rc1.tar.gz : wget http://code.call-cc.org/dev-snapshots/2015/06/07/chicken-4.10.0rc1.tar.gz # git clone git://code.call-cc.org/chicken-core # git clone http://code.call-cc.org/git/chicken-core.git $(CHICKEN_INSTALL) : chicken-core/chicken.scm $(PREFIX)/setup-chicken4x.sh $(PREFIX)/setup-chicken4x.csh cd chicken-core;make PLATFORM=linux PREFIX=$(PREFIX) cd chicken-core;make PLATFORM=linux PREFIX=$(PREFIX) install |
Added utils/mtrunner version [ee53d3f91b].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + + + + + + + + + + + + + + | #! /bin/bash # Run megatest from within megatest # Usage: mtrunner testsuite_dir megatest_bin_dir command args .... for var in $(env | egrep "^MT_"|cut -d= -f1);do unset ${var} done cd $1 shift export PATH="$1:$PATH" shift "$@" |