Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -96,33 +96,33 @@ (let ((debugcontrolf (conc (get-environment-variable "HOME") "/.dashboardrc"))) (if (file-exists? debugcontrolf) (load debugcontrolf))) (define *runremote* #f) -(define *data* (make-vector 25 #f)) - -(dboard:data-set-run-keys! *data* (make-hash-table)) - -;; List of test ids being viewed in various panels -(dboard:data-set-curr-test-ids! *data* (make-hash-table)) - -;; Look up test-ids by (key1 key2 ... testname [itempath]) -(dboard:data-set-path-test-ids! *data* (make-hash-table)) - -;; Look up run-ids by ?? -(dboard:data-set-path-run-ids! *data* (make-hash-table)) - -(dboard:data-set-updaters! *data* (make-hash-table)) - -(define *other* (make-hash-table)) -(define *dbdir* (db:dbfile-path #f *area-dat*)) -(define *dbstruct-local* (make-dbr:dbstruct path: *dbdir* - local: #t)) -(define *db-file-path* (db:dbfile-path 0 *area-dat*)) - -;; HACK ALERT: this is a hack, please fix. -(define *read-only* (not (file-read-access? *db-file-path*))) +;; (define *data* (make-vector 25 #f)) +;; +;; (dboard:data-set-run-keys! *data* (make-hash-table)) +;; +;; ;; List of test ids being viewed in various panels +;; (dboard:data-set-curr-test-ids! *data* (make-hash-table)) +;; +;; ;; Look up test-ids by (key1 key2 ... testname [itempath]) +;; (dboard:data-set-path-test-ids! *data* (make-hash-table)) +;; +;; ;; Look up run-ids by ?? +;; (dboard:data-set-path-run-ids! *data* (make-hash-table)) +;; +;; (dboard:data-set-updaters! *data* (make-hash-table)) +;; +;; (define *other* (make-hash-table)) +;; (define *dbdir* (db:dbfile-path #f *area-dat*)) +;; (define *dbstruct-local* (make-dbr:dbstruct path: *dbdir* +;; local: #t)) +;; (define *db-file-path* (db:dbfile-path 0 *area-dat*)) +;; +;; ;; HACK ALERT: this is a hack, please fix. +;; (define *read-only* (not (file-read-access? *db-file-path*))) (debug:setup) (define *tim* (iup:timer)) (define *ord* #f) @@ -649,17 +649,21 @@ (iup:callback-set! *tim* "ACTION_CB" (lambda (x) ;; Want to dedicate no more than 50% of the time to this so skip if ;; 2x delta time has not passed since last query - (if (< nextmintime (current-milliseconds)) - (let* ((starttime (current-milliseconds)) - (changes (dcommon:run-update keys data runname keypatts testpatt states statuses 'full my-window-id)) - (endtime (current-milliseconds))) - (set! nextmintime (+ endtime (* 2 (- endtime starttime)))) - (debug:print 11 "CHANGE(S): " (car changes) "...")) - (debug:print-info 11 "Server overloaded")))))) + ;; (if (< nextmintime (current-milliseconds)) + ;; (let* ((starttime (current-milliseconds)) + ;; (changes '()) ;; (dcommon:run-update keys data runname keypatts testpatt states statuses 'full my-window-id)) + ;; (endtime (current-milliseconds))) + ;; (set! nextmintime (+ endtime (* 2 (- endtime starttime)))) + ;; ;; (debug:print 11 "CHANGE(S): " (car changes) "...") + ;; ) + ;; (debug:print-info 11 "Server overloaded")))))) + ;; pretend to do work .... + (thread-sleep! 0.1) + )))) ;;; main ;;; (let ((data (make-hash-table))) ;; data will have "areaname" => "area record" entries (newdashboard data) (iup:main-loop)) Index: dcommon.scm ================================================================== --- dcommon.scm +++ dcommon.scm @@ -33,79 +33,46 @@ ;;====================================================================== ;; C O M M O N D A T A S T R U C T U R E ;;====================================================================== ;; ;; A single data structure for all the data used in a dashboard for -;; a given area. -;; -;; Share this structure between newdashboard and dashboard with the -;; intent of converging on a single app. -;; -(define *data* (make-vector 25 #f)) -(define (dboard:data-get-runs vec) (vector-ref vec 0)) -(define (dboard:data-get-tests vec) (vector-ref vec 1)) -(define (dboard:data-get-runs-matrix vec) (vector-ref vec 2)) -(define (dboard:data-get-tests-tree vec) (vector-ref vec 3)) -(define (dboard:data-get-run-keys vec) (vector-ref vec 4)) -(define (dboard:data-get-curr-test-ids vec) (vector-ref vec 5)) -;; (define (dboard:data-get-test-details vec) (vector-ref vec 6)) -(define (dboard:data-get-path-test-ids vec) (vector-ref vec 7)) -(define (dboard:data-get-updaters vec) (vector-ref vec 8)) -(define (dboard:data-get-path-run-ids vec) (vector-ref vec 9)) -(define (dboard:data-get-curr-run-id vec) (vector-ref vec 10)) -(define (dboard:data-get-runs-tree vec) (vector-ref vec 11)) -;; For test-patts convert #f to "" -(define (dboard:data-get-test-patts vec) - (let ((val (vector-ref vec 12)))(if val val ""))) -(define (dboard:data-get-states vec) (vector-ref vec 13)) -(define (dboard:data-get-statuses vec) (vector-ref vec 14)) -(define (dboard:data-get-logs-textbox vec val)(vector-ref vec 15)) -(define (dboard:data-get-command vec) (vector-ref vec 16)) -(define (dboard:data-get-command-tb vec) (vector-ref vec 17)) -(define (dboard:data-get-target vec) (vector-ref vec 18)) -(define (dboard:data-get-target-string vec) - (let ((targ (dboard:data-get-target vec))) - (if (list? targ)(string-intersperse targ "/") "no-target-specified"))) -(define (dboard:data-get-run-name vec) (vector-ref vec 19)) -(define (dboard:data-get-runs-listbox vec) (vector-ref vec 20)) -(define (dboard:data-get-area-path vec) (vector-ref vec 21)) - -(define (dboard:data-set-runs! vec val)(vector-set! vec 0 val)) -(define (dboard:data-set-tests! vec val)(vector-set! vec 1 val)) -(define (dboard:data-set-runs-matrix! vec val)(vector-set! vec 2 val)) -(define (dboard:data-set-tests-tree! vec val)(vector-set! vec 3 val)) -(define (dboard:data-set-run-keys! vec val)(vector-set! vec 4 val)) -(define (dboard:data-set-curr-test-ids! vec val)(vector-set! vec 5 val)) -;; (define (dboard:data-set-test-details! vec val)(vector-set! vec 6 val)) -(define (dboard:data-set-path-test-ids! vec val)(vector-set! vec 7 val)) -(define (dboard:data-set-updaters! vec val)(vector-set! vec 8 val)) -(define (dboard:data-set-path-run-ids! vec val)(vector-set! vec 9 val)) -(define (dboard:data-set-curr-run-id! vec val)(vector-set! vec 10 val)) -(define (dboard:data-set-runs-tree! vec val)(vector-set! vec 11 val)) -;; For test-patts convert "" to #f -(define (dboard:data-set-test-patts! vec val) - (vector-set! vec 12 (if (equal? val "") #f val))) -(define (dboard:data-set-states! vec val)(vector-set! vec 13 val)) -(define (dboard:data-set-statuses! vec val)(vector-set! vec 14 val)) -(define (dboard:data-set-logs-textbox! vec val)(vector-set! vec 15 val)) -(define (dboard:data-set-command! vec val)(vector-set! vec 16 val)) -(define (dboard:data-set-command-tb! vec val)(vector-set! vec 17 val)) -(define (dboard:data-set-target! vec val)(vector-set! vec 18 val)) -(define (dboard:data-set-run-name! vec val)(vector-set! vec 19 val)) -(define (dboard:data-set-runs-listbox! vec val)(vector-set! vec 20 val)) -(define (dboard:data-set-area-path! vec val)(vector-set! vec 21 val)) - -(dboard:data-set-run-keys! *data* (make-hash-table)) - -;; List of test ids being viewed in various panels -(dboard:data-set-curr-test-ids! *data* (make-hash-table)) - -;; Look up test-ids by (key1 key2 ... testname [itempath]) -(dboard:data-set-path-test-ids! *data* (make-hash-table)) - -;; Look up run-ids by ?? -(dboard:data-set-path-run-ids! *data* (make-hash-table)) +;; all areas tracked. +;; + + +(define-record dboard:areas + areas ;; hash of name -> area + ) + +(define-record dboard:area + read-only ;; #t => can't write + dbstruct ;; database connector + area-dat ;; the one-structure (one day dbstruct will be put in here) + name ;; name for this area + mpath ;; path to the megatest home (MT_RUN_AREA_HOME) + view-path ;; //... + view-type ;; standard, etc. + matrix ;; the spreadsheet + controls ;; the controls + data ;; all the data kept in sync with db + filters ;; user filters + run-id ;; the current run-id + test-ids ;; the current test id hash, run-id => test-id + command ;; the command from the entry field + ) + +(define-record dboard:filter + target ;; hash of widgets for the target + runname ;; the runname widget + testpatt ;; the testpatt widget + ) + +(define-record dboard:area-dat + run-keys + runs + tests + ) ;;====================================================================== ;; D O T F I L E ;;====================================================================== @@ -177,15 +144,10 @@ ;;====================================================================== ;; P R O C E S S R U N S ;;====================================================================== -;; MOVE THIS INTO *data* -(define *cachedata* (make-hash-table)) -(hash-table-set! *cachedata* "runid-to-col" (make-hash-table)) -(hash-table-set! *cachedata* "testname-to-row" (make-hash-table)) - ;; TO-DO ;; 1. Make "data" hash-table hierarchial store of all displayed data ;; 2. Update synchash to understand "get-runs", "get-tests" etc. ;; 3. Add extraction of filters to synchash calls ;; Index: docs/manual/howto.txt ================================================================== --- docs/manual/howto.txt +++ docs/manual/howto.txt @@ -26,12 +26,30 @@ [jobgroups] group1 10 custdes 4 --------------- +Limiting Job Runtime +-------------------- + +runtimlim can be set in megatest.config (affects all tests), +runconfigs (modifies for all tests based on a run) or in the +testconfig (affects only that test). The default in all cases is unlimited. +.megatest.config or runconfig +------------------------- +[setup] +# Default runtimelim 1d 1h 1m 10s +# +runtimelim 20m +------------------------- +.testconfig +------------------------- +[requirements] +runtimelim 1h 5m +------------------------- Debugging Tricks ---------------- Examining The Environment Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -1,11 +1,11 @@ - + The Megatest Users Manual