Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -66,11 +66,12 @@ delete-test-records delete-old-deleted-test-records test-set-status-state test-set-top-process-pid roll-up-pass-fail-counts - update-fail-pass-counts + update-pass-fail-counts + top-test-set-per-pf-counts ;; (db:top-test-set-per-pf-counts (db:get-db *db* 5) 5 "runfirst") ;; RUNS register-run set-tests-state-status delete-run @@ -133,10 +134,11 @@ ((delete-old-deleted-test-records) (apply db:delete-old-deleted-test-records dbstruct params)) ((test-set-status-state) (apply db:test-set-status-state dbstruct params)) ((test-set-top-process-pid) (apply db:test-set-top-process-pid dbstruct params)) ((roll-up-pass-fail-counts) (apply db:roll-up-pass-fail-counts dbstruct params)) ((update-pass-fail-counts) (apply db:general-call dbstruct 'update-pass-fail-counts params)) + ((top-test-set-per-pf-counts) (apply db:top-test-set-per-pf-counts dbstruct params)) ((test-set-archive-block-id) (apply db:test-set-archive-block-id dbstruct params)) ;; RUNS ((register-run) (apply db:register-run dbstruct params)) ((set-tests-state-status) (apply db:set-tests-state-status dbstruct params)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1338,15 +1338,15 @@ (db:delay-if-busy dbdat) (for-each (lambda (toptest) (let ((test-name (list-ref toptest 3))) ;; (run-id (list-ref toptest 5))) - (db:top-test-set-per-pf-counts dbdat run-id test-name))) + (db:top-test-set-per-pf-counts dbstruct run-id test-name))) toplevels))) -(define (db:top-test-set-per-pf-counts dbdat run-id test-name) - (db:general-call dbdat 'top-test-set-per-pf-counts (list test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name))) +(define (db:top-test-set-per-pf-counts dbstruct run-id test-name) + (db:general-call (db:get-db dbstruct run-id) 'top-test-set-per-pf-counts (list test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name test-name))) ;; Clean out old junk and vacuum the database ;; ;; Ultimately do something like this: @@ -2841,11 +2841,11 @@ (define (db:roll-up-pass-fail-counts dbstruct run-id test-name item-path state status) (if (not (equal? item-path "")) (let ((dbdat (db:get-db dbstruct run-id))) ;; (db (db:dbdat-get-db dbdat))) (db:general-call dbdat 'update-pass-fail-counts (list test-name test-name test-name)) - (db:top-test-set-per-pf-counts dbdat run-id test-name)))) + (db:top-test-set-per-pf-counts dbstruct run-id test-name)))) ;; (case (string->symbol status) ;; ((RUNNING) (db:general-call dbdat 'top-test-set-running (list test-name))) ;; ((LAUNCHED) (db:general-call dbdat 'top-test-set (list "LAUNCHED" test-name))) ;; ((ABORT INCOMPLETE) (db:general-call dbdat 'top-test-set (list status test-name)))) @@ -2941,11 +2941,11 @@ SET state=CASE WHEN (SELECT count(id) FROM tests WHERE testname=? AND item_path != '' AND status IN ('INCOMPLETE') - AND state in ('RUNNING','NOT_STARTED','LAUNCHED','REMOTEHOSTSTART')) > 0 THEN 'INCOMPLETE' + AND state in ('RUNNING','NOT_STARTED','LAUNCHED','REMOTEHOSTSTART')) > 0 THEN 'RUNNING' WHEN (SELECT count(id) FROM tests WHERE testname=? AND item_path != '' AND status NOT IN ('TEN_STRIKES','BLOCKED') AND state in ('RUNNING','NOT_STARTED','LAUNCHED','REMOTEHOSTSTART')) > 0 THEN 'RUNNING' @@ -2966,11 +2966,11 @@ AND state IN ('BLOCKED','INCOMPLETE')) > 0 THEN 'FAIL' WHEN (SELECT count(id) FROM tests WHERE testname=? AND item_path != '' AND state NOT IN ('DELETED') - AND status = 'ABORT') > 0 THEN 'ABORT' + AND status IN ('INCOMPLETE','ABORT')) > 0 THEN 'ABORT' WHEN (SELECT count(id) FROM tests WHERE testname=? AND item_path != '' AND state NOT IN ('DELETED') AND status = 'AUTO') > 0 THEN 'AUTO' Index: docs/manual/howto.txt ================================================================== --- docs/manual/howto.txt +++ docs/manual/howto.txt @@ -78,11 +78,11 @@ # match. flexi-launcher yes ------------------------ Tricks ------- +====== This section is a compendium of a various useful tricks for debugging, configuring and generally getting the most out of Megatest. Limiting your running jobs Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -986,17 +986,13 @@ flexi-launcher yes -
-

Tricks

-
+

Tricks

This section is a compendium of a various useful tricks for debugging, configuring and generally getting the most out of Megatest.

-
-

Limiting your running jobs

The following example will limit a test in the jobgroup "group1" to no more than 10 tests simultaneously.

In your testconfig:

@@ -1555,10 +1551,10 @@

Index: docs/manual/server.png ================================================================== --- docs/manual/server.png +++ docs/manual/server.png cannot compute difference between binary files Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -475,11 +475,12 @@ )) ;; for automated creation of the rollup html file this is a good place... ;; (if (and (not (equal? item-path "")) ;; (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5)) (tests:summarize-items run-id test-id test-name #f) - (tests:summarize-test run-id test-id)) ;; don't force - just update if no + (tests:summarize-test run-id test-id) ;; don't force - just update if no + ) (mutex-unlock! m) (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n") (if (not (vector-ref exit-info 1)) (exit 4))))))) @@ -494,11 +495,11 @@ (begin (set! *configinfo* (or (if (get-environment-variable "MT_CMDINFO") ;; we are inside a test - do not reprocess configs (let ((alistconfig (conc (get-environment-variable "MT_LINKTREE") "/" (get-environment-variable "MT_TARGET") "/" (get-environment-variable "MT_RUNNAME") "/" - ".megatest.cfg"))) + ".megatest.cfg-" megatest-version "-" megatest-fossil-hash))) (if (file-exists? alistconfig) (list (configf:read-alist alistconfig) (get-environment-variable "MT_RUN_AREA_HOME")) #f)) #f) ;; no config cached - give up @@ -573,11 +574,11 @@ (create-directory fulldir #t)) ;; need to protect with exception handler (if (and target runname (file-exists? fulldir)) (let ((tmpfile (conc fulldir "/.megatest.cfg." (current-seconds))) - (targfile (conc fulldir "/.megatest.cfg"))) + (targfile (conc fulldir "/.megatest.cfg-" megatest-version "-" megatest-fossil-hash))) (debug:print-info 0 "Caching megatest.config in " fulldir "/.megatest.cfg") (configf:write-alist *configdat* tmpfile) (system (conc "ln -sf " tmpfile " " targfile)) ))))))) Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -529,10 +529,13 @@ (rmt:send-receive 'roll-up-pass-fail-counts run-id (list run-id test-name item-path state status))) (define (rmt:update-pass-fail-counts run-id test-name) (rmt:general-call 'update-pass-fail-counts run-id (list run-id test-name run-id test-name run-id test-name))) +(define (rmt:top-test-set-per-pf-counts run-id test-name) + (rmt:general-call 'top-test-set-per-pf-counts run-id (list run-id test-name))) + ;;====================================================================== ;; R U N S ;;====================================================================== (define (rmt:get-run-info run-id) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -350,10 +350,11 @@ (if have-lock (let ((script (configf:lookup *configdat* "testrollup" test-name))) (print "Obtained lock for " outputfilename) ;; (rmt:top-test-set-per-pf-counts run-id test-name) (rmt:roll-up-pass-fail-counts run-id test-name "" #f #f) + (rmt:top-test-set-per-pf-counts run-id test-name) (if script (system (conc script " > " outputfilename " & ")) (tests:generate-html-summary-for-iterated-test run-id test-id test-name outputfilename)) (common:simple-file-release-lock lockf) (change-directory orig-dir) Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -232,14 +232,15 @@ # /// disk0 /tmp/#{getenv USER}/adisk1 # Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) [jobtools] -# launcher #{ scheme (case (string->symbol (conc (getenv "datapath"))) \ -# ((none) "nbfake") \ -# ((openlava) "bsub") \ -# (else "sleeprunner"))} +launcher #{scheme (case (string->symbol (conc (getenv "datapath"))) \ + ((none) "nbfake") \ + ((openlava) "bsub") \ + ((sleeprunner) "sleeprunner") + (else "nbfake"))} # launcher bsub -q priority -o $MT_TEST_RUN_DIR/openlava.log # launcher #{shell if which bsub > /dev/null;then echo bsub -q priority -o openlava.log;else echo sleeprunner;fi} launcher nbfake @@ -285,10 +286,11 @@ [jobtools] flexi-launcher yes [host-types] general nbfake -remote bsub +remote #{get jobtools launcher} +# remote nbfake [launchers] runfirst/sum% remote - +% general