Overview
Comment: | Clean up and reorg started on runs.scm |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
1d36720bc828eba20c9c6fab5de743ef |
User & Date: | matt on 2013-06-23 18:29:57 |
Other Links: | branch diff | manifest | tags |
Context
2013-06-23
| ||
19:26 | Update the TODO list and put reminders/hooks into common.scm for addint caches back for target and run info (new delete method allows this to work, *maybe*) check-in: 9167779154 user: matt tags: dev | |
18:29 | Clean up and reorg started on runs.scm check-in: 1d36720bc8 user: matt tags: dev | |
17:21 | Pulling run-tests-queue back into runs.scm check-in: 0f939b0642 user: matt tags: dev | |
Changes
Modified Makefile from [d2bc85de75] to [9623613c29].
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + | tests.o runs.o dashboard.o dashboard-tests.o dashboard-main.o : run_records.scm db.o ezsteps.o keys.o launch.o megatest.o monitor.o runs-for-ref.o runs.o tests.o : key_records.scm tests.o tasks.o dashboard-tasks.o : task_records.scm runs.o : test_records.scm megatest.o : megatest-fossil-hash.scm # Temporary while transitioning to new routine |
︙ |
Modified db.scm from [625f685b8f] to [6101e764c8].
︙ | |||
653 654 655 656 657 658 659 660 661 662 663 664 665 666 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (lambda (count) (set! numruns count)) db "SELECT COUNT(id) FROM runs WHERE runname LIKE ? AND state != 'deleted';" runpatt) (debug:print-info 11 "db:get-num-runs END " runpatt) numruns)) ;; 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-row runinfo)) ;; to extract info from the structure returned ;; (define (db:get-runs-by-patt db keys runnamepatt targpatt) ;; test-name) (let* ((tmp (runs:get-std-run-fields keys '("id" "runname" "state" "status" "owner" "event_time"))) (keystr (car tmp)) (header (cadr tmp)) (res '()) (key-patt "") (runwildtype (if (substring-index "%" runnamepatt) "like" "glob")) (qry-str #f) (keyvals (keys:target->keyval keys targpatt))) (for-each (lambda (keyval) (let* ((key (car keyval)) (patt (cadr keyval)) (fulkey (conc ":" key)) (wildtype (if (substring-index "%" patt) "like" "glob"))) (if patt (set! key-patt (conc key-patt " AND " key " " wildtype " '" patt "'")) (begin (debug:print 0 "ERROR: searching for runs with no pattern set for " fulkey) (exit 6))))) keyvals) (set! qry-str (conc "SELECT " keystr " FROM runs WHERE runname " runwildtype " ? " key-patt ";")) (debug:print-info 4 "runs:get-runs-by-patt qry=" qry-str " " runnamepatt) (sqlite3:for-each-row (lambda (a . r) (set! res (cons (list->vector (cons a r)) res))) db qry-str runnamepatt) (vector header res))) ;; use (get-value-by-header (db:get-header runinfo)(db:get-row runinfo)) (define (db:get-run-info db run-id) ;;(if (hash-table-ref/default *run-info-cache* run-id #f) ;; (hash-table-ref *run-info-cache* run-id) (let* ((res #f) (keys (db:get-keys db)) (remfields (list "id" "runname" "state" "status" "owner" "event_time")) |
︙ |
Modified mt.scm from [db089a3853] to [ae25aea357].
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 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 | + + + + + + + + + + + + + + + + + | (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") ;; This is the Megatest API. All generally "useful" routines will be wrapped or extended ;; here. ;;====================================================================== ;; R U N S ;;====================================================================== ;; runs: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-row runinfo)) ;; to extract info from the structure returned ;; (define (mt:get-runs-by-patt keys runnamepatt targpatt) (cdb:remote-run db:get-runs-by-patt #f keys runnamepatt targpatt)) ;;====================================================================== ;; T E S T S ;;====================================================================== (define (mt:get-tests-for-run run-id testpatt states status #!key (not-in #t) (sort-by #f)) (let loop ((testsdat (cdb:remote-run db:get-tests-for-run #f run-id testpatt states status 0 500 not-in sort-by)) (res '()) (offset 0) (limit 500)) (let* ((full-list (append res testsdat)) |
︙ |
Modified runs.scm from [44d742ed5e] to [73b8063a51].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") |
︙ | |||
128 129 130 131 132 133 134 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - | (for-each (lambda (varval) (set! envdat (append envdat (list varval))) (setenv (car varval)(cadr varval))) (configf:get-section runconfig section))) (list "default" target)) (vector target runname testpatt keys keyvals envdat mconfig runconfig serverdat transport db toppath run-id))) |
︙ | |||
168 169 170 171 172 173 174 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + | ;; Every time can-run-more-tests is called increment the delay ;; ;; NOTE: We run this server-side!! Do not use this global except in the runs:can-run-more-tests routine ;; (define *last-num-running-tests* 0) (define *runs:can-run-more-tests-count* 0) |
︙ | |||
203 204 205 206 207 208 209 | 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 | - - - - - - - - - - - - + - - - - + - - - - | (>= num-running-in-jobgroup job-group-limit)) (debug:print 1 "WARNING: number of jobs " num-running-in-jobgroup " in " jobgroup " exceeded, will not run " (tests:testqueue-get-testname test-record)) #t) (else #f)))) (list (not can-not-run-more) num-running num-running-in-jobgroup max-concurrent-jobs job-group-limit))))) |
︙ | |||
749 750 751 752 753 754 755 | 693 694 695 696 697 698 699 700 701 702 703 704 705 706 | - - - | (define (runs:queue-next-reg tal reg n regful) (if regful (cdr reg) (if (eq? (length tal) 1) '() reg))) |
︙ | |||
898 899 900 901 902 903 904 | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 | - + | ;; ;; NB// should pass in keys? ;; (define (runs:operate-on action target runnamepatt testpatt #!key (state #f)(status #f)(new-state-status #f)) (common:clear-caches) ;; clear all caches (let* ((db #f) (keys (cdb:remote-run db:get-keys db)) |
︙ | |||
1116 1117 1118 1119 1120 1121 1122 | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | - + | ;;====================================================================== ;; Lock/unlock runs ;;====================================================================== (define (runs:handle-locking target keys runname lock unlock user) (let* ((db #f) |
︙ |