Comment: | Merged trunk to fixing-logpro-test_data |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fixing-logpro-test_data |
Files: | files | file ages | folders |
SHA1: |
439b0bbdef27d07dcb53cd93656b81ed |
User & Date: | mrwellan on 2012-01-26 09:23:58 |
Other Links: | branch diff | manifest | tags |
2012-01-26
| ||
09:32 | Merged in minor fix from fixing-logpro-test_data branch check-in: 8e7dd486e5 user: mrwellan tags: trunk | |
09:23 | Merged trunk to fixing-logpro-test_data Closed-Leaf check-in: 439b0bbdef user: mrwellan tags: fixing-logpro-test_data | |
2012-01-24
| ||
22:13 | Fixed status during eztest runs, merely set to RUNNING check-in: 64932fb9cd user: matt tags: trunk | |
2011-11-09
| ||
15:09 | Logpro (pass) + test_data (fail) should be fail but is pass. Added test case for this check-in: 60d6b0411d user: mrwellan tags: fixing-logpro-test_data | |
Modified Makefile from [56afbe1a91] to [322e8fb253].
1 2 3 4 5 6 | PREFIX=. SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ | > | | | | | | | > | < < | | 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 | PREFIX=. CSCOPTS= SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ process.scm runs.scm tasks.scm tests.scm GUISRCF = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm dashboard-main.scm OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) HELPERS=$(addprefix $(PREFIX)/bin/,mt_laststep mt_runstep mt_ezstep) all : megatest dboard megatest: $(OFILES) megatest.o csc $(CSCOPTS) $(OFILES) megatest.o -o megatest dboard : $(OFILES) $(GOFILES) csc $(OFILES) $(GOFILES) -o dboard # Special dependencies for the includes tests.o db.o launch.o runs.o dashboard-tests.o dashboard-guimonitor.o dashboard-main.o monitor.o dashboard.o megatest.o : db_records.scm 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 $(OFILES) $(GOFILES) : common_records.scm %.o : %.scm csc $(CSCOPTS) -c $< $(PREFIX)/bin/megatest : megatest @echo Installing to PREFIX=$(PREFIX) cp megatest $(PREFIX)/bin/megatest $(HELPERS) : utils/mt_* cp $< $@ chmod a+x $@ $(PREFIX)/bin/nbfake : utils/nbfake cp $< $@ chmod a+x $@ # install dashboard as dboard so wrapper script can be called dashboard $(PREFIX)/bin/dboard : dboard $(FILES) cp dboard $(PREFIX)/bin/dboard utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard install : bin $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake bin : mkdir -p $(PREFIX)/bin test: tests/tests.scm cd tests;csi -I .. -b -n tests.scm clean : rm -f $(OFILES) $(GOFILES) megatest dboard dboard.o megatest.o |
Deleted cells.scm version [81e160db9e].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified configf.scm from [ef264b880e] to [9adef42084].
︙ | ︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | (append newalist (list (list key val))))) (define (config:eval-string-in-environment str) (let ((cmdres (cmd-run->list (conc "echo " str)))) (if (null? cmdres) "" (caar cmdres)))) ;; read a config file, returns hash table of alists ;; adds to ht if given (must be #f otherwise) ;; envion-patt is a regex spec that identifies sections that will be eval'd ;; in the environment on the fly (define (read-config path ht allow-system #!key (environ-patt #f)) (debug:print 4 "INFO: read-config " path " allow-system " allow-system " environ-patt " environ-patt) (if (not (file-exists? path)) (if (not ht)(make-hash-table) ht) (let ((inp (open-input-file path)) | > > > > > > > > > > > > | < < < < < < < | | | | | | > | | | | | | | | | | | | > > > > > | | | | | 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 | (append newalist (list (list key val))))) (define (config:eval-string-in-environment str) (let ((cmdres (cmd-run->list (conc "echo " str)))) (if (null? cmdres) "" (caar cmdres)))) ;;====================================================================== ;; Make the regexp's needed globally available ;;====================================================================== (define configf:include-rx (regexp "^\\[include\\s+(.*)\\]\\s*$")) (define configf:section-rx (regexp "^\\[(.*)\\]\\s*$")) (define configf:blank-l-rx (regexp "^\\s*$")) (define configf:key-sys-pr (regexp "^(\\S+)\\s+\\[system\\s+(\\S+.*)\\]\\s*$")) (define configf:key-val-pr (regexp "^(\\S+)\\s+(.*)$")) (define configf:comment-rx (regexp "^\\s*#.*")) (define configf:cont-ln-rx (regexp "^(\\s+)(\\S+.*)$")) ;; read a config file, returns hash table of alists ;; adds to ht if given (must be #f otherwise) ;; envion-patt is a regex spec that identifies sections that will be eval'd ;; in the environment on the fly (define (read-config path ht allow-system #!key (environ-patt #f)) (debug:print 4 "INFO: read-config " path " allow-system " allow-system " environ-patt " environ-patt) (if (not (file-exists? path)) (if (not ht)(make-hash-table) ht) (let ((inp (open-input-file path)) (res (if (not ht)(make-hash-table) ht))) (let loop ((inl (read-line inp)) (curr-section-name "default") (var-flag #f);; turn on for key-var-pr and cont-ln-rx, turn off elsewhere (lead #f)) (if (eof-object? inl) (begin (close-input-port inp) res) (regex-case inl (configf:comment-rx _ (loop (read-line inp) curr-section-name #f #f)) (configf:blank-l-rx _ (loop (read-line inp) curr-section-name #f #f)) (configf:include-rx ( x include-file ) (begin (read-config include-file res allow-system environ-patt: environ-patt) (loop (read-line inp) curr-section-name #f #f))) (configf:section-rx ( x section-name ) (loop (read-line inp) section-name #f #f)) (configf:key-sys-pr ( x key cmd ) (if allow-system (let ((alist (hash-table-ref/default res curr-section-name '())) (val-proc (lambda () (let* ((cmdres (cmd-run->list cmd)) (status (cadr cmdres)) (res (car cmdres))) (if (not (eq? status 0)) (begin (debug:print 0 "ERROR: problem with " inl ", return code " status) (exit 1))) (if (null? res) "" (string-intersperse res " ")))))) (hash-table-set! res curr-section-name (config:assoc-safe-add alist key (case allow-system ((return-procs) val-proc) ((return-string) cmd) (else (val-proc))))) (loop (read-line inp) curr-section-name #f #f)) (loop (read-line inp) curr-section-name #f #f))) (configf:key-val-pr ( x key val ) (let* ((alist (hash-table-ref/default res curr-section-name '())) (envar (and environ-patt (string-match (regexp environ-patt) curr-section-name))) (realval (if envar (config:eval-string-in-environment val) val))) (if envar (begin (debug:print 4 "INFO: read-config key=" key ", val=" val ", realval=" realval) (setenv key realval))) (hash-table-set! res curr-section-name (config:assoc-safe-add alist key realval)) (loop (read-line inp) curr-section-name key #f))) ;; if a continued line (configf:cont-ln-rx ( x whsp val ) (let ((alist (hash-table-ref/default res curr-section-name '()))) (if var-flag ;; if set to a string then we have a continued var (let ((newval (conc (config-lookup res curr-section-name var-flag) "\n" ;; trim lead from the incoming whsp to support some indenting. (if lead (string-substitute (regexp lead) "" whsp) "") |
︙ | ︙ | |||
134 135 136 137 138 139 140 | (list configdat toppath configfile fname)))) (define (config-lookup cfgdat section var) (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) #f (let ((match (assoc var sectdat))) | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | (list configdat toppath configfile fname)))) (define (config-lookup cfgdat section var) (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) #f (let ((match (assoc var sectdat))) (if match ;; (and match (list? match)(> (length match) 1)) (cadr match) #f)) ))) (define (configf:section-vars cfgdat section) (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) '() (map car sectdat)))) (define (setup) (let* ((configf (find-config)) (config (if configf (read-config configf #f #t) #f))) (if config (setenv "RUN_AREA_HOME" (pathname-directory configf))) config)) ;;====================================================================== ;; Non destructive writing of config file ;;====================================================================== (define (configf:compress-multi-lines fdat) ;; step 1.5 - compress any continued lines (if (null? fdat) fdat (let loop ((hed (car fdat)) (tal (cdr fdat)) (cur "") (led #f) (res '())) ;; ALL WHITESPACE LEADING LINES ARE TACKED ON!! ;; 1. remove led whitespace ;; 2. tack on to hed with "\n" (let ((match (string-match configf:cont-ln-rx hed))) (if match ;; blast! have to deal with a multiline (let* ((lead (cadr match)) (lval (caddr match)) (newl (conc cur "\n" lval))) (if (not led)(set! led lead)) (if (null? tal) (set! fdat (append fdat (list newl))) (loop (car tal)(cdr tal) newl led res))) ;; NB// not tacking newl onto res (let ((newres (if led (append res (list cur hed)) (append res (list hed))))) ;; prev was a multiline (if (null? tal) newres (loop (car tal)(cdr tal) "" #f newres)))))))) ;; note: I'm cheating a little here. I merely replace "\n" with "\n " (define (configf:expand-multi-lines fdat) ;; step 1.5 - compress any continued lines (if (null? fdat) fdat (let loop ((hed (car fdat)) (tal (cdr fdat)) (res '())) (let ((newres (append res (list (string-substitute (regexp "\n") "\n " hed #t))))) (if (null? tal) newres (loop (car tal)(cdr tal) newres)))))) (define (configf:file->list fname) (if (file-exists? fname) (let ((inp (open-input-file fname))) (let loop ((inl (read-line inp)) (res '())) (if (eof-object? inl) (begin (close-input-port inp) (reverse res)) (loop (read-line inp)(cons inl))))) '())) ;;====================================================================== ;; Write a config ;; 0. Given a refererence data structure "indat" ;; 1. Open the output file and read it into a list ;; 2. Flatten any multiline entries ;; 3. Modify values per contents of "indat" and remove absent values ;; 4. Append new values to the section (immediately after last legit entry) ;; 5. Write out the new list ;;====================================================================== (define (configf:write-config indat fname #!key (required-sections '())) (let* (;; step 1: Open the output file and read it into a list (fdat (configf:file->list fname)) (refdat (make-hash-table)) (sechash (make-hash-table)) ;; current section hash, init with hash for "default" section (new #f) ;; put the line to be used in new, if it is to be deleted the set new to #f (secname #f)) ;; step 2: Flatten multiline entries (if (not (null? fdat))(set! fdat (configf:compress-multi-line fdat))) ;; step 3: Modify values per contents of "indat" and remove absent values (if (not (null? fdat)) (let loop ((hed (car fdat)) (tal (cadr fdat)) (res '()) (lnum 0)) (regex-case hed (configf:comment-rx _ (set! res (append res (list hed)))) ;; (loop (read-line inp) curr-section-name #f #f)) (configf:blank-l-rx _ (set! res (append res (list hed)))) ;; (loop (read-line inp) curr-section-name #f #f)) (configf:section-rx ( x section-name ) (let ((section-hash (hash-table-ref/default refdat section-name #f))) (if (not section-hash) (let ((newhash (make-hash-table))) (hash-table-set! refhash section-name newhash) (set! sechash newhash)) (set! sechash section-hash)) (set! new hed) ;; will append this at the bottom of the loop (set! secname section-name) )) ;; No need to process key cmd, let it fall though to key val (configf:key-val-pr ( x key val ) (let ((newval (config-lookup indat sec key))) ;; can handle newval == #f here => that means key is removed (cond ((equal? newval val) (set! res (append res (list hed)))) ((not newval) ;; key has been removed (set! new #f)) ((not (equal? newval val)) (hash-table-set! sechash key newval) (set! new (conc key " " newval))) (else (debug:print 0 "ERROR: problem parsing line number " lnum "\"" hed "\""))))) (else (debug:print 0 "ERROR: Problem parsing line num " lnum " :\n " hed ))) (if (not (null? tal)) (loop (car tal)(cdr tal)(if new (append res (list new)) res)(+ lnum 1))) ;; drop to here when done processing, res contains modified list of lines (set! fdat res))) ;; step 4: Append new values to the section (for-each (lambda (section) (let ((sdat '()) ;; append needed bits here (svars (configf:section-vars indat section))) (for-each (lambda (var) (let ((val (config-lookup refdat section var))) (if (not val) ;; this one is new (begin (if (null? sdat)(set! sdat (list (conc "[" section "]")))) (set! sdat (append sdat (list (conc var " " val)))))))) svars) (set! fdat (append fdat sdat)))) (delete-duplicates (append require-sections (hash-table-keys indat)))) ;; step 5: Write out new file (with-output-to-file fname (lambda () (for-each (lambda (line) (print line)) (configf:expand-multi-lines fdat)))))) |
Added dashboard-main.scm version [4cd8b53cd2].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | ;;====================================================================== ;; Copyright 2006-2011, 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. ;;====================================================================== ;;====================================================================== ;; Main Megatest Panel ;;====================================================================== (use format) (require-library iup) (import (prefix iup iup:)) (use canvas-draw) (use sqlite3 srfi-1 posix regex regex-case srfi-69) (import (prefix sqlite3 sqlite3:)) (declare (unit dashboard-main)) (declare (uses common)) (declare (uses keys)) (declare (uses db)) (declare (uses tasks)) (include "common_records.scm") (include "db_records.scm") (include "run_records.scm") (include "task_records.scm") (define (main-menu) (iup:menu ;; a menu is a special attribute to a dialog (think Gnome putting the menu at screen top) (iup:menu-item "Files" (iup:menu ;; Note that you can use either #:action or action: for options (iup:menu-item "Open" action: (lambda (obj) (show (iup:file-dialog)) (print "File->open " obj))) (iup:menu-item "Save" #:action (lambda (obj)(print "File->save " obj))) (iup:menu-item "Exit" #:action (lambda (obj)(exit))))) (iup:menu-item "Tools" (iup:menu (iup:menu-item "Create new blah" #:action (lambda (obj)(print "Tools->new blah"))) ;; (iup:menu-item "Show dialog" #:action (lambda (obj) ;; (show message-window ;; #:modal? #t ;; ;; set positon using coordinates or center, start, top, left, end, bottom, right, parent-center, current ;; ;; #:x 'mouse ;; ;; #:y 'mouse ;; ) )))) (define (mtest) (let* ((curr-row-num 0) (rawconfig (read-config (conc *toppath* "/megatest.config") #f 'return-string)) (keys-matrix (iup:matrix #:expand "VERTICAL" ;; #:scrollbar "YES" #:numcol 1 #:numlin 20 #:numcol-visible 1 #:numlin-visible 5 #:click-cb (lambda (obj lin col status) (print "obj: " obj " lin: " lin " col: " col " status: " status)))) (setup-matrix (iup:matrix #:expand "YES" #:numcol 1 #:numlin 5 #:numcol-visible 1 #:numlin-visible 3)) (jobtools-matrix (iup:matrix #:expand "YES" #:numcol 1 #:numlin 5 #:numcol-visible 1 #:numlin-visible 3)) (validvals-matrix (iup:matrix #:expand "YES" #:numcol 1 #:numlin 2 #:numcol-visible 1 #:numlin-visible 2)) (envovrd-matrix (iup:matrix #:expand "YES" #:numcol 1 #:numlin 20 #:numcol-visible 1 #:numlin-visible 8)) (disks-matrix (iup:matrix #:expand "YES" #:numcol 1 #:numlin 20 #:numcol-visible 1 #:numlin-visible 8))) (iup:attribute-set! keys-matrix "0:0" "Field Num") (iup:attribute-set! keys-matrix "0:1" "Field Name") (iup:attribute-set! keys-matrix "WIDTH1" "100") (iup:attribute-set! disks-matrix "0:0" "Disk Name") (iup:attribute-set! disks-matrix "0:1" "Disk Path") (iup:attribute-set! disks-matrix "WIDTH1" "120") (iup:attribute-set! disks-matrix "WIDTH0" "100") (iup:attribute-set! disks-matrix "ALIGNMENT1" "ALEFT") (iup:attribute-set! disks-matrix "FIXTOTEXT" "C1") (iup:attribute-set! disks-matrix "RESIZEMATRIX" "YES") ;; fill in keys (set! curr-row-num 1) (for-each (lambda (var) (iup:attribute-set! keys-matrix (conc curr-row-num ":0") curr-row-num) (iup:attribute-set! keys-matrix (conc curr-row-num ":1") var) (set! curr-row-num (+ 1 curr-row-num))) ;; (config-lookup *configdat* "fields" var))) (configf:section-vars rawconfig "fields")) ;; fill in existing info (for-each (lambda (mat fname) (set! curr-row-num 1) (for-each (lambda (var) (iup:attribute-set! mat (conc curr-row-num ":0") var) (iup:attribute-set! mat (conc curr-row-num ":1") (config-lookup rawconfig fname var)) (set! curr-row-num (+ curr-row-num 1))) (configf:section-vars rawconfig fname))) (list setup-matrix jobtools-matrix validvals-matrix envovrd-matrix disks-matrix) (list "setup" "jobtools" "validvalues" "env-override" "disks")) (for-each (lambda (mat) (iup:attribute-set! mat "0:1" "Value") (iup:attribute-set! mat "0:0" "Var") (iup:attribute-set! mat "ALIGNMENT1" "ALEFT") (iup:attribute-set! mat "FIXTOTEXT" "C1") (iup:attribute-set! mat "RESIZEMATRIX" "YES") (iup:attribute-set! mat "WIDTH1" "120") (iup:attribute-set! mat "WIDTH0" "100") ) (list setup-matrix jobtools-matrix validvals-matrix envovrd-matrix)) (iup:attribute-set! validvals-matrix "WIDTH1" "290") (iup:attribute-set! envovrd-matrix "WIDTH1" "290") (iup:vbox (iup:hbox (iup:vbox (let ((tabs (iup:tabs ;; The required tab (iup:hbox ;; The keys (iup:frame #:title "Keys (required)" (iup:vbox (iup:label (conc "Set the fields for organising your runs\n" "here. Note: can only be changed before\n" "running the first run when megatest.db\n" "is created.")) keys-matrix)) (iup:vbox ;; The setup section (iup:frame #:title "Setup" (iup:vbox (iup:label (conc "max_concurrent_jobs : limits total concurrent jobs (optional)\n" "linktree : directory where linktree will be created.")) setup-matrix)) ;; The jobtools (iup:frame #:title "Jobtools" (iup:vbox (iup:label (conc "launcher : tool or script to run jobs (try nbfake)\n" "useshell : use system to run your launcher\n" "workhosts : spread jobs out on these hosts")) jobtools-matrix)) ;; The disks (iup:frame #:title "Disks" (iup:vbox (iup:label (conc "Enter names and existing paths of locations to run tests")) disks-matrix)))) ;; The optional tab (iup:vbox ;; The Environment Overrides (iup:frame #:title "Env override" envovrd-matrix) ;; The valid values (iup:frame #:title "Validvalues" validvals-matrix) )))) (iup:attribute-set! tabs "TABTITLE0" "Required settings") (iup:attribute-set! tabs "TABTITLE1" "Optional settings") tabs)) )))) (define (rconfig) (iup:vbox (iup:frame #:title "Default"))) (define (tests) (iup:hbox (iup:frame #:title "Tests browser"))) (define (runs) (iup:hbox (iup:frame #:title "Runs browser"))) (define (main-panel) (iup:dialog #:title "Menu Test" #:menu (main-menu) (let ((tabtop (iup:tabs (mtest) (rconfig) (tests) (runs)))) (iup:attribute-set! tabtop "TABTITLE0" "Megatest") (iup:attribute-set! tabtop "TABTITLE1" "Runconfigs") (iup:attribute-set! tabtop "TABTITLE2" "Tests") (iup:attribute-set! tabtop "TABTITLE3" "Runs") tabtop))) |
Modified dashboard-tests.scm from [e8ada23103] to [8aad97ccf0].
︙ | ︙ | |||
264 265 266 267 268 269 270 | (testmeta (if testdat (let ((tm (db:testmeta-get-record db testname))) (if tm tm (make-db:testmeta))) (make-db:testmeta))) (keystring (string-intersperse (map (lambda (keyval) | | > | | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | (testmeta (if testdat (let ((tm (db:testmeta-get-record db testname))) (if tm tm (make-db:testmeta))) (make-db:testmeta))) (keystring (string-intersperse (map (lambda (keyval) ;; (conc ":" (car keyval) " " (cadr keyval))) (cadr keyval)) keydat) "/")) (item-path (db:test-get-item-path testdat)) (viewlog (lambda (x) (if (file-exists? logfile) ;(system (conc "firefox " logfile "&")) (iup:send-url logfile) (message-window (conc "File " logfile " not found"))))) (xterm (lambda (x) |
︙ | ︙ | |||
330 331 332 333 334 335 336 | (command-text-box (iup:textbox #:expand "HORIZONTAL" #:font "Courier New, -10")) (command-launch-button (iup:button "Execute!" #:action (lambda (x) (let ((cmd (iup:attribute command-text-box "VALUE"))) (system (conc cmd " &")))))) (run-test (lambda (x) (iup:attribute-set! command-text-box "VALUE" | | | | | | 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 | (command-text-box (iup:textbox #:expand "HORIZONTAL" #:font "Courier New, -10")) (command-launch-button (iup:button "Execute!" #:action (lambda (x) (let ((cmd (iup:attribute command-text-box "VALUE"))) (system (conc cmd " &")))))) (run-test (lambda (x) (iup:attribute-set! command-text-box "VALUE" (conc "megatest -runtests " testname " -target " keystring " :runname " runname " -itempatt " (if (equal? item-path "") "%" item-path) "" )))) (remove-test (lambda (x) (iup:attribute-set! command-text-box "VALUE" (conc "megatest -remove-runs -target " keystring " :runname " runname " -testpatt " testname " -itempatt " (if (equal? item-path "") "%" item-path) " -v "))))) (cond ((not testdat)(begin (print "ERROR: bad test info for " test-id)(exit 1))) ((not rundat)(begin (print "ERROR: found test info but there is a problem with the run info for " run-id)(exit 1))) (else ;; (test-set-status! db run-id test-name state status itemdat) (set! self ; (iup:dialog #:close_cb (lambda (a)(exit)) ; #:expand "YES" |
︙ | ︙ | |||
429 430 431 432 433 434 435 | #:expand "YES" #:multiline "YES" #:font "Courier New, -10" #:size "100x100"))) (hash-table-set! widgets "Test Data" (lambda (testdat) ;; (let* ((currval (iup:attribute test-data "VALUE")) ;; "TITLE")) | | | | > | 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 | #:expand "YES" #:multiline "YES" #:font "Courier New, -10" #:size "100x100"))) (hash-table-set! widgets "Test Data" (lambda (testdat) ;; (let* ((currval (iup:attribute test-data "VALUE")) ;; "TITLE")) (fmtstr "~10a~10a~10a~10a~7a~7a~6a~6a~a") ;; category,variable,value,expected,tol,units,type,comment (newval (string-intersperse (append (list (format #f fmtstr "Category" "Variable" "Value" "Expected" "Tol" "Status" "Units" "Type" "Comment") (format #f fmtstr "========" "========" "=====" "========" "===" "======" "=====" "====" "=======")) (map (lambda (x) (format #f fmtstr (db:test-data-get-category x) (db:test-data-get-variable x) (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))) (db:read-test-data db test-id "%"))) "\n"))) (if (not (equal? currval newval)) (iup:attribute-set! test-data "VALUE" newval ))))) ;; "TITLE" newval))))) test-data))) ))) |
︙ | ︙ |
Modified dashboard.scm from [d2972b66b4] to [f216c4adf5].
︙ | ︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | (declare (uses db)) (declare (uses configf)) (declare (uses process)) (declare (uses launch)) (declare (uses runs)) (declare (uses dashboard-tests)) (declare (uses dashboard-guimonitor)) (declare (uses megatest-version)) (include "common_records.scm") (include "db_records.scm") (include "run_records.scm") (define help (conc | > | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | (declare (uses db)) (declare (uses configf)) (declare (uses process)) (declare (uses launch)) (declare (uses runs)) (declare (uses dashboard-tests)) (declare (uses dashboard-guimonitor)) (declare (uses dashboard-main)) (declare (uses megatest-version)) (include "common_records.scm") (include "db_records.scm") (include "run_records.scm") (define help (conc |
︙ | ︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | (list "-rows" "-run" "-test" "-debug" ) (list "-h" "-guimonitor" "-v" "-q" ) args:arg-hash 0)) (if (args:get-arg "-h") | > | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | (list "-rows" "-run" "-test" "-debug" ) (list "-h" "-guimonitor" "-main" "-v" "-q" ) args:arg-hash 0)) (if (args:get-arg "-h") |
︙ | ︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | (define *examine-test-dat* (make-hash-table)) (define *exit-started* #f) (define *status-ignore-hash* (make-hash-table)) (define *state-ignore-hash* (make-hash-table)) (define *last-db-update-time* 0) (define *please-update-buttons* #t) (define *db-file-path* (conc *toppath* "/megatest.db")) (define *tests-sort-reverse* #f) (define *hide-empty-runs* #f) (define *verbosity* (cond ((args:get-arg "-debug")(string->number (args:get-arg "-debug"))) | > > | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | (define *examine-test-dat* (make-hash-table)) (define *exit-started* #f) (define *status-ignore-hash* (make-hash-table)) (define *state-ignore-hash* (make-hash-table)) (define *last-db-update-time* 0) (define *please-update-buttons* #t) (define *delayed-update* 0) (define *db-file-path* (conc *toppath* "/megatest.db")) (define *tests-sort-reverse* #f) (define *hide-empty-runs* #f) (define *verbosity* (cond ((args:get-arg "-debug")(string->number (args:get-arg "-debug"))) |
︙ | ︙ | |||
195 196 197 198 199 200 201 | (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 itemnamepatt keypatts) (let ((modtime (file-modification-time *db-file-path*))) | | > > | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | (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 itemnamepatt keypatts) (let ((modtime (file-modification-time *db-file-path*))) (if (or (> modtime *last-db-update-time*) (> *delayed-update* 0)) (begin (set! *please-update-buttons* #t) (set! *last-db-update-time* modtime) (set! *delayed-update* (- *delayed-update* 1)) (let* ((allruns (db:get-runs *db* runnamepatt numruns ;; (+ numruns 1) ;; (/ numruns 2)) *start-run-offset* keypatts)) (header (db:get-header allruns)) (runs (db:get-rows allruns)) (result '()) (maxtests 0) (states (hash-table-keys *state-ignore-hash*)) |
︙ | ︙ | |||
444 445 446 447 448 449 450 451 452 453 454 455 456 457 | (define (mkstr . x) (string-intersperse (map conc x) ",")) (define (update-search x val) ;; (print "Setting search for " x " to " val) (hash-table-set! *searchpatts* x val)) (define (make-dashboard-buttons nruns ntests keynames) (let* ((nkeys (length keynames)) (runsvec (make-vector nruns)) (header (make-vector nruns)) (lftcol (make-vector ntests)) (keycol (make-vector ntests)) | > > > > > | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | (define (mkstr . x) (string-intersperse (map conc x) ",")) (define (update-search x val) ;; (print "Setting search for " x " to " val) (hash-table-set! *searchpatts* x val)) (define (mark-for-update) (set! *last-db-update-time* 0) (set! *delayed-update* 1) ) (define (make-dashboard-buttons nruns ntests keynames) (let* ((nkeys (length keynames)) (runsvec (make-vector nruns)) (header (make-vector nruns)) (lftcol (make-vector ntests)) (keycol (make-vector ntests)) |
︙ | ︙ | |||
466 467 468 469 470 471 472 | (iup:hbox (iup:vbox (iup:frame #:title "filter test and items" (iup:hbox (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" #:action (lambda (obj unk val) | | | | | | | | | | | 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 | (iup:hbox (iup:vbox (iup:frame #:title "filter test and items" (iup:hbox (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" #:action (lambda (obj unk val) (mark-for-update) (update-search "test-name" val))) (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" #:action (lambda (obj unk val) (mark-for-update) (update-search "item-name" val))))) (iup:vbox (iup:hbox (iup:button "Sort" #:action (lambda (obj) (set! *tests-sort-reverse* (not *tests-sort-reverse*)) (iup:attribute-set! obj "TITLE" (if *tests-sort-reverse* "+Sort" "-Sort")) (mark-for-update))) (iup:button "HideEmpty" #:action (lambda (obj) (set! *hide-empty-runs* (not *hide-empty-runs*)) (iup:attribute-set! obj "TITLE" (if *hide-empty-runs* "+Hide" "-Hide")) (mark-for-update))) (iup:button "Refresh" #:action (lambda (obj) (mark-for-update)))) (iup:hbox (iup:button "Quit" #:action (lambda (obj)(sqlite3:finalize! *db*)(exit))) (iup:button "Monitor" #:action (lambda (obj)(system (conc (car (argv))" -guimonitor &"))))) )) ;; (iup:button "<- Left" #:action (lambda (obj)(set! *start-run-offset* (+ *start-run-offset* 1)))) ;; (iup:button "Up ^" #:action (lambda (obj)(set! *start-test-offset* (if (> *start-test-offset* 0)(- *start-test-offset* 1) 0)))) ;; (iup:button "Down v" #:action (lambda (obj)(set! *start-test-offset* (if (>= *start-test-offset* (length *alltestnamelst*))(length *alltestnamelst*)(+ *start-test-offset* 1))))) ;; (iup:button "Right ->" #:action (lambda (obj)(set! *start-run-offset* (if (> *start-run-offset* 0)(- *start-run-offset* 1) 0)))) (iup:frame #:title "hide" (iup:vbox (apply iup:hbox (map (lambda (status) (iup:toggle status #:action (lambda (obj val) (mark-for-update) (if (eq? val 1) (hash-table-set! *status-ignore-hash* status #t) (hash-table-delete! *status-ignore-hash* status))))) '("PASS" "FAIL" "WARN" "CHECK" "WAIVED" "STUCK/DEAD" "n/a"))) (apply iup:hbox (map (lambda (state) (iup:toggle state #:action (lambda (obj val) (mark-for-update) (if (eq? val 1) (hash-table-set! *state-ignore-hash* state #t) (hash-table-delete! *state-ignore-hash* state))))) '("RUNNING" "COMPLETED" "INCOMPLETE" "LAUNCHED" "NOT_STARTED" "KILLED"))) (iup:valuator #:valuechanged_cb (lambda (obj) (let ((val (inexact->exact (round (/ (string->number (iup:attribute obj "VALUE")) 10)))) (oldmax (string->number (iup:attribute obj "MAX"))) (maxruns *tot-run-count*)) (set! *start-run-offset* val) (mark-for-update) (debug:print 6 "*start-run-offset* " *start-run-offset* " maxruns: " maxruns ", val: " val " oldmax: " oldmax) (iup:attribute-set! obj "MAX" (* maxruns 10)))) #:expand "YES" #:max (* 10 (length *allruns*))))) ;(iup:button "inc rows" #:action (lambda (obj)(set! *num-tests* (+ *num-tests* 1)))) ;(iup:button "dec rows" #:action (lambda (obj)(set! *num-tests* (if (> *num-tests* 0)(- *num-tests* 1) 0)))) ) ) ;; create the left most column for the run key names and the test names (set! lftlst (list (iup:hbox (iup:label) ;; (iup:valuator) (apply iup:vbox (map (lambda (x) (let ((res (iup:hbox (iup:label x #:size "40x15" #:fontsize "10") ;; #:expand "HORIZONTAL") (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" ;; #:expand "HORIZONTAL" #:action (lambda (obj unk val) (mark-for-update) (update-search x val)))))) (set! i (+ i 1)) res)) keynames))))) (let loop ((testnum 0) (res '())) (cond |
︙ | ︙ | |||
570 571 572 573 574 575 576 | #:flat "YES" #:alignment "ALEFT" ; #:image img1 ; #:impress img2 #:size "100x15" #:fontsize "10" #:action (lambda (obj) | | | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | #:flat "YES" #:alignment "ALEFT" ; #:image img1 ; #:impress img2 #:size "100x15" #:fontsize "10" #:action (lambda (obj) (mark-for-update) (toggle-hide testnum))))) ;; (iup:attribute obj "TITLE")))) (vector-set! lftcol testnum labl) (loop (+ testnum 1)(cons labl res)))))) ;; (let loop ((runnum 0) (keynum 0) (keyvec (make-vector nkeys)) |
︙ | ︙ | |||
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | (if testid (examine-test *db* testid) (begin (print "ERROR: testid is not a number " (args:get-arg "-test")) (exit 1))))) ((args:get-arg "-guimonitor") (gui-monitor *db*)) (else (set! uidat (make-dashboard-buttons *num-runs* *num-tests* *dbkeys*)) (iup:callback-set! *tim* "ACTION_CB" (lambda (x) (run-update x))))) ;(print x))))) (iup:main-loop) | > > | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | (if testid (examine-test *db* testid) (begin (print "ERROR: testid is not a number " (args:get-arg "-test")) (exit 1))))) ((args:get-arg "-guimonitor") (gui-monitor *db*)) ((args:get-arg "-main") (iup:show (main-panel))) (else (set! uidat (make-dashboard-buttons *num-runs* *num-tests* *dbkeys*)) (iup:callback-set! *tim* "ACTION_CB" (lambda (x) (run-update x))))) ;(print x))))) (iup:main-loop) |
Modified db.scm from [29e62d469f] to [cf37c2a3a0].
︙ | ︙ | |||
36 37 38 39 40 41 42 | (let* ((keys (config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys))) (for-each (lambda (key) (let ((keyn (vector-ref key 0))) (if (member (string-downcase keyn) | | | | | | | | | | | | | | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | (let* ((keys (config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys))) (for-each (lambda (key) (let ((keyn (vector-ref key 0))) (if (member (string-downcase keyn) (list "runname" "state" "status" "owner" "event_time" "comment" "fail_count" "pass_count")) (begin (print "ERROR: your key cannot be named " keyn " as this conflicts with the same named field in the runs table") (system (conc "rm -f " dbpath)) (exit 1))))) keys) ;; (sqlite3:execute db "PRAGMA synchronous = OFF;") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS keys (id INTEGER PRIMARY KEY, fieldname TEXT, fieldtype TEXT, CONSTRAINT keyconstraint UNIQUE (fieldname));") (for-each (lambda (key) (sqlite3:execute db "INSERT INTO keys (fieldname,fieldtype) VALUES (?,?);" (key:get-fieldname key)(key:get-fieldtype key))) keys) (sqlite3:execute db (conc "CREATE TABLE IF NOT EXISTS runs (id INTEGER PRIMARY KEY, " fieldstr (if havekeys "," "") "runname TEXT," "state TEXT DEFAULT ''," "status TEXT DEFAULT ''," "owner TEXT DEFAULT ''," "event_time TIMESTAMP," "comment TEXT DEFAULT ''," "fail_count INTEGER DEFAULT 0," "pass_count INTEGER DEFAULT 0," "CONSTRAINT runsconstraint UNIQUE (runname" (if havekeys "," "") keystr "));")) (sqlite3:execute db (conc "CREATE INDEX runs_index ON runs (runname" (if havekeys "," "") keystr ");")) (sqlite3:execute db "CREATE TABLE IF NOT EXISTS tests (id INTEGER PRIMARY KEY, run_id INTEGER, testname TEXT, host TEXT DEFAULT 'n/a', cpuload REAL DEFAULT -1, diskfree INTEGER DEFAULT -1, uname TEXT DEFAULT 'n/a', |
︙ | ︙ | |||
111 112 113 114 115 116 117 118 119 120 121 122 123 124 | owner TEXT DEFAULT '', description TEXT DEFAULT '', reviewed TIMESTAMP, iterated TEXT DEFAULT '', avg_runtime REAL, avg_disk REAL, tags TEXT DEFAULT '', CONSTRAINT test_meta_constraint UNIQUE (testname));") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRIMARY KEY, test_id INTEGER, category TEXT DEFAULT '', variable TEXT, value REAL, expected REAL, | > | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | owner TEXT DEFAULT '', description TEXT DEFAULT '', reviewed TIMESTAMP, iterated TEXT DEFAULT '', avg_runtime REAL, avg_disk REAL, tags TEXT DEFAULT '', jobgroup TEXT DEFAULT 'default', CONSTRAINT test_meta_constraint UNIQUE (testname));") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRIMARY KEY, test_id INTEGER, category TEXT DEFAULT '', variable TEXT, value REAL, expected REAL, |
︙ | ︙ | |||
171 172 173 174 175 176 177 | (patch-db)) ((< mver 1.21) (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var TEXT, val TEXT, CONSTRAINT metadat_constraint UNIQUE (var));") (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the changes are already applied (sqlite3:execute db test-meta-def) | | | | | | | | | > > > > | 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 | (patch-db)) ((< mver 1.21) (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var TEXT, val TEXT, CONSTRAINT metadat_constraint UNIQUE (var));") (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the changes are already applied (sqlite3:execute db test-meta-def) ;(for-each ; (lambda (stmt) ; (sqlite3:execute db stmt)) ; (list ; "ALTER TABLE tests ADD COLUMN first_err TEXT;" ; "ALTER TABLE tests ADD COLUMN first_warn TEXT;" ; )) (patch-db)) ((< mver 1.24) (db:set-var db "MEGATEST_VERSION" 1.24) (sqlite3:execute db "DROP TABLE IF EXISTS test_data;") (sqlite3:execute db "DROP TABLE IF EXISTS test_meta;") (sqlite3:execute db test-meta-def) (sqlite3:execute db "CREATE TABLE IF NOT EXISTS test_data (id INTEGER PRIMARY KEY, test_id INTEGER, category TEXT DEFAULT '', variable TEXT, value REAL, expected REAL, tol REAL, units TEXT, comment TEXT DEFAULT '', status TEXT DEFAULT 'n/a', CONSTRAINT test_data UNIQUE (test_id,category,variable));") (print "WARNING: Table test_data and test_meta where recreated. Please do megatest -update-meta") (patch-db)) ((< mver 1.27) (db:set-var db "MEGATEST_VERSION" 1.27) (sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT '';") (patch-db)) ((< mver 1.29) (db:set-var db "MEGATEST_VERSION" 1.29) (sqlite3:execute db "ALTER TABLE test_steps ADD COLUMN logfile TEXT DEFAULT '';") (sqlite3:execute db "ALTER TABLE tests ADD COLUMN shortdir TEXT DEFAULT '';")) ((< mver 1.36) (db:set-var db "MEGATEST_VERSION" 1.36) (sqlite3:execute db "ALTER TABLER test_meta ADD COLUMN jobgroup TEXT DEFAULT 'default';")) ((< mver megatest-version) (db:set-var db "MEGATEST_VERSION" megatest-version)))))) ;;====================================================================== ;; meta get and set vars ;;====================================================================== |
︙ | ︙ | |||
253 254 255 256 257 258 259 | (if (null? header) #f (let loop ((hed (car header)) (tal (cdr header)) (n 0)) (if (equal? hed field) (vector-ref row n) (if (null? tal) #f (loop (car tal)(cdr tal)(+ n 1))))))) | | | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | (if (null? header) #f (let loop ((hed (car header)) (tal (cdr header)) (n 0)) (if (equal? hed field) (vector-ref row n) (if (null? tal) #f (loop (car tal)(cdr tal)(+ n 1))))))) ;;====================================================================== ;; R U N S ;;====================================================================== (define (runs:get-std-run-fields keys remfields) (let* ((header (append (map key:get-fieldname keys) remfields)) |
︙ | ︙ | |||
360 361 362 363 364 365 366 | ;; states and statuses are required to be lists, empty is ok (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) (let ((res '()) (states-str (conc "('" (string-intersperse states "','") "')")) (statuses-str (conc "('" (string-intersperse statuses "','") "')")) ) (sqlite3:for-each-row | | | | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | ;; states and statuses are required to be lists, empty is ok (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) (let ((res '()) (states-str (conc "('" (string-intersperse states "','") "')")) (statuses-str (conc "('" (string-intersperse statuses "','") "')")) ) (sqlite3:for-each-row (lambda (a . b) ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment) (set! res (cons (apply vector a b) res))) ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment) res))) db (conc "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment " " FROM tests WHERE run_id=? AND testname like ? AND item_path LIKE ? " " AND NOT (state in " states-str " AND status IN " statuses-str ") " ;; " ORDER BY id DESC;" " ORDER BY event_time ASC;" ;; POTENTIAL ISSUE! CHECK ME! Does anyting depend on this being sorted by id? ) |
︙ | ︙ | |||
390 391 392 393 394 395 396 | ;; set tests with state currstate and status currstatus to newstate and newstatus ;; use currstate = #f and or currstatus = #f to apply to any state or status respectively ;; WARNING: SQL injection risk (define (db:set-tests-state-status db run-id testnames currstate currstatus newstate newstatus) (for-each (lambda (testname) (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " | | | | > > > > > > > > > > > > > | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | ;; set tests with state currstate and status currstatus to newstate and newstatus ;; use currstate = #f and or currstatus = #f to apply to any state or status respectively ;; WARNING: SQL injection risk (define (db:set-tests-state-status db run-id testnames currstate currstatus newstate newstatus) (for-each (lambda (testname) (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " (if currstate (conc "state='" currstate "' AND ") "") (if currstatus (conc "status='" currstatus "' AND ") "") " run_id=? AND testname=? AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));"))) ;;(debug:print 0 "QRY: " qry) (sqlite3:execute db qry run-id newstate newstatus testname testname))) testnames)) (define (db:delete-tests-in-state db run-id state) (sqlite3:execute db "DELETE FROM tests WHERE state=? AND run_id=?;" state run-id)) (define (db:test-set-state-status-by-id db test-id newstate newstatus newcomment) (if newstate (sqlite3:execute db "UPDATE tests SET state=? WHERE id=?;" newstate test-id)) (if newstatus (sqlite3:execute db "UPDATE tests SET status=? WHERE id=?;" newstatus test-id)) (if newcomment (sqlite3:execute db "UPDATE tests SET comment=? WHERE id=?;" newcomment test-id))) (define (db:get-count-tests-running db) (let ((res 0)) (sqlite3:for-each-row (lambda (count) (set! res count)) db "SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' OR state = 'REMOTEHOSTSTART';") res)) (define (db:get-count-tests-running-in-jobgroup db jobgroup) (if (not jobgroup) 0 ;; (let ((res 0)) (sqlite3:for-each-row (lambda (count) (set! res count)) db "SELECT count(id) FROM tests WHERE state = 'RUNNING' OR state = 'LAUNCHED' OR state = 'REMOTEHOSTSTART' AND testname in (SELECT testname FROM test_meta WHERE jobgroup=?;" jobgroup) res))) ;; done with run when: ;; 0 tests in LAUNCHED, NOT_STARTED, REMOTEHOSTSTART, RUNNING (define (db:estimated-tests-remaining db run-id) (let ((res 0)) (sqlite3:for-each-row (lambda (count) |
︙ | ︙ | |||
452 453 454 455 456 457 458 | res)) (define (db:test-set-comment db run-id testname item-path comment) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" | | | | 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | res)) (define (db:test-set-comment db run-id testname item-path comment) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" comment run-id testname item-path)) ;; (define (db:test-set-rundir! db run-id testname item-path rundir) (sqlite3:execute db "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" rundir run-id testname item-path)) ;;====================================================================== ;; Tests meta data ;;====================================================================== ;; read the record given a testname (define (db:testmeta-get-record db testname) |
︙ | ︙ | |||
495 496 497 498 499 500 501 | (debug:print 4 "test-id " test-id ", csvdata: " csvdata) (let ((csvlist (csv->list (make-csv-reader (open-input-string csvdata) '((strip-leading-whitespace? #t) (strip-trailing-whitespace? #t)) )))) ;; (csv->list csvdata))) (for-each (lambda (csvrow) | | | > | | | | | | | | | | | | | | 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 | (debug:print 4 "test-id " test-id ", csvdata: " csvdata) (let ((csvlist (csv->list (make-csv-reader (open-input-string csvdata) '((strip-leading-whitespace? #t) (strip-trailing-whitespace? #t)) )))) ;; (csv->list csvdata))) (for-each (lambda (csvrow) (let* ((padded-row (take (append csvrow (list #f #f #f #f #f #f #f #f #f)) 9)) (category (list-ref padded-row 0)) (variable (list-ref padded-row 1)) (value (any->number-if-possible (list-ref padded-row 2))) (expected (any->number-if-possible (list-ref padded-row 3))) (tol (any->number-if-possible (list-ref padded-row 4))) ;; >, <, >=, <=, or a number (units (list-ref padded-row 5)) (comment (list-ref padded-row 6)) (status (let ((s (list-ref padded-row 7))) (if (and (string? s)(or (string-match (regexp "^\\s*$") s) (string-match (regexp "^n/a$") s))) #f s))) ;; if specified on the input then use, else calculate (type (list-ref padded-row 8))) ;; look up expected,tol,units from previous best fit test if they are all either #f or '' (debug:print 4 "BEFORE: category: " category " variable: " variable " value: " value ", expected: " expected " tol: " tol " units: " units " status: " status " comment: " comment " type: " type) (if (and (or (not expected)(equal? expected "")) (or (not tol) (equal? expected "")) (or (not units) (equal? expected ""))) (let-values (((new-expected new-tol new-units)(db:get-prev-tol-for-test db test-id category variable))) (set! expected new-expected) (set! tol new-tol) (set! units new-units))) (debug:print 4 "AFTER: category: " category " variable: " variable " value: " value ", expected: " expected " tol: " tol " units: " units " status: " status " comment: " comment) ;; calculate status if NOT specified (if (and (not status)(number? expected)(number? value)) ;; need expected and value to be numbers (if (number? tol) ;; if tol is a number then we do the standard comparison (let* ((max-val (+ expected tol)) (min-val (- expected tol)) (result (and (>= value min-val)(<= value max-val)))) (debug:print 4 "max-val: " max-val " min-val: " min-val " result: " result) (set! status (if result "pass" "fail"))) (set! status ;; NB// need to assess each one (i.e. not return operator since need to act if not valid op. (case (string->symbol tol) ;; tol should be >, <, >=, <= ((>) (if (> value expected) "pass" "fail")) ((<) (if (< value expected) "pass" "fail")) ((>=) (if (>= value expected) "pass" "fail")) ((<=) (if (<= value expected) "pass" "fail")) (else (conc "ERROR: bad tol comparator " tol)))))) (debug:print 4 "AFTER2: category: " category " variable: " variable " value: " value ", expected: " expected " tol: " tol " units: " units " status: " status " comment: " comment) (sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category,variable,value,expected,tol,units,comment,status,type) VALUES (?,?,?,?,?,?,?,?,?,?);" test-id category variable value expected tol units (if comment comment "") status type))) csvlist))) ;; get a list of test_data records matching categorypatt (define (db:read-test-data db 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))) 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))) (define (db:load-test-data db run-id test-name itemdat) (let* ((item-path (item-list->path itemdat)) (testdat (db:get-test-info db run-id test-name item-path)) (test-id (if testdat (db:test-get-id testdat) #f))) ;; (debug:print 1 "Enter records to insert in the test_data table, seven fields, comma separated per line") (debug:print 4 "itemdat: " itemdat ", test-name: " test-name ", test-id: " test-id) (if test-id (let loop ((lin (read-line))) (if (not (eof-object? lin)) (begin (debug:print 4 lin) (db:csv->test-data db test-id lin) (loop (read-line)))))) ;; roll up the current results. ;; FIXME: Add the status to (db:test-data-rollup db test-id #f))) ;; WARNING: Do NOT call this for the parent test on an iterated test ;; Roll up test_data pass/fail results ;; look at the test_data status field, ;; if all are pass (any case) and the test status is PASS or NULL or '' then set test status to PASS. ;; if one or more are fail (any case) then set test status to PASS, non "pass" or "fail" are ignored (define (db:test-data-rollup db test-id status) (sqlite3:execute db "UPDATE tests SET fail_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status like 'fail'), pass_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status like 'pass') WHERE id=?;" test-id test-id test-id) ;; if the test is not FAIL then set status based on the fail and pass counts. (thread-sleep! 1) (sqlite3:execute db ;;; NOTE: Should this be WARN,FAIL? A WARN is not a FAIL????? BUG FIXME "UPDATE tests SET status=CASE WHEN (SELECT fail_count FROM tests WHERE id=?) > 0 THEN 'FAIL' WHEN (SELECT pass_count FROM tests WHERE id=?) > 0 AND (SELECT status FROM tests WHERE id=?) NOT IN ('WARN','FAIL') THEN 'PASS' ELSE status END WHERE id=?;" test-id test-id test-id test-id)) (define (db:get-prev-tol-for-test db test-id category variable) ;; Finish me? (values #f #f #f)) ;;====================================================================== ;; S T E P S ;;====================================================================== (define (db:step-get-time-as-string vec) (seconds->time-string (db:step-get-event_time vec))) ;; db-get-test-steps-for-run (define (db:get-steps-for-test db test-id) (let ((res '())) (sqlite3:for-each-row (lambda (id test-id stepname state status event-time logfile) (set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "")) res))) |
︙ | ︙ | |||
660 661 662 663 664 665 666 | ", get-status: " (db:step-get-status step)) (if (and (number? startt)(number? endt)) (seconds->hr-min-sec (- endt startt)) "-1"))) (if (> (string-length (db:step-get-logfile step)) 0) (vector-set! record 5 (db:step-get-logfile step)))) (else | | | | | 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 | ", get-status: " (db:step-get-status step)) (if (and (number? startt)(number? endt)) (seconds->hr-min-sec (- endt startt)) "-1"))) (if (> (string-length (db:step-get-logfile step)) 0) (vector-set! record 5 (db:step-get-logfile step)))) (else (vector-set! record 2 (db:step-get-state step)) (vector-set! record 3 (db:step-get-status step)) (vector-set! record 4 (db:step-get-event_time step)))) (hash-table-set! res (db:step-get-stepname step) record) (debug:print 6 "record(after) = " record "\nid: " (db:step-get-id step) "\nstepname: " (db:step-get-stepname step) "\nstate: " (db:step-get-state step) "\nstatus: " (db:step-get-status step) "\ntime: " (db:step-get-event_time step)))) |
︙ | ︙ | |||
697 698 699 700 701 702 703 704 705 706 707 708 709 710 | (if (not (and (equal? (db:test-get-state test) "COMPLETED") (member (db:test-get-status test) '("PASS" "WARN" "CHECK")))) (set! result (cons waitontest-name result)))))) tests) (if (not ever-seen)(set! result (cons waitontest-name result))))) waiton) (delete-duplicates result)))) ;;====================================================================== ;; Extract ods file from the db ;;====================================================================== ;; runspatt is a comma delimited list of run patterns ;; keypatt-alist must contain *all* keys with an associated pattern: '( ("KEY1" "%") .. ) | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | (if (not (and (equal? (db:test-get-state test) "COMPLETED") (member (db:test-get-status test) '("PASS" "WARN" "CHECK")))) (set! result (cons waitontest-name result)))))) tests) (if (not ever-seen)(set! result (cons waitontest-name result))))) waiton) (delete-duplicates result)))) ;; the new prereqs calculation, looks also at itempath if specified ;; all prereqs must be met: ;; if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAIVED then prereq is met ;; if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met (define (db:get-prereqs-not-met db run-id waitons ref-item-path) (if (or (not waitons) (null? waitons)) '() (let* ((unmet-pre-reqs '()) (result '())) (for-each (lambda (waitontest-name) ;; by getting the tests with matching name we are looking only at the matching test ;; and related sub items (let ((tests (db-get-tests-for-run db run-id waitontest-name #f '() '())) (ever-seen #f) (parent-waiton-met #f) (item-waiton-met #f)) (for-each (lambda (test) ;; (if (equal? waitontest-name (db:test-get-testname test)) ;; by defintion this had better be true ... (let* ((state (db:test-get-state test)) (status (db:test-get-status test)) (item-path (db:test-get-item-path test)) (is-completed (equal? state "COMPLETED")) (is-ok (member status '("PASS" "WARN" "CHECK" "WAIVED"))) (same-itempath (equal? ref-item-path item-path))) (set! ever-seen #t) (cond ;; case 1, non-item (parent test) is ((and (equal? item-path "") ;; this is the parent test is-completed is-ok) (set! parent-waiton-met #t)) ((and same-itempath is-completed is-ok) (set! item-waiton-met #t))))) tests) (if (not (or parent-waiton-met item-waiton-met)) (set! result (cons waitontest-name result))) ;; if the test is not found then clearly the waiton is not met... (if (not ever-seen)(set! result (cons waitontest-name result))))) waitons) (delete-duplicates result)))) ;;====================================================================== ;; Extract ods file from the db ;;====================================================================== ;; runspatt is a comma delimited list of run patterns ;; keypatt-alist must contain *all* keys with an associated pattern: '( ("KEY1" "%") .. ) |
︙ | ︙ | |||
734 735 736 737 738 739 740 | "Diskfree" ; 16 "Uname" ; 17 "Rundir" ; 18 "Host" ; 19 "Cpu Load" ; 20 ))) (results (list runsheader)) | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | 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 | "Diskfree" ; 16 "Uname" ; 17 "Rundir" ; 18 "Host" ; 19 "Cpu Load" ; 20 ))) (results (list runsheader)) (testdata-header (list "Run Id" "Testname" "Item Path" "Category" "Variable" "Value" "Expected" "Tol" "Units" "Status" "Comment")) (mainqry (conc "SELECT t.testname,r.id,runname," keysstr ",t.testname, t.item_path,tm.description,t.state,t.status, final_logf,run_duration, strftime('%m/%d/%Y %H:%M:%S',datetime(t.event_time,'unixepoch'),'localtime'), tm.tags,r.owner,t.comment, author, tm.owner,reviewed, diskfree,uname,rundir, host,cpuload FROM tests AS t JOIN runs AS r ON t.run_id=r.id JOIN test_meta AS tm ON tm.testname=t.testname WHERE runname LIKE ? AND " keyqry ";"))) (debug:print 2 "Using " tempdir " for constructing the ods file. keyqry: " keyqry " keystr: " keysstr " with keys: " (map cadr keypatt-alist) "\n mainqry: " mainqry) ;; "Expected Value" ;; "Value Found" ;; "Tolerance" (apply sqlite3:for-each-row (lambda (test-id . b) (set! test-ids (cons test-id test-ids)) ;; test-id is now testname (set! results (append results ;; note, drop the test-id (list (if pathmod (let* ((vb (apply vector b)) (keyvals (let loop ((i 0) (res '())) (if (>= i numkeys) res (loop (+ i 1) (append res (list (vector-ref vb (+ i 2)))))))) (runname (vector-ref vb 1)) (testname (vector-ref vb (+ 2 numkeys))) (item-path (vector-ref vb (+ 3 numkeys))) (final-log (vector-ref vb (+ 7 numkeys))) (run-dir (vector-ref vb (+ 18 numkeys))) (log-fpath (conc run-dir "/" final-log))) ;; (string-intersperse keyvals "/") "/" testname "/" item-path "/" (debug:print 4 "log: " log-fpath " exists: " (file-exists? log-fpath)) (vector-set! vb (+ 7 numkeys) (if (file-exists? log-fpath) (let ((newpath (conc pathmod "/" (string-intersperse keyvals "/") "/" runname "/" testname "/" (if (string=? item-path "") "" (conc "/" item-path)) final-log))) ;; for now throw away newpath and use the log-fpath conc'd with pathmod (set! newpath (conc pathmod log-fpath)) (if windows (string-translate newpath "/" "\\") newpath)) (if (> *verbosity* 1) (conc final-log " not-found") ""))) (vector->list vb)) b))))) db mainqry runspatt (map cadr keypatt-alist)) (debug:print 2 "Found " (length test-ids) " records") (set! results (list (cons "Runs" results))) ;; now, for each test, collect the test_data info and add a new sheet (for-each (lambda (test-id) (let ((test-data (list testdata-header)) (curr-test-name #f)) (sqlite3:for-each-row |
︙ | ︙ | |||
814 815 816 817 818 819 820 | (ods:list->ods tempdir (if (string-match (regexp "^[/~]+.*") outputfile) ;; full path? outputfile (begin (debug:print 0 "WARNING: path given, " outputfile " is relative, prefixing with current directory") (conc (current-directory) "/" outputfile))) | | > > | 882 883 884 885 886 887 888 889 890 891 892 893 | (ods:list->ods tempdir (if (string-match (regexp "^[/~]+.*") outputfile) ;; full path? outputfile (begin (debug:print 0 "WARNING: path given, " outputfile " is relative, prefixing with current directory") (conc (current-directory) "/" outputfile))) results) ;; brutal clean up (system "rm -rf tempdir"))) ;; (db:extract-ods-file db "outputfile.ods" '(("sysname" "%")("fsname" "%")("datapath" "%")) "%") |
Modified db_records.scm from [e1374dd7ef] to [c935a2b5a6].
︙ | ︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | (define-inline (db:test-data-get-variable vec) (vector-ref vec 3)) (define-inline (db:test-data-get-value vec) (vector-ref vec 4)) (define-inline (db:test-data-get-expected vec) (vector-ref vec 5)) (define-inline (db:test-data-get-tol vec) (vector-ref vec 6)) (define-inline (db:test-data-get-units vec) (vector-ref vec 7)) (define-inline (db:test-data-get-comment vec) (vector-ref vec 8)) (define-inline (db:test-data-get-status vec) (vector-ref vec 9)) ;;====================================================================== ;; S T E P S ;;====================================================================== ;; Run steps ;; make-vector-record "Run steps" db step id test_id stepname step_complete step_pass event_time (define (make-db:step)(make-vector 7)) | > | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | (define-inline (db:test-data-get-variable vec) (vector-ref vec 3)) (define-inline (db:test-data-get-value vec) (vector-ref vec 4)) (define-inline (db:test-data-get-expected vec) (vector-ref vec 5)) (define-inline (db:test-data-get-tol vec) (vector-ref vec 6)) (define-inline (db:test-data-get-units vec) (vector-ref vec 7)) (define-inline (db:test-data-get-comment vec) (vector-ref vec 8)) (define-inline (db:test-data-get-status vec) (vector-ref vec 9)) (define-inline (db:test-data-get-type vec) (vector-ref vec 10)) ;;====================================================================== ;; S T E P S ;;====================================================================== ;; Run steps ;; make-vector-record "Run steps" db step id test_id stepname step_complete step_pass event_time (define (make-db:step)(make-vector 7)) |
︙ | ︙ |
Modified docs/html/dashboard-test.png from [cce50d0681] to [ebb55ccc44].
cannot compute difference between binary files
Modified docs/html/dashboard.png from [d9430cd2eb] to [b70293a297].
cannot compute difference between binary files
Modified docs/html/megatest.html from [6792205dc7] to [8244fd728a].
1 2 3 4 5 6 | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="generator" content="http://www.nongnu.org/elyxer/"/> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="generator" content="http://www.nongnu.org/elyxer/"/> <meta name="create-date" content="2011-12-15"/> <link rel="stylesheet" href="http://elyxer.nongnu.org/lyx.css" type="text/css" media="all"/> <title>Megatest User Manual</title> </head> <body> <div id="globalWrapper"> <div class="Standard"> </div> |
︙ | ︙ | |||
25 26 27 28 29 30 31 | <h2 class="author"> Matthew Welland </h2> <h2 class="Date"> Sept. 20, </h2> <div class="Standard"> | | | | < < < < < < | | | | | | | | | | < | < < > > > | 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 | <h2 class="author"> Matthew Welland </h2> <h2 class="Date"> Sept. 20, </h2> <div class="Standard"> <span class="unknown">\thispagestyle</span>empty </div> <div class="Standard"> <p><br/> </p> ©2011 Matthew Welland. All rights reserved. </div> <div class="Standard"> Megatest is free software released under the General Public License v2.0. Please see the file COPYING in the source distribution for details. </div> <div class="Standard"> <div class="medskip"> </div>Email: matt@kiatoa.com. </div> <div class="Standard"> Web: www.kiatoa.com/fossils/megatest </div> <div class="Standard"> <div class="medskip"> </div>This document is believed to be acurate at the time of writing but as with any opensource project the source code itself is the reference. It is the responsibility of the end user to validate that the code will perform as they expect. The author assumes no responsibility for any inaccuracies that this document may contain. In no event will Matthew Welland be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. </div> <div class="Standard"> This document is a snapshot in time and Megatest software has likely changed since publication. This document and Megatest may be improved at any time, without notice or obligation. </div> <div class="Standard"> <p><br/> </p> </div> <h1 class="Section-"> <a class="toc" name="toc-Section--1"></a>Megatest/document Revision History </h1> <div class="Standard"> <i>Notable revisions of the software are occasionally documented here</i>. </div> <div class="Standard"> <div class="center"> <table> <tr> <td align="center" valign="top" style="width: 0.5in;"> Version </td> <td align="center" valign="top" style="width: 0.5in;"> Author </td> <td align="justify" valign="top" style="width: 3in;"> Description </td> <td align="center" valign="top" style="width: 1in;"> Date </td> </tr> <tr> <td align="center" valign="top" style="width: 0.5in;"> v1.25 </td> <td align="center" valign="top" style="width: 0.5in;"> matt </td> <td align="justify" valign="top" style="width: 3in;"> converted to new document template </td> <td align="center" valign="top" style="width: 1in;"> <span class="unknown">\thedate</span> </td> </tr> </table> </div> </div> <div class="Standard"> <p><br/> </p> <div class="fulltoc"> <div class="tocheader"> Table of Contents </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Section--1">Section: Megatest/document Revision History</a> |
︙ | ︙ | |||
160 161 162 163 164 165 166 | <a class="Link" href="#toc-Subsection-3.5">Subsection 3.5: Create your test running script, main.sh</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-3.6">Subsection 3.6: Run megatest and watch your run progress</a> </div> </div> <div class="toc"> | | > > > | | | | | | | > > > > | | > > | | | > | | > > | > | > > > > | | | | > | > | | | > > > > > > | | | | | | | | > > | | | | 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 | <a class="Link" href="#toc-Subsection-3.5">Subsection 3.5: Create your test running script, main.sh</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-3.6">Subsection 3.6: Run megatest and watch your run progress</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-4">Section 4: Choose Flow or Unstructured Run?</a> </div> <div class="toc"> <a class="Link" href="#toc-Section-5">Section 5: How to Write Tests</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-5.1">Subsection 5.1: A Simple Test with one Step</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-5.2">Subsection 5.2: Create your testconfig file</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-5.3">Subsection 5.3: Create the main.csh script</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-5.4">Subsection 5.4: Simple Test with Multiple Steps </a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-6">Section 6: Simple Test with Multiple Steps, Some in Parallel</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-6.1">Subsection 6.1: The Makefile</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-6.2">Subsection 6.2: The main.csh file</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-7">Section 7: Simple Test with Iteration</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-7.1">Subsection 7.1: Update your testconfig file for iteration</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-7.2">Subsection 7.2: Rewrite your main.csh for iteration</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-7.3">Subsection 7.3: Tests with Inter-test dependencies</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-7.4">Subsection 7.4: Rolling up Miscellaneous Data</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-7.5">Subsection 7.5: Rolling up Runs</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-8">Section 8: Dashboard</a> </div> <div class="toc"> <a class="Link" href="#toc-Section-9">Section 9: Generating an OpenDocument Spreadsheet from the Database</a> </div> <div class="toc"> <a class="Link" href="#toc-Section-10">Section 10: Flows</a> </div> <div class="toc"> <a class="Link" href="#toc-Section-11">Section 11: Flow Specification and Running (Not released yet)</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-11.1">Subsection 11.1: Write your flow file</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-11.2">Subsection 11.2: Run the flow</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-12">Section 12: Monitor based running</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-12.1">Subsection 12.1: Monitor logic</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Section-13">Section 13: Reference</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsection-13.1">Subsection 13.1: Configuration file Syntax</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.1.1">Subsubsection 13.1.1: Sections</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.1.2">Subsubsection 13.1.2: Variables</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.1.3">Subsubsection 13.1.3: Includes</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.1.4">Subsubsection 13.1.4: Setting a variable by running a command</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.1.5">Subsubsection 13.1.5: Notes</a> </div> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-13.2">Subsection 13.2: Environment variables</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-13.3">Subsection 13.3: megatest.config</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-13.4">Subsection 13.4: runconfigs.config file</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsection-13.5">Subsection 13.5: Writing tests</a> </div> <div class="tocindent"> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.5.1">Subsubsection 13.5.1: testconfig file</a> </div> <div class="toc"> <a class="Link" href="#toc-Subsubsection-13.5.2">Subsubsection 13.5.2: Command line</a> </div> </div> </div> <div class="toc"> <a class="Link" href="#toc-Appendix-A">Appendix A: Data</a> </div> <div class="toc"> <a class="Link" href="#toc-Appendix-B">Appendix B: References</a> </div> </div> </div> </div> <div class="Standard"> <p><br/> </p> </div> <h1 class="Section"> <a class="toc" name="toc-Section-1">1</a> Introduction </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-1.1">1.1</a> Megatest design philosophy </h2> <div class="Standard"> Megatest is intended to provide the minimum needed resources to make writing a suite of tests and implementing continuous build for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-1.2">1.2</a> Megatest architecture </h2> <div class="Standard"> All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database. </div> <h1 class="Section"> <a class="toc" name="toc-Section-2">2</a> Installation </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-2.1">2.1</a> Dependencies </h2> <div class="Standard"> Chicken scheme and a number of “eggs” are required for building megatest. See the file utils/installall.sh for an automated way to install the dependencies on Linux. </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-2.2">2.2</a> Build and Install </h2> <div class="Standard"> Run “make test” to create the megatest executable. You may wish to copy the executable to a centrally accessible location. </div> |
︙ | ︙ | |||
406 407 408 409 410 411 412 | dashboard & </pre> </div> </div> <h1 class="Section"> | | > > > > > > | | | | 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 | dashboard & </pre> </div> </div> <h1 class="Section"> <a class="toc" name="toc-Section-4">4</a> Choose Flow or Unstructured Run? </h1> <div class="Standard"> A flow is a structured and specifically sequenced set of tests. See the Flows chapter to understand the difference. </div> <h1 class="Section"> <a class="toc" name="toc-Section-5">5</a> How to Write Tests </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-5.1">5.1</a> A Simple Test with one Step </h2> <div class="Standard"> <div class="listing"> <pre class="listing">mkdir simpletest cd simpletest </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-5.2">5.2</a> Create your testconfig file </h2> <div class="Standard"> <div class="listing"> <pre class="listing"># testconfig [setup] runscript main.csh </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-5.3">5.3</a> Create the main.csh script </h2> <div class="Standard"> Note: Using csh is NOT recommended. Use bash, perl, ruby, zsh or anything other than csh. We use csh here because it is popular in the EDA industry for which Megatest was originally created. </div> <div class="Standard"> <div class="left"> <div class="listing"> |
︙ | ︙ | |||
460 461 462 463 464 465 466 | </div> </div> <div class="Standard"> You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox. </div> <h2 class="Subsection"> | | | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | </div> </div> <div class="Standard"> You can now run megatest and the created test directory will contain the new files “run_simulation.html” and “run_simulation.log”. If you are using the dashboard you can click on the run and then push the “View log” button to view the log file in firefox. </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-5.4">5.4</a> Simple Test with Multiple Steps </h2> <div class="Standard"> To run multiple steps simply add them to the main.csh file. Here we add a step to test “cpu2”. The second step that tests cpu2 will only run after the step that tested “cpu1” completes. </div> <div class="Standard"> <div class="listing"> <pre class="listing">#!/bin/tcsh -x |
︙ | ︙ | |||
482 483 484 485 486 487 488 | $MT_MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2" $MT_MEGATEST -test-status :state COMPLETED :status $? </pre> </div> </div> <h1 class="Section"> | | | | | | | | | | 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 | $MT_MEGATEST -runstep run_simulation_cpu2 -logpro runsim.logpro "runsim cpu2" $MT_MEGATEST -test-status :state COMPLETED :status $? </pre> </div> </div> <h1 class="Section"> <a class="toc" name="toc-Section-6">6</a> Simple Test with Multiple Steps, Some in Parallel </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-6.1">6.1</a> The Makefile </h2> <div class="Standard"> A good way to run steps in parallel within a single test, especially when there are following steps, is to use the Unix Make utility. Writing Makefiles is beyond the scope of this document but here is a minimal example that will run “runsim cpu1” and “runsim cpu2” in parallel. For more information on make try “info make” at the Linux command prompt. </div> <div class="Standard"> <div class="listing"> <pre class="listing"># Example Makefile to run two steps in parallel RTLDIR=/path/to/rtl CPUS = cpu1 cpu2 run_simulation_$(CPUS).html : $(RTLDIR)/$(CPUS) $(MT_MEGATEST) -runstep run_simulation_$(CPUS) -logpro runsim.logpro "runsim $(CPUS) </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-6.2">6.2</a> The main.csh file </h2> <div class="Standard"> <div class="listing"> <pre class="listing">#!/bin/tcsh -x # run the cpu1 and cpu2 simulations in parallel. # The -j parameter tells make how many jobs it may run in parallel <div class="left"> make -j 2 </div> $MT_MEGATEST -test-status :state COMPLETED :status $? </pre> </div> </div> <h1 class="Section"> <a class="toc" name="toc-Section-7">7</a> Simple Test with Iteration </h1> <div class="Standard"> Since no jobs run after the cpu1 and cpu2 simulations in this test it is possible to use iterated mode. </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-7.1">7.1</a> Update your testconfig file for iteration </h2> <div class="Standard"> <div class="listing"> <pre class="listing">[setup] runscript main.csh <div class="left"> </div> [items] CPU cpu1 cpu2 </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-7.2">7.2</a> Rewrite your main.csh for iteration </h2> <div class="Standard"> <div class="listing"> <pre class="listing">#!/bin/tcsh -x # run the cpu simulation but now use the environment variable $CPU # to select what cpu to run the simulation against $MT_MEGATEST -runstep run_simulation -logpro runsim.logpro "runsim $CPU" # As of version 1.07 Megatest automatically converts a status of "0" # to "PASS", any other number to "FAIL" and directly uses the value of # a string passed in. $MT_MEGATEST -test-status :state COMPLETED :status $? </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-7.3">7.3</a> Tests with Inter-test dependencies </h2> <div class="Standard"> Sometimes a test depends on the output from a previous test or it may not make sense to run a test is another test does not complete with status “PASS”. In either of these scenarios you can use the “waiton” keyword in your testconfig file to indicate that this test must wait on one or more tests to complete before being launched. In this example there is no point in running the “system” test if the “cpu” and “mem” tests either do not complete or complete but with status “FAIL”. </div> <div class="Standard"> <div class="listing"> <pre class="listing"># testconfig for the "system" test [setup] runscript main.csh waiton cpu mem </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-7.4">7.4</a> Rolling up Miscellaneous Data </h2> <div class="Standard"> Use the -load-test-data switch to roll up arbitrary data from a test into the test_data table. </div> <div class="Standard"> <div class="listing"> <pre class="listing"># Fields are: |
︙ | ︙ | |||
624 625 626 627 628 629 630 | </li> <li> If status is specified its value overrides the above calculations. </li> </ul> <h2 class="Subsection"> | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 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 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 | </li> <li> If status is specified its value overrides the above calculations. </li> </ul> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-7.5">7.5</a> Rolling up Runs </h2> <div class="Standard"> To roll up a number of tests in a sequence of runs to a single run use the -rollup command. </div> <div class="Standard"> <div class="listing"> <pre class="listing">megatest -rollup :sysname ubuntu :fsname nfs :datapath none :runname rollup_ww38 </pre> </div> </div> <div class="Standard"> All keys must be specified and the runname is the name of the run that will be created. All paths are kept original inside the database. When -remove-runs is used to delete runs the data is not deleted if there are rollups that refer to the data. </div> <h1 class="Section"> <a class="toc" name="toc-Section-8">8</a> Dashboard </h1> <div class="Standard"> <div class="listing"> <pre class="listing">> dashboard & </pre> </div> </div> <div class="Standard"> <img class="embedded" src="dashboard.png" alt="figure dashboard.png" style="width: 730px; max-width: 913px; height: 626px; max-height: 783px;"/> </div> <div class="Standard"> Pushing one of the buttons on the main dashboard will bring up the test specific dashboard. Values are updated in semi-real time as the test runs. </div> <div class="Standard"> <img class="embedded" src="dashboard-test.png" alt="figure dashboard-test.png" style="width: 643px; max-width: 804px; height: 571px; max-height: 714px;"/> </div> <h1 class="Section"> <a class="toc" name="toc-Section-9">9</a> Generating an OpenDocument Spreadsheet from the Database </h1> <div class="Standard"> And OpenDocument multi-paned spreadsheet can be generated from the megatest.db file by running -extract-ods </div> <div class="Standard"> <div class="listing"> <pre class="listing">megatest -extract-ods results.ods :runname % </pre> </div> </div> <div class="Standard"> You can optionally specify the keys for your database to limit further the runs to extract into the spreadsheet. The first sheet contains all the run data and subsequent sheets contain data rolled up for the individual tests. </div> <h1 class="Section"> <a class="toc" name="toc-Section-10">10</a> Flows </h1> <div class="Standard"> A flow specifies the tests to run, the order and dependencies and is managed by a running megatest process. </div> <h1 class="Section"> <a class="toc" name="toc-Section-11">11</a> Flow Specification and Running (Not released yet) </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-11.1">11.1</a> Write your flow file </h2> <div class="Standard"> flows/<flowname>.config </div> <div class="Standard"> <div class="listing"> <pre class="listing"># Flow: <flowname> [flowconfig] # turn on item level dependencies itemdeps on [flowsteps] # <testname>[,<predecessor>] # Run the test "copydata" copydata # Run the test "setup" after copydata completes with PASS, WARN or WAIVE setup,copydata # once the test "setup" completes successfully run sim1, sim2 and sim3 sim1,setup sim2,setup sim3,setup </pre> </div> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-11.2">11.2</a> Run the flow </h2> <div class="Standard"> <div class="listing"> <pre class="listing">megatest -runflow <flowname> :FIELD1 val1 :FIELD2 val2 :runname wk32.4 </pre> </div> </div> <h1 class="Section"> <a class="toc" name="toc-Section-12">12</a> Monitor based running </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-12.1">12.1</a> Monitor logic </h2> <div class="Standard"> Note: The monitor is usable but incomplete as of Megatest v1.31. Click on the “Monitor” button on the dashboard to start the monitor and give it a try. </div> <div class="Standard"> <img class="embedded" src="monitor-state-diagram.png" alt="figure monitor-state-diagram.png" style="max-width: 383px; max-height: 335px;"/> </div> <h1 class="Section"> <a class="toc" name="toc-Section-13">13</a> Reference </h1> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-13.1">13.1</a> Configuration file Syntax </h2> <div class="Standard"> Note: whitespace is preserved including at the end of line. Ensure your entries only have whitespace at the end of line when needed to avoid problems. </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.1.1">13.1.1</a> Sections </h3> <div class="Standard"> <div class="listing"> <pre class="listing">[section name] </pre> </div> </div> <div class="Standard"> This creates a section named “section name” </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.1.2">13.1.2</a> Variables </h3> <div class="Standard"> <div class="listing"> <pre class="listing">VARX has this value </pre> </div> </div> <div class="Standard"> The variable “VARX” will have the value “has this value” </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.1.3">13.1.3</a> Includes </h3> <div class="Standard"> <div class="listing"> <pre class="listing">[include filename] </pre> </div> </div> <div class="Standard"> The file named “filename” will be included as if part of the calling file. NOTE: This means no section can be named “include “ (with the whitespace). </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.1.4">13.1.4</a> Setting a variable by running a command </h3> <div class="Standard"> <div class="listing"> <pre class="listing">VARNAME [system ls /tmp] </pre> </div> </div> <div class="Standard"> The variable “VARNAME” will get a value created by the Unix command “ls /tmp”. All lines of output from the command will be joined with a space. </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.1.5">13.1.5</a> Notes </h3> <ul> <li> Some variables are infered as lists. Each token on the line separated by whitespace will be member of the list. </li> <li> Comments (lines starting with #) and blank lines are ignored. </li> </ul> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-13.2">13.2</a> Environment variables </h2> <div class="Standard"> <table> <tr> <td align="left" valign="top" style="width: 10%;"> Variable </td> <td align="left" valign="top" style="width: 50%;"> Purpose </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_CMDINFO </td> <td align="left" valign="top" style="width: 50%;"> Conveys test variables to the megatest test runner. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_TEST_RUN_DIR </td> <td align="left" valign="top" style="width: 50%;"> Directory assigned by megatest for the test to run. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_TEST_NAME </td> <td align="left" valign="top" style="width: 50%;"> Name of the test, corrosponds to the directory name under tests. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_ITEM_INFO </td> <td align="left" valign="top" style="width: 50%;"> Iterated tests will set this to a sequence of key/values ((KEY val) ...) </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_RUN_AREA_HOME </td> <td align="left" valign="top" style="width: 50%;"> Directory where megatest was launched from and where the tests code can be found </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_RUNNAME </td> <td align="left" valign="top" style="width: 50%;"> Name of this run as set by the :runname parameter </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> MT_MEGATEST </td> <td align="left" valign="top" style="width: 50%;"> Path/Filename to megatest executable. Found either from called path or but using the “exectuable” keyword in the [setup] section. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> <field1> .... </td> <td align="left" valign="top" style="width: 50%;"> The field values as set on the megatest -runall command line (e.g. :field1 abc) </td> </tr> </table> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-13.3">13.3</a> megatest.config </h2> <div class="Standard"> <table> <tr> <td align="left" valign="top" style="width: 10%;"> section </td> <td align="left" valign="top" style="width: 15%;"> variable </td> <td align="left" valign="top" style="width: 20%;"> value </td> <td align="left" valign="top" style="width: 6%;"> required </td> <td align="left" valign="top" style="width: 20%;"> comment </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [setup] </td> <td align="left" valign="top" style="width: 15%;"> max_concurrent_jobs </td> <td align="left" valign="top" style="width: 20%;"> if variable is not defined no limit on jobs </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> </td> <td align="left" valign="top" style="width: 15%;"> executable </td> <td align="left" valign="top" style="width: 20%;"> full path to megatest binary </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> Use only if necessary, megatest will extract the location from where it used to launch and add append that to the PATH for test runs. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> </td> <td align="left" valign="top" style="width: 15%;"> runsdir </td> <td align="left" valign="top" style="width: 20%;"> full path to where the link tree to all runs will be created </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> Because your runs may be spread out over several disk partitions a central link tree is created to make finding all the runs easy. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [fields] </td> <td align="left" valign="top" style="width: 15%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 20%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 6%;"> at least one </td> <td align="left" valign="top" style="width: 20%;"> </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [jobtools] </td> <td align="left" valign="top" style="width: 15%;"> launcher </td> <td align="left" valign="top" style="width: 20%;"> command line used to launch jobs - the job command (megatest -execute) will be appended to this </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> </td> <td align="left" valign="top" style="width: 15%;"> workhosts </td> <td align="left" valign="top" style="width: 20%;"> list of hostnames to run jobs on NOT SUPPORTED RIGHT NOW </td> <td align="left" valign="top" style="width: 6%;"> n/a </td> <td align="left" valign="top" style="width: 20%;"> </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [jobgroups] </td> <td align="left" valign="top" style="width: 15%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 20%;"> number </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> Control number of jobs allowed to concurrently run in categories. See [jobgroup] in testconfig </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [env-override] </td> <td align="left" valign="top" style="width: 15%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 20%;"> any string </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 20%;"> These are set on the test launching machine, not the test running machine. Typical usage is to control the host or run queue for launching tests. These values will not be seen by the test when it runs. </td> </tr> <tr> <td align="left" valign="top" style="width: 10%;"> [disks] </td> <td align="left" valign="top" style="width: 15%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 20%;"> a valid path writable by the test launching process and by the test process </td> <td align="left" valign="top" style="width: 6%;"> yes </td> <td align="left" valign="top" style="width: 20%;"> The disk usage balancing algorithm is to choose the disk with the least space for each test run. </td> </tr> </table> </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-13.4">13.4</a> runconfigs.config file </h2> <div class="Standard"> <table> <tr> <td align="left" valign="top" style="width: 20%;"> section </td> <td align="left" valign="top" style="width: 12%;"> variable </td> <td align="left" valign="top" style="width: 3%;"> value </td> <td align="left" valign="top" style="width: 4%;"> required? </td> <td align="left" valign="top" style="width: 30%;"> comment </td> </tr> <tr> <td align="left" valign="top" style="width: 20%;"> [default] </td> <td align="left" valign="top" style="width: 12%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 3%;"> any </td> <td align="left" valign="top" style="width: 4%;"> no </td> <td align="left" valign="top" style="width: 30%;"> variables set in this section will be available for all runs, defining the same variable in another section will override the value from the default section </td> </tr> <tr> <td align="left" valign="top" style="width: 20%;"> [field1value/field2value...] </td> <td align="left" valign="top" style="width: 12%;"> string of letters, numbers and underscore </td> <td align="left" valign="top" style="width: 3%;"> any </td> <td align="left" valign="top" style="width: 4%;"> no </td> <td align="left" valign="top" style="width: 30%;"> the values in this section will be set for any run where field1 is field1value, field2 is field2value and fieldN is fieldNvalue. </td> </tr> </table> |
︙ | ︙ | |||
1111 1112 1113 1114 1115 1116 1117 | <div class="Code"> ENCRYPTION true </div> <div class="Code"> TESTPATH /nfs/testing/megacorp_runs </div> <h2 class="Subsection"> | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > | | | | > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 | <div class="Code"> ENCRYPTION true </div> <div class="Code"> TESTPATH /nfs/testing/megacorp_runs </div> <h2 class="Subsection"> <a class="toc" name="toc-Subsection-13.5">13.5</a> Writing tests </h2> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.5.1">13.5.1</a> testconfig file </h3> <div class="Standard"> <table> <tr> <td align="left" valign="top" style="width: 8%;"> section </td> <td align="left" valign="top" style="width: 6%;"> variable </td> <td align="left" valign="top" style="width: 12%;"> value </td> <td align="left" valign="top" style="width: 6%;"> required? </td> <td align="left" valign="top" style="width: 30%;"> comments </td> </tr> <tr> <td align="left" valign="top" style="width: 8%;"> [setup] </td> <td align="left" valign="top" style="width: 6%;"> runscript </td> <td align="left" valign="top" style="width: 12%;"> name of script to execute for this test </td> <td align="left" valign="top" style="width: 6%;"> yes </td> <td align="left" valign="top" style="width: 30%;"> The script must be executable and either provide the full path or put a copy at the top of your test directory </td> </tr> <tr> <td align="left" valign="top" style="width: 8%;"> [requirements] </td> <td align="left" valign="top" style="width: 6%;"> waiton </td> <td align="left" valign="top" style="width: 12%;"> list of valid test names </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 30%;"> This test will not run until the named tests are state completed and status PASS </td> </tr> <tr> <td align="left" valign="top" style="width: 8%;"> </td> <td align="left" valign="top" style="width: 6%;"> jobgroup </td> <td align="left" valign="top" style="width: 12%;"> </td> <td align="left" valign="top" style="width: 6%;"> </td> <td align="left" valign="top" style="width: 30%;"> </td> </tr> <tr> <td align="left" valign="top" style="width: 8%;"> [items] </td> <td align="left" valign="top" style="width: 6%;"> any valid </td> <td align="left" valign="top" style="width: 12%;"> list of values </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 30%;"> The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values </td> </tr> <tr> <td align="left" valign="top" style="width: 8%;"> [eztests] </td> <td align="left" valign="top" style="width: 6%;"> any valid </td> <td align="left" valign="top" style="width: 12%;"> stepname command </td> <td align="left" valign="top" style="width: 6%;"> no </td> <td align="left" valign="top" style="width: 30%;"> Use in addition to or instead of runscript for easy implementation of steps. If <stepname>.logpro exists it will be applied to the <stepname>.log and resulting exit code will be used to determine PASS/FAIL/WARN </td> </tr> </table> </div> <h3 class="Subsubsection"> <a class="toc" name="toc-Subsubsection-13.5.2">13.5.2</a> Command line </h3> <div class="Standard"> <table> <tr> <td align="left" valign="top"> switch or param </td> <td align="left" valign="top"> parameter </td> <td align="left" valign="top" style="width: 30%;"> purpose </td> <td align="left" valign="top"> comments </td> </tr> <tr> <td align="left" valign="top"> -h </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> brief help </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -runall </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> run all tests </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -runtests </td> <td align="left" valign="top"> test1,test2,... </td> <td align="left" valign="top" style="width: 30%;"> run one or more tests </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -step </td> <td align="left" valign="top"> stepname </td> <td align="left" valign="top" style="width: 30%;"> record a step </td> <td align="left" valign="top"> requires :state and :status </td> </tr> <tr> <td align="left" valign="top"> -test-status </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> record the test status </td> <td align="left" valign="top"> requires :state and :status </td> </tr> <tr> <td align="left" valign="top"> -setlog </td> <td align="left" valign="top"> logfilename </td> <td align="left" valign="top" style="width: 30%;"> set the logfile name for a test </td> <td align="left" valign="top"> path is assumed to be relative to the test run directory </td> </tr> <tr> <td align="left" valign="top"> -set-toplog </td> <td align="left" valign="top"> logfilename </td> <td align="left" valign="top" style="width: 30%;"> set the logfile name for the top test in an iterated test run </td> <td align="left" valign="top"> each sub test can have its own logfile set </td> </tr> <tr> <td align="left" valign="top"> -m </td> <td align="left" valign="top"> “comment” </td> <td align="left" valign="top" style="width: 30%;"> sets a comment for the step, test or run </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> :runname </td> <td align="left" valign="top"> [a-zA-Z0-9_-]+ </td> <td align="left" valign="top" style="width: 30%;"> directory in which this run will be stored in the test run area </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> :state </td> <td align="left" valign="top"> any value </td> <td align="left" valign="top" style="width: 30%;"> Set the step or test state, this is stored in the state field in the steps or tests table respectively </td> <td align="left" valign="top"> For tests Megatest recognises “INCOMPLETE”, “COMPLETE” </td> </tr> <tr> <td align="left" valign="top"> :status </td> <td align="left" valign="top"> any value </td> <td align="left" valign="top" style="width: 30%;"> Set the step or test status, this is stored in the status field in the steps or tests table respectively </td> <td align="left" valign="top"> For tests Megatest recognises “PASS”, “FAIL”, and “CHECK” </td> </tr> <tr> <td align="left" valign="top"> -list-runs </td> <td align="left" valign="top"> any value, % is wildcard </td> <td align="left" valign="top" style="width: 30%;"> Respects -itempatt and -testpatt for filters </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -testpatt </td> <td align="left" valign="top"> any value, % is wildcard </td> <td align="left" valign="top" style="width: 30%;"> </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -itempatt </td> <td align="left" valign="top"> any value, % is wildcard </td> <td align="left" valign="top" style="width: 30%;"> </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -showkeys </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> Print the keys being used for this database </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -force </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> Test will not re-run if in the “PASS”, “CHECK” or “KILLED”, using -force will force the run to be launched. </td> <td align="left" valign="top"> WARNING: The -force switch will bypass any “waiton” dependencies. </td> </tr> <tr> <td align="left" valign="top"> -xterm </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> Launch an xterm instead of run the test. The xterm will have the environment that the test would see. </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -remove-runs </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> Remove a run, test or subtest from the database and the disk. Cannot be undone. Requires -testpatt, -itempatt, :runname and all keys be specified. </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> <i>Test helpers</i> </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -runstep </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> Used inside a test to run a step, record the start and end of the step and optionally analyze the output using logpro. </td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> -logpro </td> <td align="left" valign="top"> </td> <td align="left" valign="top" style="width: 30%;"> If using logpro to acess the PASS/FAIL status of the step you specify the logpro file with this parameter. </td> <td align="left" valign="top"> </td> </tr> </table> </div> <h1 class="Section"> <a class="toc" name="toc-Appendix-A">A</a> Data </h1> <h1 class="Section"> <a class="toc" name="toc-Appendix-B">B</a> References </h1> <hr class="footer"/> <div class="footer" id="generated-by"> Document generated by <a href="http://elyxer.nongnu.org/">eLyXer 1.2.2 (2011-06-12)</a> on <span class="create-date">2011-12-15T21:53:21.527506</span> </div> </div> </body> </html> |
Added docs/html/monitor-state-diagram.png version [47d4851333].
cannot compute difference between binary files
Modified docs/megatest.lyx from [d71eb3594c] to [8cf3af19a7].
︙ | ︙ | |||
283 284 285 286 287 288 289 | \end_layout \begin_layout Standard \begin_inset VSpace medskip \end_inset This document is believed to be acurate at the time of writing but as with | | < | | | | | 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 | \end_layout \begin_layout Standard \begin_inset VSpace medskip \end_inset This document is believed to be acurate at the time of writing but as with any opensource project the source code itself is the reference. It is the responsibility of the end user to validate that the code will perform as they expect. The author assumes no responsibility for any inaccuracies that this document may contain. In no event will Matthew Welland be liable for direct, indirect, special, exemplary, incidental, or consequential damages resulting from any defect or omission in this document, even if advised of the possibility of such damages. \end_layout \begin_layout Standard This document is a snapshot in time and Megatest software has likely changed since publication. This document and Megatest may be improved at any time, without notice or obligation. \end_layout \begin_layout Standard \begin_inset Newpage newpage \end_inset |
︙ | ︙ | |||
457 458 459 460 461 462 463 | \begin_layout Subsection Megatest design philosophy \end_layout \begin_layout Standard Megatest is intended to provide the minimum needed resources to make writing | > | | < < | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | \begin_layout Subsection Megatest design philosophy \end_layout \begin_layout Standard Megatest is intended to provide the minimum needed resources to make writing a suite of tests and implementing continuous build for software, design engineering or process control (via owlfs for example) without being specialize d for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. \end_layout \begin_layout Subsection Megatest architecture \end_layout \begin_layout Standard |
︙ | ︙ | |||
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 | \begin_layout Section Monitor based running \end_layout \begin_layout Subsection Monitor logic \end_layout \begin_layout Standard \begin_inset Graphics filename monitor-state-diagram.svg \end_inset \end_layout \begin_layout Section Reference \end_layout \begin_layout Subsection Configuration file Syntax \end_layout \begin_layout Subsubsection Sections \end_layout \begin_layout Standard \begin_inset listings | > > > > > > > > > > > > > > > > > > > | 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 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 | \begin_layout Section Monitor based running \end_layout \begin_layout Subsection Monitor logic \end_layout \begin_layout Standard Note: The monitor is usable but incomplete as of Megatest v1.31. Click on the \begin_inset Quotes eld \end_inset Monitor \begin_inset Quotes erd \end_inset button on the dashboard to start the monitor and give it a try. \end_layout \begin_layout Standard \begin_inset Graphics filename monitor-state-diagram.svg \end_inset \end_layout \begin_layout Section Reference \end_layout \begin_layout Subsection Configuration file Syntax \end_layout \begin_layout Standard Note: whitespace is preserved including at the end of line. Ensure your entries only have whitespace at the end of line when needed to avoid problems. \end_layout \begin_layout Subsubsection Sections \end_layout \begin_layout Standard \begin_inset listings |
︙ | ︙ | |||
2006 2007 2008 2009 2010 2011 2012 | \begin_layout Subsection megatest.config \end_layout \begin_layout Standard \begin_inset Tabular | | | 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 | \begin_layout Subsection megatest.config \end_layout \begin_layout Standard \begin_inset Tabular <lyxtabular version="3" rows="10" columns="5"> <features tabularvalignment="middle" tabularwidth="80page%"> <column alignment="left" valignment="top" width="10page%"> <column alignment="left" valignment="top" width="15page%"> <column alignment="left" valignment="top" width="20page%"> <column alignment="left" valignment="top" width="6page%"> <column alignment="left" valignment="top" width="20page%"> <row> |
︙ | ︙ | |||
2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 | <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> </row> <row> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 | <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> </row> <row> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout [jobgroups] \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout string of letters, numbers and underscore \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout number \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout no \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout Control number of jobs allowed to concurrently run in categories. See [jobgroup] in testconfig \end_layout \end_inset </cell> </row> <row> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text |
︙ | ︙ | |||
2741 2742 2743 2744 2745 2746 2747 | \begin_layout Subsubsection testconfig file \end_layout \begin_layout Standard \begin_inset Tabular | | | 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 | \begin_layout Subsubsection testconfig file \end_layout \begin_layout Standard \begin_inset Tabular <lyxtabular version="3" rows="6" columns="5"> <features tabularvalignment="middle" tabularwidth="80page%"> <column alignment="left" valignment="top" width="8page%"> <column alignment="left" valignment="top" width="6page%"> <column alignment="left" valignment="top" width="12page%"> <column alignment="left" valignment="top" width="6page%"> <column alignment="left" valignment="top" width="30page%"> <row> |
︙ | ︙ | |||
2892 2893 2894 2895 2896 2897 2898 | PASS \end_layout \end_inset </cell> </row> <row> | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | < | 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 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 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 3109 3110 | PASS \end_layout \end_inset </cell> </row> <row> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout jobgroup \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout \end_layout \end_inset </cell> </row> <row> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout [items] \end_layout \end_inset </cell> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout any valid \end_layout \end_inset </cell> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout list of values \end_layout \end_inset </cell> <cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout no \end_layout \end_inset </cell> <cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values \end_layout \end_inset </cell> </row> <row> <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout [eztests] \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout any valid \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout stepname command \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout no \end_layout \end_inset </cell> <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout Use in addition to or instead of runscript for easy implementation of steps. If <stepname>.logpro exists it will be applied to the <stepname>.log and resulting exit code will be used to determine PASS/FAIL/WARN \end_layout \end_inset </cell> </row> </lyxtabular> |
︙ | ︙ | |||
3868 3869 3870 3871 3872 3873 3874 | \end_inset </cell> <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout | | | 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 | \end_inset </cell> <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> \begin_inset Text \begin_layout Plain Layout If using logpro to acess the PASS/FAIL status of the step you specify the logpro file with this parameter. \end_layout \end_inset </cell> <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> \begin_inset Text |
︙ | ︙ |
Added docs/monitor-state-diagram.svg version [5c370cf9de].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="382.82721" height="334.97675" id="svg2" version="1.1" inkscape:version="0.48.1 r9760" sodipodi:docname="monitor-state-diagram.svg"> <defs id="defs4"> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend" style="overflow:visible"> <path id="path3777" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-8" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-9" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-9" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-5" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-4" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-8" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-7" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-2" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-2" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-26" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.0240234" inkscape:cx="197.40711" inkscape:cy="50.784201" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1336" inkscape:window-height="907" inkscape:window-x="405" inkscape:window-y="31" inkscape:window-maximized="0" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" /> <metadata id="metadata7"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title /> </cc:Work> </rdf:RDF> </metadata> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-88.36515,-238.40424)"> <text xml:space="preserve" style="font-size:18px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="119.1379" y="302.37936" id="text2985" sodipodi:linespacing="125%"><tspan sodipodi:role="line" id="tspan2987" x="119.1379" y="302.37936">New</tspan></text> <text xml:space="preserve" style="font-size:18px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="171.87106" y="404.91605" id="text2989" sodipodi:linespacing="125%"><tspan sodipodi:role="line" id="tspan2991" x="171.87106" y="404.91605">processing</tspan></text> <text xml:space="preserve" style="font-size:18px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="344.71866" y="408.8222" id="text2993" sodipodi:linespacing="125%"><tspan sodipodi:role="line" id="tspan2995" x="344.71866" y="408.8222">waiting</tspan></text> <text xml:space="preserve" style="font-size:18px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="175.77724" y="530.88977" id="text2997" sodipodi:linespacing="125%"><tspan sodipodi:role="line" id="tspan2999" x="175.77724" y="530.88977">done</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 168.94145,296.52011 c 50.03998,8.38374 51.51168,48.28767 51.75662,85.93553" id="path3001" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 222.64982,413.70493 c -1.71665,59.16383 -23.68191,54.14691 -24.41351,96.67747" id="path3001-2" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 238.76406,415.04172 c 45.26369,68.23333 101.21533,61.78246 141.59833,-1.95308" id="path3001-2-0-7-7" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="M 379.38586,385.25271 C 334.12217,317.01938 278.17053,323.47025 237.78753,387.20579" id="path3001-2-0-7-7-1" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <rect style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect4335" width="381.82721" height="333.97675" x="88.86515" y="238.90424" /> </g> </svg> |
Added docs/test-launch-state-diagram.svg version [6e88c87b22].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="382.82721" height="334.97675" id="svg2" version="1.1" inkscape:version="0.48.2 r9819" sodipodi:docname="test-launch-state-diagram.svg"> <defs id="defs4"> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend" style="overflow:visible"> <path id="path3777" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-8" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-9" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-9" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-5" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-4" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-8" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-7" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-2" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-2" style="overflow:visible"> <path inkscape:connector-curvature="0" id="path3777-26" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-5" style="overflow:visible"> <path id="path3777-97" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-88" style="overflow:visible"> <path id="path3777-50" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-85" style="overflow:visible"> <path id="path3777-6" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-44" style="overflow:visible"> <path id="path3777-7" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-75" style="overflow:visible"> <path id="path3777-96" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-57" style="overflow:visible"> <path id="path3777-4" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-59" style="overflow:visible"> <path id="path3777-75" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-0" style="overflow:visible"> <path id="path3777-48" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> <marker inkscape:stockid="Arrow1Lend" orient="auto" refY="0" refX="0" id="Arrow1Lend-89" style="overflow:visible"> <path id="path3777-77" d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" transform="matrix(-0.8,0,0,-0.8,-10,0)" inkscape:connector-curvature="0" /> </marker> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4481878" inkscape:cx="234.81903" inkscape:cy="169.96344" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="973" inkscape:window-height="687" inkscape:window-x="272" inkscape:window-y="30" inkscape:window-maximized="0" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" /> <metadata id="metadata7"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title /> </cc:Work> </rdf:RDF> </metadata> <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-88.36515,-238.40424)"> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="135.60928" y="298.95386" id="text2985" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394803)"><tspan sodipodi:role="line" id="tspan2987" x="135.60928" y="298.95386">get test</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 176.36623,295.35828 c 59.16525,-0.58879 77.47792,18.54001 82.13592,35.53794" id="path3001" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <rect style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect4335" width="381.82721" height="333.97675" x="88.86515" y="238.90424" /> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="126.26069" y="288.2449" id="text2985-7" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-2" x="126.26069" y="288.2449">(Tests list)</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="234.48593" y="344.24658" id="text2985-0" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-6" x="234.48593" y="344.24658">items list?</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="230.46114" y="357.51541" id="text2985-5" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-9" x="230.46114" y="357.51541">string</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="268.80106" y="357.02417" id="text2985-4" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90" x="268.80106" y="357.02417">proc</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="303.25842" y="356.04172" id="text2985-9" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-1" x="303.25842" y="356.04172">list</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="199.40099" y="357.0242" id="text2985-77" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" x="199.40099" y="357.0242" id="tspan3116">#f</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 208.18134,362.26964 c 5.9438,28.21915 -7.96935,38.07082 -9.1706,63.85761" id="path3001-7" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="157.41812" y="439.9064" id="text2985-4-6" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-7" x="157.41812" y="439.9064">all prerequisites met?</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="171.97758" y="451.69623" id="text2985-4-2" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-9" x="171.97758" y="451.69623">no</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="208.86153" y="451.20499" id="text2985-4-3" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-90" x="208.86153" y="451.20499">yes</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 171.17455,448.19855 c -60.9492,14.05932 -70.95619,-114.75772 -41.39643,-156.3522" id="path3001-7-9" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="199.94124" y="535.69879" id="text2985-4-3-6" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-90-3" x="199.94124" y="535.69879">launch and drop test record</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 218.04848,453.08125 c -0.40371,25.28953 25.23302,35.62947 27.93793,67.2755" id="path3001-7-1" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 314.05701,358.60098 c 10.33823,35.05494 42.32247,37.09428 50.88663,2.33557" id="path3001-7-1-6" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="331.94305" y="344.87405" id="text2985-4-3-6-3" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-90-3-1" x="331.94305" y="344.87405">create records</tspan><tspan sodipodi:role="line" x="331.94305" y="355.94327" id="tspan3297">and add to tests list</tspan></text> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="M 362.32596,330.83471 C 348.25067,277.51275 294.29939,275.64594 178.84294,287.2729" id="path3001-7-9-2" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 245.87987,358.35685 c 4.16667,48.51677 -23.10149,23.92638 -29.18967,67.2755" id="path3001-7-18" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 282.50013,359.82166 c 3.50245,39.44937 26.69783,25.86407 26.96139,65.32242" id="path3001-7-3" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="281.47418" y="439.41516" id="text2985-4-3-8" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" x="281.47418" y="439.41516" id="tspan3392">waiton prerequites met?</tspan><tspan sodipodi:role="line" x="281.47418" y="447.63828" id="tspan3396" style="font-size:6px">(waitonbyitem prerequisites</tspan><tspan sodipodi:role="line" x="281.47418" y="455.13828" id="tspan3398" style="font-size:6px">do not have to be met)</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="281.47418" y="467.41602" id="text2985-4-3-3" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-90-33" x="281.47418" y="467.41602">yes</tspan></text> <text xml:space="preserve" style="font-size:8.85538006px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="333.83432" y="467.78305" id="text2985-4-2-8" sodipodi:linespacing="125%" transform="scale(1.0060888,0.99394804)"><tspan sodipodi:role="line" id="tspan2987-90-9-6" x="333.83432" y="467.78305">no</tspan></text> <rect style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3442" width="133.29773" height="13.183292" x="191.19385" y="343.89999" /> <rect style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3444" width="68.357811" height="14.648103" x="163.85072" y="438.13614" /> <rect style="opacity:0.17254902;fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3446" width="79.588028" height="14.648103" x="276.64111" y="455.22559" /> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="m 291.59658,468.46176 c -0.40371,25.28953 -41.65998,22.44618 -38.95507,54.09221" id="path3001-7-1-8" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <path style="fill:none;stroke:#000000;stroke-width:0.6175037px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" d="M 352.59293,462.5344 C 463.88305,449.42673 457.66893,360.39971 423.6028,314.11153 385.94041,262.93686 286.98748,259.03373 177.4105,277.86252" id="path3001-7-1-6-6" inkscape:connector-curvature="0" sodipodi:nodetypes="csc" /> </g> </svg> |
Modified items.scm from [efcc75596f] to [d370c880ec].
︙ | ︙ | |||
115 116 117 118 119 120 121 | (set! res (append res (list item))) (loop (+ indx 1) '() #f))) res))) ;; Nope, not now, return null as of 6/6/2011 | > > > > > > > | > > > > > > > > > > > > > > > > > > > > | 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 | (set! res (append res (list item))) (loop (+ indx 1) '() #f))) res))) ;; Nope, not now, return null as of 6/6/2011 (define (check-valid-items class item) (let ((valid-values (let ((s (config-lookup *configdat* "validvalues" class))) (if s (string-split s) #f)))) (if valid-values (if (member item valid-values) item #f) item))) (define (items:get-items-from-config tconfig) (let* (;; db is always at *toppath*/db/megatest.db (items (hash-table-ref/default tconfig "items" '())) (itemstable (hash-table-ref/default tconfig "itemstable" '()))) (debug:print 5 "items: " items " itemstable: " itemstable) (set! items (map (lambda (item) (if (procedure? (cadr item)) (list (car item)((cadr item))) item)) items)) (set! itemstable (map (lambda (item) (if (procedure? (cadr item)) (list (car item)((cadr item))) item)) itemstable)) (if (or (not (null? items))(not (null? itemstable))) (append (item-assoc->item-list items) (item-table->item-list itemstable)) '(())))) ;; (pp (item-assoc->item-list itemdat)) |
Modified key_records.scm from [46a3b150ea] to [9216cfc587].
︙ | ︙ | |||
17 18 19 20 21 22 23 | (define-inline (keys->key/field keys . additional) (string-join (map (lambda (k)(conc (key:get-fieldname k) " " (key:get-fieldtype k))) (append keys additional)) ",")) (define-inline (item-list->path itemdat) | > | > | 17 18 19 20 21 22 23 24 25 26 27 | (define-inline (keys->key/field keys . additional) (string-join (map (lambda (k)(conc (key:get-fieldname k) " " (key:get-fieldtype k))) (append keys additional)) ",")) (define-inline (item-list->path itemdat) (if (list? itemdat) (string-intersperse (map cadr itemdat) "/") "")) |
Modified launch.scm from [1748d73246] to [a165297934].
︙ | ︙ | |||
166 167 168 169 170 171 172 | (logpro-used #f)) ;; NB// can safely assume we are in test-area directory (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts " stepparms: " stepparms " stepcmd: " stepcmd) (if (file-exists? (conc stepname ".logpro"))(set! logpro-used #t)) | | | > | | | | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | (logpro-used #f)) ;; NB// can safely assume we are in test-area directory (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts " stepparms: " stepparms " stepcmd: " stepcmd) (if (file-exists? (conc stepname ".logpro"))(set! logpro-used #t)) ;; ;; first source the previous environment ;; (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") ;; (get-environment-variable "SHELL")) ".csh" ".sh")))) ;; (if (and prevstep (file-exists? prev-env)) ;; (set! script (conc script "source " prev-env)))) ;; call the command using mt_ezstep (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "-") " " stepcmd)) (debug:print 4 "script: " script) (teststep-set-status! db run-id test-name stepname "start" "-" itemdat #f #f) ;; now launch (let ((pid (process-run script))) (let processloop ((i 0)) |
︙ | ︙ | |||
214 215 216 217 218 219 220 | (else 'fail)))) (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used " this-step-status: " this-step-status " overall-status: " overall-status " next-status: " next-status " rollup-status: " rollup-status) (case next-status ((warn) (set! rollup-status 2) | | > | > | > > | 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 | (else 'fail)))) (debug:print 4 "Exit value received: " (vector-ref exit-info 2) " logpro-used: " logpro-used " this-step-status: " this-step-status " overall-status: " overall-status " next-status: " next-status " rollup-status: " rollup-status) (case next-status ((warn) (set! rollup-status 2) ;; (test-set-status! db run-id test-name "COMPLETED" "WARN" itemdat (test-set-status! db run-id test-name "RUNNING" "WARN" itemdat (if (eq? this-step-status 'warn) "Logpro warning found" #f) #f)) ((pass) ;; (test-set-status! db run-id test-name "COMPLETED" "PASS" itemdat #f #f)) (test-set-status! db run-id test-name "RUNNING" "PASS" itemdat #f #f)) (else ;; 'fail (set! rollup-status 1) ;; force fail ;; (test-set-status! db run-id test-name "COMPLETED" "FAIL" itemdat (conc "Failed at step " stepname) #f) (test-set-status! db run-id test-name "RUNNING" "FAIL" itemdat (conc "Failed at step " stepname) #f) )))) (if (and (steprun-good? logpro-used (vector-ref exit-info 2)) (not (null? tal))) (loop (car tal) (cdr tal) stepname))) (debug:print 4 "WARNING: a prior step failed, stopping at " ezstep)))))))) (monitorjob (lambda () (let* ((start-seconds (current-seconds)) (calc-minutes (lambda () |
︙ | ︙ | |||
372 373 374 375 376 377 378 | (db:get-header run-info) "runname")) (key-vals (get-key-vals db run-id)) (key-str (string-intersperse key-vals "/")) (dfullp (conc disk-path "/" key-str "/" runname "/" testname item-path)) (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) | | | | > > > > | | | | | 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 | (db:get-header run-info) "runname")) (key-vals (get-key-vals db run-id)) (key-str (string-intersperse key-vals "/")) (dfullp (conc disk-path "/" key-str "/" runname "/" testname item-path)) (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) (linktree (let ((rd (config-lookup *configdat* "setup" "linktree"))) (if rd rd (conc *toppath* "/runs")))) (lnkpath (conc linktree "/" key-str "/" runname item-path))) (if (not (file-exists? linktree)) (begin (debug:print 0 "WARNING: linktree did not exist! Creating it now at " linktree) (system (conc "mkdir -p " linktree)))) ;; since this is an iterated test this is as good a place as any to ;; update the toptest record with its location rundir (if (not (equal? item-path "")) (db:test-set-rundir! db run-id testname "" toptest-path)) (debug:print 2 "Setting up test run area") (debug:print 2 " - creating run area in " dfullp) (system (conc "mkdir -p " dfullp)) (debug:print 2 " - creating link from " dfullp "/" testname " to " lnkpath) (system (conc "mkdir -p " lnkpath)) ;; I suspect this section was deleting test directories under some ;; wierd sitations? This doesn't make sense - reenabling the rm -f (if (file-exists? (conc lnkpath "/" testname)) (system (conc "rm -f " lnkpath "/" testname))) (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) (if (directory? dfullp) (begin (let* ((cmd (conc "rsync -av" (if (> *verbosity* 1) "" "q") " " test-path "/ " dfullp "/")) (status (system cmd))) (if (not (eq? status 0)) (debug:print 2 "ERROR: problem with running \"" cmd "\""))) |
︙ | ︙ |
Deleted matrix.scm version [80b32addb5].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified megatest-version.scm from [c9e5e7d31e] to [27dcca5421].
1 2 3 4 5 | ;; Always use two digit decimal ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. (declare (unit megatest-version)) | | | 1 2 3 4 5 6 7 | ;; Always use two digit decimal ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. (declare (unit megatest-version)) (define megatest-version 1.36) |
Modified megatest.scm from [1013e8e76b] to [5624d22f1c].
︙ | ︙ | |||
89 90 91 92 93 94 95 | -rollup : fill run (set by :runname) with latest test(s) from prior runs with same keys -update-meta : update the tests metadata for all tests -env2file fname : write the environment to fname.csh and fname.sh -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. Spreadsheet generation | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | -rollup : fill run (set by :runname) with latest test(s) from prior runs with same keys -update-meta : update the tests metadata for all tests -env2file fname : write the environment to fname.csh and fname.sh -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. Spreadsheet generation -extract-ods fname.ods : extract an open document spreadsheet from the database -pathmod path : insert path, i.e. path/runame/itempath/logfile.html will clear the field if no rundir/testname/itempath/logfile if it contains forward slashes the path will be converted to windows style Helpers -runstep stepname ... : take remaining params as comand and execute as stepname |
︙ | ︙ | |||
231 232 233 234 235 236 237 | (args:get-arg ":runname") (args:get-arg "-testpatt") (args:get-arg "-itempatt"))) (sqlite3:finalize! db) (set! *didsomething* #t))))) (if (args:get-arg "-remove-runs") | > > > > | | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | (args:get-arg ":runname") (args:get-arg "-testpatt") (args:get-arg "-itempatt"))) (sqlite3:finalize! db) (set! *didsomething* #t))))) (if (args:get-arg "-remove-runs") (general-run-call "-remove-runs" "remove runs" (lambda (db target runname keys keynames keyvallst) (remove-runs)))) ;;====================================================================== ;; Query runs ;;====================================================================== (if (args:get-arg "-list-runs") (let* ((db (begin |
︙ | ︙ | |||
322 323 324 325 326 327 328 | ;; process deferred tasks per above steps ;; run all tests are are Not COMPLETED and PASS or CHECK (if (args:get-arg "-runall") (general-run-call "-runall" "run all tests" | | > > > > > > > | > > > | > > > > > > > > > > > > | > > > > > | > > > > > > | 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 | ;; process deferred tasks per above steps ;; run all tests are are Not COMPLETED and PASS or CHECK (if (args:get-arg "-runall") (general-run-call "-runall" "run all tests" (lambda (db target runname keys keynames keyvallst) (runs:run-tests db target runname (args:get-arg "-testpatt") (args:get-arg "-itempatt") user (make-hash-table))))) ;;====================================================================== ;; run one test ;;====================================================================== ;; 1. find the config file ;; 2. change to the test directory ;; 3. update the db with "test started" status, set running host ;; 4. process launch the test ;; - monitor the process, update stats in the db every 2^n minutes ;; 5. as the test proceeds internally it calls megatest as each step is ;; started and completed ;; - step started, timestamp ;; - step completed, exit status, timestamp ;; 6. test phone home ;; - if test run time > allowed run time then kill job ;; - if cannot access db > allowed disconnect time then kill job (if (args:get-arg "-runtests") (general-run-call "-runtests" "run a test" (lambda (db target runname keys keynames keyvallst) (runs:run-tests db target runname (args:get-arg "-runtests") (args:get-arg "-itempatt") user (make-hash-table))))) ;;====================================================================== ;; Rollup into a run ;;====================================================================== (if (args:get-arg "-rollup") (general-run-call "-rollup" |
︙ | ︙ | |||
350 351 352 353 354 355 356 | ;; Extract a spreadsheet from the runs database ;;====================================================================== (if (args:get-arg "-extract-ods") (general-run-call "-extract-ods" "Make ods spreadsheet" | | > < < < < < < < < < < < < < < < < < < < < < < < < < | 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | ;; Extract a spreadsheet from the runs database ;;====================================================================== (if (args:get-arg "-extract-ods") (general-run-call "-extract-ods" "Make ods spreadsheet" (lambda (db target runname keys keynames keyvallst) (let ((outputfile (args:get-arg "-extract-ods")) (runspatt (args:get-arg ":runname")) (pathmod (args:get-arg "-pathmod")) (keyvalalist (keys->alist keys "%"))) (debug:print 2 "Extract ods, outputfile: " outputfile " runspatt: " runspatt " keyvalalist: " keyvalalist) (db:extract-ods-file db outputfile keyvalalist (if runspatt runspatt "%") pathmod))))) ;;====================================================================== ;; execute the test ;; - gets called on remote host ;; - receives info from the -execute param ;; - passes info to steps via MT_CMDINFO env var (future is to use a dot file) ;; - gathers host info and ;;====================================================================== |
︙ | ︙ |
Added monitor.scm version [6e7a5682b5].
> > > > > > > > > > > > > > > > > > > > > > > > > | 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 | ;; Copyright 2006-2011, 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. ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') (use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking) (import (prefix sqlite3 sqlite3:)) (declare (unit runs)) (declare (uses db)) (declare (uses common)) (declare (uses items)) (declare (uses runconfig)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") |
Modified runs.scm from [1e2d7c663b] to [6ee5dc7a41].
︙ | ︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 | (import (prefix sqlite3 sqlite3:)) (declare (unit runs)) (declare (uses db)) (declare (uses common)) (declare (uses items)) (declare (uses runconfig)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") | > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | (import (prefix sqlite3 sqlite3:)) (declare (unit runs)) (declare (uses db)) (declare (uses common)) (declare (uses items)) (declare (uses runconfig)) (declare (uses tests)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") ;; 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 |
︙ | ︙ | |||
85 86 87 88 89 90 91 | (lambda (a . r) (set! res (cons (list->vector (cons a r)) res))) db (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") runnamepatt) (vector header res))) | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | > > > > > > > > < < < < < < < < < < | > > | > | > < < < < < < < < < | < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | < | < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < | < < < | < < < < < < < < < < | < < < | < < | < < < < < < < < < < < < < < | 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 | (lambda (a . r) (set! res (cons (list->vector (cons a r)) res))) db (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") runnamepatt) (vector header res))) ;; ;; TODO: Converge this with db:get-test-info ;; (define (runs:get-test-info db run-id test-name item-path) ;; (let ((res #f)) ;; (vector #f #f #f #f #f #f))) ;; (sqlite3:for-each-row ;; (lambda (id run-id test-name state status) ;; (set! res (vector id run-id test-name state status item-path))) ;; db "SELECT id,run_id,testname,state,status FROM tests WHERE run_id=? AND testname=? AND item_path=?;" ;; run-id test-name item-path) ;; res)) (define (runs:test-get-full-path test) (let* ((testname (db:test-get-testname test)) (itempath (db:test-get-item-path test))) (conc testname (if (equal? itempath "") "" (conc "(" itempath ")"))))) (define (set-megatest-env-vars db run-id) (let ((keys (db-get-keys db))) (for-each (lambda (key) (sqlite3:for-each-row (lambda (val) (debug:print 2 "setenv " (key:get-fieldname key) " " val) (setenv (key:get-fieldname key) val)) db (conc "SELECT " (key:get-fieldname key) " FROM runs WHERE id=?;") run-id)) keys) ;; Lets use this as an opportunity to put MT_RUNNAME in the environment (sqlite3:for-each-row (lambda (runname) (setenv "MT_RUNNAME" runname)) db "SELECT runname FROM runs WHERE id=?;" run-id) )) (define (set-item-env-vars itemdat) (for-each (lambda (item) (debug:print 2 "setenv " (car item) " " (cadr item)) (setenv (car item) (cadr item))) itemdat)) (define (runs:can-run-more-tests db test-record) (let* ((tconfig (tests:testqueue-get-testconfig test-record)) (jobgroup (config-lookup tconfig "requirements" "jobgroup")) (num-running (db:get-count-tests-running db)) (num-running-in-jobgroup (db:get-count-tests-running-in-jobgroup db jobgroup)) (max-concurrent-jobs (config-lookup *configdat* "setup" "max_concurrent_jobs")) (job-group-limit (config-lookup *configdat* "jobgroups" jobgroup))) (debug:print 2 "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " num-running) (if (not (eq? 0 *globalexitstatus*)) #f (let ((can-not-run-more (cond ;; if max-concurrent-jobs is set and the number running is greater ;; than it than cannot run more jobs ((and max-concurrent-jobs (string->number max-concurrent-jobs) (>= num-running (string->number max-concurrent-jobs))) (debug:print 0 "WARNING: Max running jobs exceeded, current number running: " num-running ", max_concurrent_jobs: " max-concurrent-jobs) #t) ;; if job-group-limit is set and number of jobs in the group is greater ;; than the limit then cannot run more jobs of this kind ((and job-group-limit (>= 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)))) (not can-not-run-more))))) ;;====================================================================== ;; New methodology. These routines will replace the above in time. For ;; now the code is duplicated. This stuff is initially used in the monitor ;; based code. ;;====================================================================== |
︙ | ︙ | |||
854 855 856 857 858 859 860 | ;; This is a duplicate of run-tests (which has been deprecated). Use this one instead of run tests. ;; keyvals (define (runs:run-tests db target runname test-patts item-patts user flags) (let* ((keys (db-get-keys db)) (keyvallst (keys:target->keyval keys target)) (run-id (runs:register-run db keys keyvallst runname "new" "n/a" user)) ;; test-name))) (deferred '()) ;; delay running these since they have a waiton clause | > | | > | < < < < < < < < < < < < < < < < < < < < < < < | < | > > | > > > > > > > > > > > > > > > > > | > > > > > > | > | < > > > > > > > > > > | | | < < | < | > > > > > > | > > > > > | | > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > | | | | | < < < < < < < < < < < | < < < < < < < < < < < < < | < < < < < | < < < | < < | < < | < | < | < | | > > > | | < | | < < < < | | < | < < < < < < < | < | < | | < < | < < < < < < < | < < < < < < < < | | | | | | | | | | | < < < | | | | | | | > | > | | | | | | | | | | | | | | | | | | | | | | < < < < < < | | | | < < < < | | | | | | | | | | | < < | 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 | ;; This is a duplicate of run-tests (which has been deprecated). Use this one instead of run tests. ;; keyvals (define (runs:run-tests db target runname test-patts item-patts user flags) (let* ((keys (db-get-keys db)) (keyvallst (keys:target->keyval keys target)) (run-id (runs:register-run db keys keyvallst runname "new" "n/a" user)) ;; test-name))) (deferred '()) ;; delay running these since they have a waiton clause ;; keepgoing is the defacto modality now, will add hit-n-run a bit later ;; (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) (test-names '()) (runconfigf (conc *toppath* "/runconfigs.config")) (required-tests '()) (test-records (make-hash-table))) (set-megatest-env-vars db run-id) ;; these may be needed by the launching process (if (file-exists? runconfigf) (setup-env-defaults db runconfigf run-id *already-seen-runconfig-info* "pre-launch-env-vars") (debug:print 0 "WARNING: You do not have a run config file: " runconfigf)) ;; look up all tests matching the comma separated list of globs in ;; test-patts (using % as wildcard) (for-each (lambda (patt) (let ((tests (glob (conc *toppath* "/tests/" (string-translate patt "%" "*"))))) (set! tests (filter (lambda (test)(file-exists? (conc test "/testconfig"))) tests)) (set! test-names (append test-names (map (lambda (testp) (last (string-split testp "/"))) tests))))) (if test-patts (string-split test-patts ",")(list "%"))) ;; now remove duplicates (set! test-names (delete-duplicates test-names)) (debug:print 0 "INFO: test names " test-names) ;; on the first pass or call to run-tests set FAILS to NOT_STARTED if ;; -keepgoing is specified (if (eq? *passnum* 0) (begin ;; have to delete test records where NOT_STARTED since they can cause -keepgoing to ;; get stuck due to becoming inaccessible from a failed test. I.e. if test B depends ;; on test A but test B reached the point on being registered as NOT_STARTED and test ;; A failed for some reason then on re-run using -keepgoing the run can never complete. (db:delete-tests-in-state db run-id "NOT_STARTED") (db:set-tests-state-status db run-id test-names #f "FAIL" "NOT_STARTED" "FAIL"))) ;; now add non-directly referenced dependencies (i.e. waiton) (if (not (null? test-names)) (let loop ((hed (car test-names)) (tal (cdr test-names))) ;; 'return-procs tells the config reader to prep running system but return a proc (let* ((config (test:get-testconfig hed 'return-procs)) (waitons (string-split (let ((w (config-lookup config "requirements" "waiton"))) (if w w ""))))) ;; (items (items:get-items-from-config config))) (if (not (hash-table-ref/default test-records hed #f)) (hash-table-set! test-records hed (vector hed ;; 0 config ;; 1 waitons ;; 2 (config-lookup config "requirements" "priority") ;; priority 3 (let ((items (hash-table-ref/default config "items" #f)) ;; items 4 (itemstable (hash-table-ref/default config "itemstable" #f))) ;; if either items or items table is a proc return it so test running ;; process can know to call items:get-items-from-config ;; if either is a list and none is a proc go ahead and call get-items ;; otherwise return #f - this is not an iterated test (cond ((procedure? items) (debug:print 4 "INFO: items is a procedure, will calc later") items) ;; calc later ((procedure? itemstable) (debug:print 4 "INFO: itemstable is a procedure, will calc later") itemstable) ;; calc later ((filter (lambda (x) (let ((val (car x))) (if (procedure? val) val #f))) (append (if (list? items) items '()) (if (list? itemstable) itemstable '()))) 'have-procedure) ((or (list? items)(list? itemstable)) ;; calc now (debug:print 4 "INFO: items and itemstable are lists, calc now\n" " items: " items " itemstable: " itemstable) (items:get-items-from-config config)) (else #f))) ;; not iterated #f ;; itemsdat 5 ;; #f ;; spare ))) (for-each (lambda (waiton) (if (and waiton (not (member waiton test-names))) (begin (set! required-tests (cons waiton required-tests)) (set! test-names (cons waiton test-names))))) ;; was an append, now a cons waitons) (let ((remtests (delete-duplicates (append waitons tal)))) (if (not (null? remtests)) (loop (car remtests)(cdr remtests))))))) (if (not (null? required-tests)) (debug:print 1 "INFO: Adding " required-tests " to the run queue")) ;; NOTE: these are all parent tests, items are not expanded yet. (runs:run-tests-queue db run-id runname test-records keyvallst flags) (debug:print 4 "INFO: All done by here"))) (define (runs:run-tests-queue db run-id runname test-records keyvallst flags) ;; At this point the list of parent tests is expanded ;; NB// Should expand items here and then insert into the run queue. (debug:print 5 "test-records: " test-records ", keyvallst: " keyvallst) (let ((sorted-test-names (tests:sort-by-priority-and-waiton test-records)) (item-patts (hash-table-ref/default flags "-itempatt" #f))) (let loop (; (numtimes 0) ;; shouldn't need this (hed (car sorted-test-names)) (tal (cdr sorted-test-names))) (let* ((test-record (hash-table-ref test-records hed)) (tconfig (tests:testqueue-get-testconfig test-record)) (waitons (tests:testqueue-get-waitons test-record)) (priority (tests:testqueue-get-priority test-record)) (itemdat (tests:testqueue-get-itemdat test-record)) (items (tests:testqueue-get-items test-record)) (item-path (item-list->path itemdat))) (debug:print 6 "itemdat: " itemdat "\n items: " items "\n item-path: " item-path) (cond ((not items) ;; when false the test is ok to be handed off to launch (but not before) (let ((have-resources (runs:can-run-more-tests db test-record)) ;; look at the test jobgroup and tot jobs running (prereqs-not-met (db:get-prereqs-not-met db run-id waitons item-path))) ;; Don't know at this time if the test have been launched at some time in the past ;; i.e. is this a re-launch? (if (and have-resources (null? prereqs-not-met)) ;; no loop - drop though and use the loop at the bottom (run:test db run-id runname keyvallst test-record flags #f) ;; else the run is stuck, temporarily or permanently (let ((newtal (append tal (list hed)))) ;; couldn't run, take a breather (thread-sleep! 4) (loop (car newtal)(cdr newtal)))))) ;; case where an items came in as a list been processed ((and (list? items) ;; thus we know our items are already calculated (not itemdat)) ;; and not yet expanded into the list of things to be done (if (>= *verbosity* 1)(pp items)) ;; (if (>= *verbosity* 5) ;; (begin ;; (print "items: ") (pp (item-assoc->item-list items)) ;; (print "itemstable: ")(pp (item-table->item-list itemstable)))) (for-each (lambda (my-itemdat) (let* ((new-test-record (let ((newrec (make-tests:testqueue))) (vector-copy! test-record newrec) newrec)) (my-item-path (item-list->path my-itemdat)) (item-matches (if item-patts ;; here we are filtering for matches with -itempatt (let ((res #f)) ;; look through all the item-patts if defined, format is patt1,patt2,patt3 ... wildcard is % (for-each (lambda (patt) (if (string-search (glob->regexp (string-translate patt "%" "*")) item-path) (set! res #t))) (string-split item-patts ",")) res) #t))) (if item-matches ;; yes, we want to process this item (let ((newtestname (conc hed "/" my-item-path))) (tests:testqueue-set-items! new-test-record #f) (tests:testqueue-set-itemdat! new-test-record my-itemdat) (hash-table-set! test-records newtestname new-test-record) (set! tal (cons newtestname tal)))))) ;; since these are itemized create new test names testname/itempath items) (loop (car tal)(cdr tal))) ;; if items is a proc then need to run items:get-items-from-config, get the list and loop ;; - but only do that if resources exist to kick off the job ((or (procedure? items)(eq? items 'have-procedure)) (if (and (runs:can-run-more-tests db test-record) (null? (db:get-prereqs-not-met db run-id waitons item-path))) (let ((test-name (tests:testqueue-get-testname test-record))) (setenv "MT_TEST_NAME" test-name) ;; (setenv "MT_RUNNAME" runname) (set-megatest-env-vars db run-id) ;; these may be needed by the launching process (let ((items-list (items:get-items-from-config tconfig))) (if (list? items-list) (begin (tests:testqueue-set-items! test-record items-list) (loop hed tal)) (begin (debug:print 0 "ERROR: The proc from reading the setup did not yield a list - please report this") (exit 1))))) (let ((newtal (append tal (list hed)))) ;; if can't run more tests, lets take a breather (thread-sleep! 1) (loop (car newtal)(cdr newtal))))) ;; this case should not happen, added to help catch any bugs ((and (list? items) itemdat) (debug:print 0 "ERROR: Should not have a list of items in a test and the itemspath set - please report this") (exit 1)))) ;; we get here on "drop through" - loop for next test in queue (if (null? tal) (begin ;; FIXME!!!! THIS SHOULD NOT REQUIRE AN EXIT!!!!!!! (debug:print 1 "INFO: All tests launched, exiting") (exit 0)) (loop (car tal)(cdr tal)))))) ;; parent-test is there as a placeholder for when parent-tests can be run as a setup step (define (run:test db run-id runname keyvallst test-record flags parent-test) ;; All these vars might be referenced by the testconfig file reader (let* ((test-name (tests:testqueue-get-testname test-record)) (test-waitons (tests:testqueue-get-waitons test-record)) (test-conf (tests:testqueue-get-testconfig test-record)) (itemdat (tests:testqueue-get-itemdat test-record)) (test-path (conc *toppath* "/tests/" test-name)) ;; could use test:get-testconfig here ... (force (hash-table-ref/default flags "-force" #f)) (rerun (hash-table-ref/default flags "-rerun" #f)) (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) (item-path "")) (debug:print 5 "test-config: " (hash-table->alist test-conf) "\n itemdat: " itemdat ) ;; setting itemdat to a list if it is #f (if (not itemdat)(set! itemdat '())) (set! item-path (item-list->path itemdat)) (debug:print 2 "Attempting to launch test " test-name "/" item-path) (setenv "MT_TEST_NAME" test-name) ;; (setenv "MT_RUNNAME" runname) (set-megatest-env-vars db run-id) ;; these may be needed by the launching process (change-directory *toppath*) ;; Here is where the test_meta table is best updated (runs:update-test_meta db test-name test-conf) ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season "summer")) (let* ((new-test-path (string-intersperse (cons test-path (map cadr itemdat)) "/")) (new-test-name (if (equal? item-path "") test-name (conc test-name "/" item-path))) ;; just need it to be unique (testdat (db:get-test-info db run-id test-name item-path))) (if (not testdat) (begin (register-test db run-id test-name item-path) (set! testdat (db:get-test-info db run-id test-name item-path)))) (change-directory test-path) (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")) ((NOT_STARTED COMPLETED) (debug:print 6 "Got here, " (test:get-state testdat)) (let ((runflag #f)) (cond ;; -force, run no matter what (force (set! runflag #t)) ;; NOT_STARTED, run no matter what ((equal? (test:get-state testdat) "NOT_STARTED")(set! runflag #t)) ;; not -rerun and PASS, WARN or CHECK, do no run ((and (or (not rerun) keepgoing) ;; Require to force re-run for COMPLETED or *anything* + PASS,WARN or CHECK (or (member (test:get-status testdat) '("PASS" "WARN" "CHECK")) (member (test:get-state testdat) '("COMPLETED")))) (set! runflag #f)) ;; -rerun and status is one of the specifed, run it ((and rerun (let ((rerunlst (string-split rerun ","))) ;; FAIL, (member (test:get-status testdat) rerunlst))) (set! runflag #t)) ;; -keepgoing, do not rerun FAIL ((and keepgoing (member (test:get-status testdat) '("FAIL"))) (set! runflag #f)) ((and (not rerun) (member (test:get-status testdat) '("FAIL" "n/a"))) (set! runflag #t)) (else (set! runflag #f))) (debug:print 6 "RUNNING => runflag: " runflag " STATE: " (test:get-state testdat) " STATUS: " (test:get-status testdat)) (if (not runflag) (if (not parent-test) (debug:print 1 "NOTE: Not starting test " new-test-name " as it is state \"" (test:get-state testdat) "\" and status \"" (test:get-status testdat) "\", use -rerun \"" (test:get-state testdat) "\" or -force to override")) ;; NOTE: No longer be checking prerequisites here! Will never get here unless prereqs are ;; already met. (if (not (launch-test db run-id runname test-conf keyvallst test-name test-path itemdat flags)) (begin (print "ERROR: Failed to launch the test. Exiting as soon as possible") (set! *globalexitstatus* 1) ;; (process-signal (current-process-id) signal/kill)))))) ((KILLED) (debug:print 1 "NOTE: " new-test-name " is already running or was explictly killed, use -force to launch it.")) ((LAUNCHED REMOTEHOSTSTART RUNNING) (if (> (- (current-seconds)(+ (db:test-get-event_time testdat) (db:test-get-run_duration testdat))) 600) ;; i.e. no update for more than 600 seconds (begin (debug:print 0 "WARNING: Test " test-name " appears to be dead. Forcing it to state INCOMPLETE and status STUCK/DEAD") (test-set-status! db run-id test-name "INCOMPLETE" "STUCK/DEAD" itemdat "Test is stuck or dead" #f)) (debug:print 2 "NOTE: " test-name " is already running"))) (else (debug:print 0 "ERROR: Failed to launch test " new-test-name ". Unrecognised state " (test:get-state testdat))))))) ;;====================================================================== ;; END OF NEW STUFF ;;====================================================================== (define (get-dir-up-n dir . params) (let ((dparts (string-split dir "/")) |
︙ | ︙ | |||
1211 1212 1213 1214 1215 1216 1217 | ;;====================================================================== ;; Routines for manipulating runs ;;====================================================================== ;; Since many calls to a run require pretty much the same setup ;; this wrapper is used to reduce the replication of code (define (general-run-call switchname action-desc proc) | | > > > | > > > > | | > | 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 | ;;====================================================================== ;; Routines for manipulating runs ;;====================================================================== ;; Since many calls to a run require pretty much the same setup ;; this wrapper is used to reduce the replication of code (define (general-run-call switchname action-desc proc) (let ((runname (args:get-arg ":runname")) (target (if (args:get-arg "-target") (args:get-arg "-target") (args:get-arg "-reqtarg")))) (cond ((not target) (debug:print 0 "ERROR: Missing required parameter for " switchname ", you must specify the target with -target") (exit 3)) ((not runname) (debug:print 0 "ERROR: Missing required parameter for " switchname ", you must specify the run name with :runname runname") (exit 3)) (else (let ((db #f) (keys #f)) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) (set! db (open-db)) |
︙ | ︙ | |||
1243 1244 1245 1246 1247 1248 1249 | (begin (debug:print 0 "ERROR: Attempted to " action-desc " but run area config file not found") (exit 1)) ;; Extract out stuff needed in most or many calls ;; here then call proc (let* ((keynames (map key:get-fieldname keys)) (keyvallst (keys->vallist keys #t))) | | | > | 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 | (begin (debug:print 0 "ERROR: Attempted to " action-desc " but run area config file not found") (exit 1)) ;; Extract out stuff needed in most or many calls ;; here then call proc (let* ((keynames (map key:get-fieldname keys)) (keyvallst (keys->vallist keys #t))) (proc db target runname keys keynames keyvallst))) (sqlite3:finalize! db) (set! *didsomething* #t)))))) ;;====================================================================== ;; Rollup runs ;;====================================================================== ;; Update the test_meta table for this test (define (runs:update-test_meta db test-name test-conf) (let ((currrecord (db:testmeta-get-record db test-name))) (if (not currrecord) (begin (set! currrecord (make-vector 10 #f)) (db:testmeta-add-record db test-name))) (for-each (lambda (key) (let* ((idx (cadr key)) (fld (car key)) (val (config-lookup test-conf "test_meta" fld))) ;; (debug:print 5 "idx: " idx " fld: " fld " val: " val) (if (and val (not (equal? (vector-ref currrecord idx) val))) (begin (print "Updating " test-name " " fld " to " val) (db:testmeta-update-field db test-name fld val))))) '(("author" 2)("owner" 3)("description" 4)("reviewed" 5)("tags" 9))))) ;; Update test_meta for all tests |
︙ | ︙ | |||
1291 1292 1293 1294 1295 1296 1297 | (debug:print 4 "runs:rollup-run, keys: " keys " keyvallst: " keyvallst " :runname " runname " user: " user) (let* (; (keyvalllst (keys:target->keyval keys target)) (new-run-id (runs:register-run db keys keyvallst runname "new" "n/a" user)) (prev-tests (test:get-matching-previous-test-run-records db new-run-id "%" "%")) (curr-tests (db-get-tests-for-run db new-run-id "%" "%" '() '())) (curr-tests-hash (make-hash-table))) (db:update-run-event_time db new-run-id) | | | 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | (debug:print 4 "runs:rollup-run, keys: " keys " keyvallst: " keyvallst " :runname " runname " user: " user) (let* (; (keyvalllst (keys:target->keyval keys target)) (new-run-id (runs:register-run db keys keyvallst runname "new" "n/a" user)) (prev-tests (test:get-matching-previous-test-run-records db new-run-id "%" "%")) (curr-tests (db-get-tests-for-run db new-run-id "%" "%" '() '())) (curr-tests-hash (make-hash-table))) (db:update-run-event_time db new-run-id) ;; index the already saved tests by testname and itemdat in curr-tests-hash (for-each (lambda (testdat) (let* ((testname (db:test-get-testname testdat)) (item-path (db:test-get-item-path testdat)) (full-name (conc testname "/" item-path))) (hash-table-set! curr-tests-hash full-name testdat))) curr-tests) |
︙ | ︙ |
Added test_records.scm version [7236ce2839].
> > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ;; make-vector-record tests testqueue testname testconfig waitons priority items (define (make-tests:testqueue)(make-vector 6 #f)) (define-inline (tests:testqueue-get-testname vec) (vector-ref vec 0)) (define-inline (tests:testqueue-get-testconfig vec) (vector-ref vec 1)) (define-inline (tests:testqueue-get-waitons vec) (vector-ref vec 2)) (define-inline (tests:testqueue-get-priority vec) (vector-ref vec 3)) ;; items: #f=no items, list=list of items remaining, proc=need to call to get items (define-inline (tests:testqueue-get-items vec) (vector-ref vec 4)) (define-inline (tests:testqueue-get-itemdat vec) (vector-ref vec 5)) (define-inline (tests:testqueue-set-testname! vec val)(vector-set! vec 0 val)) (define-inline (tests:testqueue-set-testconfig! vec val)(vector-set! vec 1 val)) (define-inline (tests:testqueue-set-waitons! vec val)(vector-set! vec 2 val)) (define-inline (tests:testqueue-set-priority! vec val)(vector-set! vec 3 val)) (define-inline (tests:testqueue-set-items! vec val)(vector-set! vec 4 val)) (define-inline (tests:testqueue-set-itemdat! vec val)(vector-set! vec 5 val)) |
Added tests.scm version [bf12d3e572].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | (use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking) (import (prefix sqlite3 sqlite3:)) (declare (unit tests)) (declare (uses db)) (declare (uses common)) (declare (uses items)) (declare (uses runconfig)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") (include "run_records.scm") (include "test_records.scm") (define (register-test db run-id test-name item-path) (let ((item-paths (if (equal? item-path "") (list item-path) (list item-path "")))) (for-each (lambda (pth) (sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_time,item_path,state,status) VALUES (?,?,strftime('%s','now'),?,'NOT_STARTED','n/a');" run-id test-name pth ;; (conc "," (string-intersperse tags ",") ",") )) item-paths ))) ;; get the previous record for when this test was run where all keys match but runname ;; returns #f if no such test found, returns a single test record if found (define (test:get-previous-test-run-record db run-id test-name item-path) (let* ((keys (db:get-keys db)) (selstr (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ",")) (qrystr (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND ")) (keyvals #f)) ;; first look up the key values from the run selected by run-id (sqlite3:for-each-row (lambda (a . b) (set! keyvals (cons a b))) db (conc "SELECT " selstr " FROM runs WHERE id=? ORDER BY event_time DESC;") run-id) (if (not keyvals) #f (let ((prev-run-ids '())) (apply sqlite3:for-each-row (lambda (id) (set! prev-run-ids (cons id prev-run-ids))) db (conc "SELECT id FROM runs WHERE " qrystr " AND id != ?;") (append keyvals (list run-id))) ;; for each run starting with the most recent look to see if there is a matching test ;; if found then return that matching test record (debug:print 4 "selstr: " selstr ", qrystr: " qrystr ", keyvals: " keyvals ", previous run ids found: " prev-run-ids) (if (null? prev-run-ids) #f (let loop ((hed (car prev-run-ids)) (tal (cdr prev-run-ids))) (let ((results (db-get-tests-for-run db hed test-name item-path '() '()))) (debug:print 4 "Got tests for run-id " run-id ", test-name " test-name ", item-path " item-path ": " results) (if (and (null? results) (not (null? tal))) (loop (car tal)(cdr tal)) (if (null? results) #f (car results)))))))))) ;; get the previous records for when these tests were run where all keys match but runname ;; NB// Merge this with test:get-previous-test-run-records? This one looks for all matching tests ;; can use wildcards. (define (test:get-matching-previous-test-run-records db run-id test-name item-path) (let* ((keys (db:get-keys db)) (selstr (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ",")) (qrystr (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND ")) (keyvals #f) (tests-hash (make-hash-table))) ;; first look up the key values from the run selected by run-id (sqlite3:for-each-row (lambda (a . b) (set! keyvals (cons a b))) db (conc "SELECT " selstr " FROM runs WHERE id=? ORDER BY event_time DESC;") run-id) (if (not keyvals) '() (let ((prev-run-ids '())) (apply sqlite3:for-each-row (lambda (id) (set! prev-run-ids (cons id prev-run-ids))) db (conc "SELECT id FROM runs WHERE " qrystr " AND id != ?;") (append keyvals (list run-id))) ;; collect all matching tests for the runs then ;; extract the most recent test and return that. (debug:print 4 "selstr: " selstr ", qrystr: " qrystr ", keyvals: " keyvals ", previous run ids found: " prev-run-ids) (if (null? prev-run-ids) '() ;; no previous runs? return null (let loop ((hed (car prev-run-ids)) (tal (cdr prev-run-ids))) (let ((results (db-get-tests-for-run db hed test-name item-path '() '()))) (debug:print 4 "Got tests for run-id " run-id ", test-name " test-name ", item-path " item-path " results: " (intersperse results "\n")) ;; Keep only the youngest of any test/item combination (for-each (lambda (testdat) (let* ((full-testname (conc (db:test-get-testname testdat) "/" (db:test-get-item-path testdat))) (stored-test (hash-table-ref/default tests-hash full-testname #f))) (if (or (not stored-test) (and stored-test (> (db:test-get-event_time testdat)(db:test-get-event_time stored-test)))) ;; this test is younger, store it in the hash (hash-table-set! tests-hash full-testname testdat)))) results) (if (null? tal) (map cdr (hash-table->alist tests-hash)) ;; return a list of the most recent tests (loop (car tal)(cdr tal)))))))))) (define (test-set-status! db run-id test-name state status itemdat-or-path comment dat) (let* ((real-status status) (item-path (if (string? itemdat-or-path) itemdat-or-path (item-list->path itemdat-or-path))) (testdat (db:get-test-info db run-id test-name item-path)) (test-id (if testdat (db:test-get-id testdat) #f)) (otherdat (if dat dat (make-hash-table))) ;; before proceeding we must find out if the previous test (where all keys matched except runname) ;; was WAIVED if this test is FAIL (waived (if (equal? status "FAIL") (let ((prev-test (test:get-previous-test-run-record db run-id test-name item-path))) (if prev-test ;; true if we found a previous test in this run series (let ((prev-status (db:test-get-status prev-test)) (prev-state (db:test-get-state prev-test)) (prev-comment (db:test-get-comment prev-test))) (debug:print 4 "prev-status " prev-status ", prev-state " prev-state ", prev-comment " prev-comment) (if (and (equal? prev-state "COMPLETED") (equal? prev-status "WAIVED")) prev-comment ;; waived is either the comment or #f #f)) #f)) #f))) (if waived (set! real-status "WAIVED")) (debug:print 4 "real-status " real-status ", waived " waived ", status " status) ;; update the primary record IF state AND status are defined (if (and state status) (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strftime('%s','now') WHERE run_id=? AND testname=? AND item_path=?;" state real-status run-id test-name item-path)) ;; if status is "AUTO" then call rollup (if (and test-id state status (equal? status "AUTO")) (db:test-data-rollup db test-id status)) ;; add metadata (need to do this way to avoid SQL injection issues) ;; :first_err ;; (let ((val (hash-table-ref/default otherdat ":first_err" #f))) ;; (if val ;; (sqlite3:execute db "UPDATE tests SET first_err=? WHERE run_id=? AND testname=? AND item_path=?;" val run-id test-name item-path))) ;; ;; ;; :first_warn ;; (let ((val (hash-table-ref/default otherdat ":first_warn" #f))) ;; (if val ;; (sqlite3:execute db "UPDATE tests SET first_warn=? WHERE run_id=? AND testname=? AND item_path=?;" val run-id test-name item-path))) (let ((category (hash-table-ref/default otherdat ":category" "")) (variable (hash-table-ref/default otherdat ":variable" "")) (value (hash-table-ref/default otherdat ":value" #f)) (expected (hash-table-ref/default otherdat ":expected" #f)) (tol (hash-table-ref/default otherdat ":tol" #f)) (units (hash-table-ref/default otherdat ":units" "")) (type (hash-table-ref/default otherdat ":type" "")) (dcomment (hash-table-ref/default otherdat ":comment" ""))) (debug:print 4 "category: " category ", variable: " variable ", value: " value ", expected: " expected ", tol: " tol ", units: " units) (if (and value expected tol) ;; all three required (db:csv->test-data db test-id (conc category "," variable "," value "," expected "," tol "," units "," dcomment ",," ;; extra comma for status type )))) ;; need to update the top test record if PASS or FAIL and this is a subtest (if (and (not (equal? item-path "")) (or (equal? status "PASS") (equal? status "WARN") (equal? status "FAIL") (equal? status "WAIVED") (equal? status "RUNNING"))) (begin (sqlite3:execute db "UPDATE tests SET fail_count=(SELECT count(id) FROM tests WHERE run_id=? AND testname=? AND item_path != '' AND status='FAIL'), pass_count=(SELECT count(id) FROM tests WHERE run_id=? AND testname=? AND item_path != '' AND (status='PASS' OR status='WARN' OR status='WAIVED')) WHERE run_id=? AND testname=? AND item_path='';" run-id test-name run-id test-name run-id test-name) (if (equal? status "RUNNING") ;; running takes priority over all other states, force the test state to RUNNING (sqlite3:execute db "UPDATE tests SET state=? WHERE run_id=? AND testname=? AND item_path='';" "RUNNING" run-id test-name) (sqlite3:execute db "UPDATE tests SET state=CASE WHEN (SELECT count(id) FROM tests WHERE run_id=? AND testname=? AND item_path != '' AND state in ('RUNNING','NOT_STARTED')) > 0 THEN 'RUNNING' ELSE 'COMPLETED' END, status=CASE WHEN fail_count > 0 THEN 'FAIL' WHEN pass_count > 0 AND fail_count=0 THEN 'PASS' ELSE 'UNKNOWN' END WHERE run_id=? AND testname=? AND item_path='';" run-id test-name run-id test-name)))) (if (or (and (string? comment) (string-match (regexp "\\S+") comment)) waived) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" (if waived waived comment) run-id test-name item-path)) )) (define (test-set-log! db run-id test-name itemdat logf) (let ((item-path (item-list->path itemdat))) (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path=?;" logf run-id test-name item-path))) (define (test-set-toplog! db run-id test-name logf) (sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path='';" logf run-id test-name)) (define (tests:summarize-items db run-id test-name force) ;; if not force then only update the record if one of these is true: ;; 1. logf is "log/final.log ;; 2. logf is same as outputfilename (let ((outputfilename (conc "megatest-rollup-" test-name ".html")) (orig-dir (current-directory)) (logf #f)) (sqlite3:for-each-row (lambda (path final_logf) (set! logf final_logf) (if (directory? path) (begin (print "Found path: " path) (change-directory path)) ;; (set! outputfilename (conc path "/" outputfilename))) (print "No such path: " path))) db "SELECT rundir,final_logf FROM tests WHERE run_id=? AND testname=? AND item_path='';" run-id test-name) (print "summarize-items with logf " logf) (if (or (equal? logf "logs/final.log") (equal? logf outputfilename) force) (begin (if (obtain-dot-lock outputfilename 1 20 30) ;; retry every second for 20 seconds, call it dead after 30 seconds and steal the lock (print "Obtained lock for " outputfilename) (print "Failed to obtain lock for " outputfilename)) (let ((oup (open-output-file outputfilename)) (counts (make-hash-table)) (statecounts (make-hash-table)) (outtxt "") (tot 0)) (with-output-to-port oup (lambda () (set! outtxt (conc outtxt "<html><title>Summary: " test-name "</title><body><h2>Summary for " test-name "</h2>")) (sqlite3:for-each-row (lambda (id itempath state status run_duration logf comment) (hash-table-set! counts status (+ 1 (hash-table-ref/default counts status 0))) (hash-table-set! statecounts state (+ 1 (hash-table-ref/default statecounts state 0))) (set! outtxt (conc outtxt "<tr>" "<td><a href=\"" itempath "/" logf "\"> " itempath "</a></td>" "<td>" state "</td>" "<td><font color=" (common:get-color-from-status status) ">" status "</font></td>" "<td>" (if (equal? comment "") " " comment) "</td>" "</tr>"))) db "SELECT id,item_path,state,status,run_duration,final_logf,comment FROM tests WHERE run_id=? AND testname=? AND item_path != '';" run-id test-name) (print "<table><tr><td valign=\"top\">") ;; Print out stats for status (set! tot 0) (print "<table cellspacing=\"0\" border=\"1\"><tr><td colspan=\"2\"><h2>State stats</h2></td></tr>") (for-each (lambda (state) (set! tot (+ tot (hash-table-ref statecounts state))) (print "<tr><td>" state "</td><td>" (hash-table-ref statecounts state) "</td></tr>")) (hash-table-keys statecounts)) (print "<tr><td>Total</td><td>" tot "</td></tr></table>") (print "</td><td valign=\"top\">") ;; Print out stats for state (set! tot 0) (print "<table cellspacing=\"0\" border=\"1\"><tr><td colspan=\"2\"><h2>Status stats</h2></td></tr>") (for-each (lambda (status) (set! tot (+ tot (hash-table-ref counts status))) (print "<tr><td><font color=\"" (common:get-color-from-status status) "\">" status "</font></td><td>" (hash-table-ref counts status) "</td></tr>")) (hash-table-keys counts)) (print "<tr><td>Total</td><td>" tot "</td></tr></table>") (print "</td></td></tr></table>") (print "<table cellspacing=\"0\" border=\"1\">" "<tr><td>Item</td><td>State</td><td>Status</td><td>Comment</td>" outtxt "</table></body></html>") (release-dot-lock outputfilename))) (close-output-port oup) (change-directory orig-dir) (test-set-toplog! db run-id test-name outputfilename) ))))) (define (get-all-legal-tests) (let* ((tests (glob (conc *toppath* "/tests/*"))) (res '())) (debug:print 4 "INFO: Looking at tests " (string-intersperse tests ",")) (for-each (lambda (testpath) (if (file-exists? (conc testpath "/testconfig")) (set! res (cons (last (string-split testpath "/")) res)))) tests) res)) (define (test:get-testconfig test-name system-allowed) (let* ((test-path (conc *toppath* "/tests/" test-name)) (test-configf (conc test-path "/testconfig")) (testexists (and (file-exists? test-configf)(file-read-access? test-configf)))) (if testexists (read-config test-configf #f system-allowed environ-patt: (if system-allowed "pre-launch-env-vars" #f)) #f))) ;; sort tests by priority and waiton ;; Move test specific stuff to a test unit FIXME one of these days (define (tests:sort-by-priority-and-waiton test-records) (let ((mungepriority (lambda (priority) (if priority (let ((tmp (any->number priority))) (if tmp tmp (begin (debug:print 0 "ERROR: bad priority value " priority ", using 0") 0))) 0)))) (sort (hash-table-keys test-records) ;; avoid dealing with deleted tests, look at the hash table (lambda (a b) (let* ((a-record (hash-table-ref test-records a)) (b-record (hash-table-ref test-records b)) (a-waitons (tests:testqueue-get-waitons a-record)) (b-waitons (tests:testqueue-get-waitons b-record)) (a-config (tests:testqueue-get-testconfig a-record)) (b-config (tests:testqueue-get-testconfig b-record)) (a-raw-pri (config-lookup a-config "requirements" "priority")) (b-raw-pri (config-lookup b-config "requirements" "priority")) (a-priority (mungepriority a-raw-pri)) (b-priority (mungepriority b-raw-pri))) ;; (debug:print 5 "sort-by-priority-and-waiton, a: " a " b: " b ;; "\n a-record: " a-record ;; "\n b-record: " b-record ;; "\n a-waitons: " a-waitons ;; "\n b-waitons: " b-waitons ;; "\n a-config: " (hash-table->alist a-config) ;; "\n b-config: " (hash-table->alist b-config) ;; "\n a-raw-pri: " a-raw-pri ;; "\n b-raw-pri: " b-raw-pri ;; "\n a-priority: " a-priority ;; "\n b-priority: " b-priority) (tests:testqueue-set-priority! a-record a-priority) (tests:testqueue-set-priority! b-record b-priority) (if (and a-waitons (member (tests:testqueue-get-testname b-record) a-waitons)) #f ;; cannot have a which is waiting on b happening before b (if (and b-waitons (member (tests:testqueue-get-testname a-record) b-waitons)) #t ;; this is the correct order, b is waiting on a and b is before a (if (> a-priority b-priority) #t ;; if a is a higher priority than b then we are good to go #f)))))))) ;;====================================================================== ;; test steps ;;====================================================================== (define (teststep-set-status! db run-id test-name teststep-name state-in status-in itemdat comment logfile) (debug:print 4 "run-id: " run-id " test-name: " test-name) (let* ((state (check-valid-items "state" state-in)) (status (check-valid-items "status" status-in)) (item-path (item-list->path itemdat)) (testdat (db:get-test-info db run-id test-name item-path))) (debug:print 5 "testdat: " testdat) (if (and testdat ;; if the section exists then force specification BUG, I don't like how this works. (or (not state)(not status))) (debug:print 0 "WARNING: Invalid " (if status "status" "state") " value \"" (if status state-in status-in) "\", update your validvalues section in megatest.config")) (if testdat (let ((test-id (test:get-id testdat))) ;; FIXME - this should not update the logfile unless it is specified. (sqlite3:execute db "INSERT OR REPLACE into test_steps (test_id,stepname,state,status,event_time,comment,logfile) VALUES(?,?,?,?,strftime('%s','now'),?,?);" test-id teststep-name state-in status-in (if comment comment "") (if logfile logfile ""))) (debug:print 0 "ERROR: Can't update " test-name " for run " run-id " -> no such test in db")))) (define (test-get-kill-request db run-id test-name itemdat) (let* ((item-path (item-list->path itemdat)) (testdat (db:get-test-info db run-id test-name item-path))) (equal? (test:get-state testdat) "KILLREQ"))) (define (test-set-meta-info db run-id testname itemdat) (let ((item-path (item-list->path itemdat)) (cpuload (get-cpu-load)) (hostname (get-host-name)) (diskfree (get-df (current-directory))) (uname (get-uname "-srvpio")) (runpath (current-directory))) (sqlite3:execute db "UPDATE tests SET host=?,cpuload=?,diskfree=?,uname=?,rundir=? WHERE run_id=? AND testname=? AND item_path=?;" hostname cpuload diskfree uname runpath run-id testname item-path))) (define (test-update-meta-info db run-id testname itemdat minutes cpuload diskfree tmpfree) (let ((item-path (item-list->path itemdat))) (if (not item-path)(begin (debug:print 0 "WARNING: ITEMPATH not set.") (set! item-path ""))) ;; (let ((testinfo (db:get-test-info db run-id testname item-path))) ;; (if (and (not (equal? (db:test-get-status testinfo) "COMPLETED")) ;; (not (equal? (db:test-get-status testinfo) "KILLREQ")) (sqlite3:execute db "UPDATE tests SET cpuload=?,diskfree=?,run_duration=?,state='RUNNING' WHERE run_id=? AND testname=? AND item_path=? AND state NOT IN ('COMPLETED','KILLREQ','KILLED');" cpuload diskfree minutes run-id testname item-path))) |
Modified tests/Makefile from [8ae583dc76] to [9004c03430].
1 2 3 4 5 6 7 8 | # run some tests BINPATH=$(shell realpath ../bin) MEGATEST=$(BINPATH)/megatest PATH := $(BINPATH):$(PATH) runall : cd ../;make install | | | | | | 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 | # run some tests BINPATH=$(shell realpath ../bin) MEGATEST=$(BINPATH)/megatest PATH := $(BINPATH):$(PATH) runall : cd ../;make install $(BINPATH)/dboard -rows 15 & $(MEGATEST) -keepgoing -runall -target ubuntu/nfs/none :runname `date +w%V.%u.%H` -m "This is a comment specific to a run" -v test : csi -b -I .. ../megatest.scm -- -runall -target ubuntu/afs/tmp :runname blah cd ../;make test make runall dashboard : cd ../;make dboard $(BINPATH)/dboard & remove : (cd ../;make);$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % runforever : while(ls); do runname=`date +%F-%R:%S`;$(MEGATEST) -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname;done |
Modified tests/megatest.config from [9748b106ce] to [15ea3d69a8].
1 2 3 4 5 6 7 8 | [fields] sysname TEXT fsname TEXT datapath TEXT [setup] # exectutable /path/to/megatest max_concurrent_jobs 50 | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [fields] sysname TEXT fsname TEXT datapath TEXT [setup] # exectutable /path/to/megatest max_concurrent_jobs 50 linktree /tmp/runs [jobtools] # useshell yes # ## launcher launches jobs, the job is managed on the target host ## by megatest, comment out launcher to run local # workhosts localhost hermes launcher nbfake |
︙ | ︙ |
Added tests/tests/ez_exit2_fail/testconfig version [fc174ee7f2].
> > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [setup] [ezsteps] exit2 exit 2 lookithome ls /home [test_meta] author matt owner bob description This test runs two steps; the first exits with code 2 (a fail because not using logpro) and the second is a pass tags first,single reviewed 09/10/2011, by Matt |
Modified tests/tests/ez_fail/testconfig from [0f917c7dd3] to [d90c6719c8].
1 2 3 4 5 6 | [setup] [requirements] priority 10 [ezsteps] | | | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [setup] [requirements] priority 10 [ezsteps] lookittmp sleep 5s;ls /tmp lookithome sleep 2;ls /home # should fail on next step lookitnada sleep 3;ls /nada lookitusr sleep 2;ls /usr [test_meta] author matt owner bob description This test runs a single ezstep which is expected to pass, no logpro file. tags first,single |
︙ | ︙ |
Deleted tests/tests/ez_warn/testconfig version [fc174ee7f2].
|
| < < < < < < < < < < < < < < < |
Modified tests/tests/ezlog_fail/lookittmp.logpro from [272f1780da] to [961ab4aef4].
1 2 3 4 | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. | < < | 1 2 3 4 5 6 | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error |
Modified tests/tests/ezlog_warn/lookittmp.logpro from [77c9bbdc6c] to [5323023529].
1 2 3 4 5 6 | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (expect:warning in "LogFileBody" = 0 "Any warning" #/.*/) | > > | | 1 2 3 4 5 6 7 8 9 10 11 12 | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (expect:warning in "LogFileBody" = 0 "Any warning" #/.*/) ;; Can't have a required since it will mask the warns! Could make the warn non-overlapping with the ;; required I suppose... ;; (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors |
Added tests/tests/logpro_required_fail/lookittmp.logpro version [312a36066e].
> > > > > > > > | 1 2 3 4 5 6 7 8 | ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com ;; ;; License GPL. (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/) ;; (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) ;; (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error |
Added tests/tests/logpro_required_fail/testconfig version [e006dc1513].
> > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 | [setup] [ezsteps] lookittmp ls /tmp [test_meta] author matt owner bob description This test runs two ezstep, the first of which is expected to fail using a simple logpro file. tags logpro reviewed 09/10/2011, by Matt |
Modified tests/tests/runfirst/main.sh from [e1e013c667] to [e4be557feb].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/bin/bash # megatest -step wasting_time :state start :status n/a -m "This is a test step comment" # sleep 20 # megatest -step wasting_time :state end :status $? touch ../I_was_here $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all done eh?" -m "This is a test step comment" $MT_MEGATEST -load-test-data << EOF foo,bar,1.2,1.9,> foo,rab,1.0e9,10e9,1e9 foo,bla,1.2,1.9,< foo,bal,1.2,1.2,<,,Check for overload foo,alb,1.2,1.2,<=,Amps,This is the high power circuit test foo,abl,1.2,1.3,0.1 foo,bra,1.2,pass,silly stuff faz,bar,10,8mA,,,"this is a comment" EOF $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level comment" :value 10e6 :expected_value 1.1e6 :tol 100e3 :category nada :variable sillyvar :units mFarks :comment "This is the value/expected comment" # $MT_MEGATEST -test-status :state COMPLETED :status FAIL | > > > > > > > | 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 | #!/bin/bash # megatest -step wasting_time :state start :status n/a -m "This is a test step comment" # sleep 20 # megatest -step wasting_time :state end :status $? touch ../I_was_here mkdir -p $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME echo 1 2 3 4 5 > $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all done eh?" -m "This is a test step comment" $MT_MEGATEST -load-test-data << EOF foo,bar,1.2,1.9,> foo,rab,1.0e9,10e9,1e9 foo,bla,1.2,1.9,< foo,bal,1.2,1.2,<,,Check for overload foo,alb,1.2,1.2,<=,Amps,This is the high power circuit test foo,abl,1.2,1.3,0.1 foo,bra,1.2,pass,silly stuff faz,bar,10,8mA,,,"this is a comment" EOF $MT_MEGATEST -load-test-data << EOF cat, var, val, exp, comp, units, comment, status, type ameas,iout,1.2,1.9,>,Amps,Comment,,meas EOF $MT_MEGATEST -test-status :state COMPLETED :status $? -m "This is a test level comment" :value 10e6 :expected_value 1.1e6 :tol 100e3 :category nada :variable sillyvar :units mFarks :comment "This is the value/expected comment" # $MT_MEGATEST -test-status :state COMPLETED :status FAIL |
Added tests/tests/test_mt_vars/testconfig version [3b27a4617c].
> > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | [setup] [ezsteps] lookittmp ls /tmp lookithome ls /home [requirements] waiton runfirst priority 0 [items] NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans] [test_meta] author matt owner bob description This test runs a single ezstep which is expected to pass, no logpro file. tags first,single reviewed 09/10/2011, by Matt |
Deleted tree.scm version [5ed00197a5].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified utils/mt_ezstep from [41dcc3da03] to [e004bfd05c].
1 2 3 4 5 6 7 8 9 10 11 | #!/bin/bash if [ "$MT_CMDINFO" == "" ];then echo "ERROR: $0 should be run within a megatest test environment" exit fi # Purpose: This is for the [ezsteps] secton in your testconfig file. # DO NOT USE IN YOUR SCRIPTS! # # Call like this: | | > > > > > > > | 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 | #!/bin/bash if [ "$MT_CMDINFO" == "" ];then echo "ERROR: $0 should be run within a megatest test environment" exit fi # Purpose: This is for the [ezsteps] secton in your testconfig file. # DO NOT USE IN YOUR SCRIPTS! # # Call like this: # mt_ezstep stepname prevstepname command .... # stepname=$1;shift prevstepname=$1;shift command=$* allstatus=99 runstatus=99 logpropstatus=99 prev_env=.ezsteps/${prevstepname}.sh if [ -e $prev_env ];then source $prev_env fi # source the environment from the previous step if it exists # if a logpro file exists then use it otherwise just run the command, nb// was using 2>&1 if [ -e ${stepname}.logpro ];then $command 2>&1| logpro ${stepname}.logpro ${stepname}.html &> ${stepname}.log allstatus=(${PIPESTATUS[0]} ${PIPESTATUS[1]}) |
︙ | ︙ |