Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -152,14 +152,24 @@ $(PREFIX)/share/db/mt-pg.sql : mt-pg.sql mkdir -p $(PREFIX)/share/db $(INSTALL) mt-pg.sql $(PREFIX)/share/db/mt-pg.sql # Include the generated dependency file -include build.inc +# include build.inc # Special dependencies for the module includes $(MOFILE) $(MOIMPFILES) : megatest-fossil-hash.scm +# we are going to generate this by running make without -j +# and only adding the needed deps. The full deps have too many +# circular deps and can not (yet) be resolved. + +mofiles/configfmod.o mofiles/ods.o : mofiles/commonmod.o +mofiles/dbmod.o : mofiles/commonmod.o mofiles/ods.o mofiles/configfmod.o + +dcommon.o : mofiles/dcommonmod.o + + # megatest.o : $(MOIMPFILES) # mofiles/commonmod.o : megatest-fossil-hash.scm # mofiles/dbmod.o \ # mofiles/servermod.o \ # mofiles/apimod.o \ Index: build.inc ================================================================== --- build.inc +++ build.inc @@ -1,294 +1,288 @@ # To regenerate this file do: # (cd utils/;ck52 csc gendeps.scm) && ./utils/gendeps allunits *scm # cp allunits.inc build.inc # -# dashboard.o : commonmod.import.o -# dashboard.o : configfmod.import.o -# dashboard.o : dcommonmod.import.o -# megatest.o : apimod.import.o -# megatest.o : commonmod.import.o -# megatest.o : configfmod.import.o -# megatest.o : dbmod.import.o -# megatest.o : ods.import.o -# megatest.o : rmtmod.import.o -# megatest.o : servermod.import.o +mofiles/apimod.o : mofiles/commonmod.o +api.o : rmt.o api.o : db.o +api.o : tasks.o +api.o : mofiles/commonmod.o api.o : mofiles/apimod.o -api.o : mofiles/commonmod.o api.o : mofiles/dbmod.o -api.o : rmt.o -api.o : tasks.o +archive.o : db.o archive.o : common.o -archive.o : db.o -archive.o : mofiles/commonmod.o archive.o : mofiles/configfmod.o +archive.o : mofiles/commonmod.o archive.o : mofiles/dbmod.o client.o : common.o client.o : db.o client.o : mofiles/commonmod.o client.o : mofiles/dbmod.o -client.o : mofiles/servermod.o client.o : rmt.o +client.o : mofiles/servermod.o common.o : mofiles/commonmod.o -common.o : mofiles/configfmod.o common.o : mofiles/dbmod.o +common.o : mofiles/configfmod.o common.o : mofiles/servermod.o +mofiles/configfmod.o : mofiles/commonmod.o +configf.o : process.o configf.o : env.o configf.o : mofiles/commonmod.o configf.o : mofiles/configfmod.o -configf.o : process.o dashboard-context-menu.o : common.o dashboard-context-menu.o : db.o -dashboard-context-menu.o : ezsteps.o dashboard-context-menu.o : gutils.o +dashboard-context-menu.o : rmt.o +dashboard-context-menu.o : ezsteps.o +dashboard-context-menu.o : subrun.o dashboard-context-menu.o : mofiles/commonmod.o dashboard-context-menu.o : mofiles/configfmod.o dashboard-context-menu.o : mofiles/dbmod.o -dashboard-context-menu.o : rmt.o -dashboard-context-menu.o : subrun.o dashboard-guimonitor.o : common.o dashboard-guimonitor.o : db.o +dashboard-guimonitor.o : tasks.o dashboard-guimonitor.o : mofiles/commonmod.o dashboard-guimonitor.o : mofiles/dbmod.o -dashboard-guimonitor.o : tasks.o +dashboard.o : common.o +dashboard.o : margs.o +dashboard.o : items.o +dashboard.o : db.o +dashboard.o : configf.o +dashboard.o : process.o +dashboard.o : launch.o +dashboard.o : runs.o +dashboard.o : dashboard-tests.o +dashboard.o : dashboard-guimonitor.o +dashboard.o : tree.o +dashboard.o : dcommon.o +dashboard.o : dashboard-context-menu.o +dashboard.o : vg.o +dashboard.o : subrun.o +dashboard.o : mt.o +dashboard.o : mofiles/commonmod.o +# dashboard.o : commonmod.import.o +dashboard.o : mofiles/configfmod.o +# dashboard.o : configfmod.import.o +dashboard.o : mofiles/dcommonmod.o +# dashboard.o : dcommonmod.import.o +dashboard.o : mofiles/apimod.o +dashboard.o : mofiles/dbmod.o +dashboard.o : mofiles/servermod.o dashboard-tests.o : common.o dashboard-tests.o : db.o -dashboard-tests.o : ezsteps.o dashboard-tests.o : gutils.o +dashboard-tests.o : rmt.o +dashboard-tests.o : ezsteps.o +dashboard-tests.o : subrun.o dashboard-tests.o : mofiles/commonmod.o dashboard-tests.o : mofiles/configfmod.o dashboard-tests.o : mofiles/dbmod.o -dashboard-tests.o : rmt.o -dashboard-tests.o : subrun.o -dashboard.o : common.o -dashboard.o : configf.o -dashboard.o : dashboard-context-menu.o -dashboard.o : dashboard-guimonitor.o -dashboard.o : dashboard-tests.o -dashboard.o : db.o -dashboard.o : dcommon.o -dashboard.o : items.o -dashboard.o : launch.o -dashboard.o : margs.o -dashboard.o : mofiles/apimod.o -dashboard.o : mofiles/commonmod.o -dashboard.o : mofiles/configfmod.o -dashboard.o : mofiles/dbmod.o -dashboard.o : mofiles/dcommonmod.o -dashboard.o : mofiles/servermod.o -dashboard.o : mt.o -dashboard.o : process.o -dashboard.o : runs.o -dashboard.o : subrun.o -dashboard.o : tree.o -dashboard.o : vg.o +mofiles/dbmod.o : mofiles/commonmod.o +mofiles/dbmod.o : ods.o +mofiles/dbmod.o : mofiles/configfmod.o +db.o : common.o db.o : client.o -db.o : common.o +db.o : mt.o db.o : mofiles/commonmod.o db.o : mofiles/configfmod.o db.o : mofiles/dbmod.o db.o : mofiles/servermod.o -db.o : mt.o -dcommon.o : db.o +mofiles/dcommonmod.o : mofiles/commonmod.o +mofiles/dcommonmod.o : mofiles/configfmod.o dcommon.o : gutils.o +dcommon.o : db.o dcommon.o : mofiles/commonmod.o -dcommon.o : mofiles/configfmod.o dcommon.o : mofiles/dbmod.o +dcommon.o : mofiles/configfmod.o dcommon.o : mofiles/dcommonmod.o dcommon.o : mofiles/servermod.o diff-report.o : common.o -diff-report.o : mofiles/commonmod.o diff-report.o : rmt.o +diff-report.o : mofiles/commonmod.o env.o : mofiles/commonmod.o -ezsteps.o : common.o ezsteps.o : db.o +ezsteps.o : common.o ezsteps.o : items.o +ezsteps.o : runconfig.o ezsteps.o : mofiles/commonmod.o ezsteps.o : mofiles/configfmod.o ezsteps.o : mofiles/dbmod.o -ezsteps.o : runconfig.o genexample.o : mofiles/commonmod.o http-transport.o : common.o http-transport.o : db.o +http-transport.o : portlogger.o +http-transport.o : rmt.o http-transport.o : mofiles/commonmod.o http-transport.o : mofiles/configfmod.o http-transport.o : mofiles/dbmod.o http-transport.o : mofiles/servermod.o -http-transport.o : portlogger.o -http-transport.o : rmt.o -http-transport.o : server.o -http-transport.o : tests.o +index-tree.o : lock-queue.o +index-tree.o : db.o index-tree.o : common.o -index-tree.o : db.o index-tree.o : items.o -index-tree.o : lock-queue.o -index-tree.o : mofiles/commonmod.o index-tree.o : runconfig.o +index-tree.o : mofiles/commonmod.o items.o : common.o items.o : mofiles/commonmod.o items.o : mofiles/configfmod.o +launch.o : subrun.o launch.o : common.o launch.o : configf.o launch.o : db.o launch.o : ezsteps.o launch.o : mofiles/commonmod.o launch.o : mofiles/configfmod.o launch.o : mofiles/dbmod.o -launch.o : subrun.o lock-queue.o : common.o +lock-queue.o : tasks.o lock-queue.o : mofiles/commonmod.o -lock-queue.o : tasks.o -megatest.o : api.o -megatest.o : client.o megatest.o : common.o -megatest.o : db.o -megatest.o : diff-report.o -megatest.o : env.o +megatest.o : margs.o +megatest.o : runs.o +megatest.o : launch.o +megatest.o : server.o +megatest.o : client.o +megatest.o : tests.o megatest.o : genexample.o -megatest.o : launch.o -megatest.o : margs.o -megatest.o : mofiles/apimod.o +megatest.o : db.o +megatest.o : tdb.o +megatest.o : mt.o +megatest.o : api.o +megatest.o : env.o +megatest.o : diff-report.o megatest.o : mofiles/commonmod.o +# megatest.o : commonmod.import.o megatest.o : mofiles/configfmod.o -megatest.o : mofiles/dbmod.o -megatest.o : mofiles/rmtmod.o -megatest.o : mofiles/servermod.o -megatest.o : mt.o +# megatest.o : configfmod.import.o megatest.o : ods.o -megatest.o : runs.o -megatest.o : server.o -megatest.o : tdb.o -megatest.o : tests.o -mlaunch.o : common.o +# megatest.o : ods.import.o +megatest.o : mofiles/dbmod.o +# megatest.o : dbmod.import.o +megatest.o : mofiles/servermod.o +# megatest.o : servermod.import.o +megatest.o : mofiles/apimod.o +# megatest.o : apimod.import.o +megatest.o : mofiles/rmtmod.o +# megatest.o : rmtmod.import.o mlaunch.o : db.o -mofiles/apimod.o : mofiles/commonmod.o -mofiles/configfmod.o : mofiles/commonmod.o -mofiles/dbmod.o : mofiles/commonmod.o -mofiles/dbmod.o : mofiles/configfmod.o -mofiles/dbmod.o : ods.o -mofiles/dcommonmod.o : mofiles/commonmod.o -mofiles/dcommonmod.o : mofiles/configfmod.o -mofiles/rmtmod.o : mofiles/apimod.o -mofiles/rmtmod.o : mofiles/commonmod.o -mofiles/rmtmod.o : mofiles/dbmod.o -mofiles/servermod.o : mofiles/commonmod.o -mofiles/servermod.o : mofiles/configfmod.o -mofiles/servermod.o : mofiles/dbmod.o -monitor.o : common.o +mlaunch.o : common.o monitor.o : db.o +monitor.o : common.o monitor.o : items.o monitor.o : runconfig.o -mt.o : common.o +mtexec.o : margs.o +mtexec.o : configf.o +mtexec.o : mofiles/configfmod.o mt.o : db.o -mt.o : items.o +mt.o : common.o +mt.o : tests.o +mt.o : rmt.o mt.o : mofiles/commonmod.o mt.o : mofiles/configfmod.o mt.o : mofiles/dbmod.o -mt.o : rmt.o -mt.o : runconfig.o -mt.o : runs.o -mt.o : server.o -mt.o : tests.o -mtexec.o : configf.o -mtexec.o : margs.o -mtexec.o : mofiles/configfmod.o mtut.o : common.o -mtut.o : configf.o mtut.o : margs.o +mtut.o : configf.o mtut.o : mofiles/commonmod.o mtut.o : mofiles/configfmod.o newdashboard.o : common.o -newdashboard.o : dcommon.o -newdashboard.o : margs.o newdashboard.o : megatest-version.o +newdashboard.o : margs.o newdashboard.o : mofiles/commonmod.o -newdashboard.o : mofiles/configfmod.o newdashboard.o : mofiles/dbmod.o +newdashboard.o : dcommon.o +newdashboard.o : mofiles/configfmod.o ods.o : mofiles/commonmod.o portlogger.o : db.o portlogger.o : mofiles/commonmod.o portlogger.o : mofiles/configfmod.o portlogger.o : mofiles/dbmod.o process.o : mofiles/commonmod.o +mofiles/rmtmod.o : mofiles/commonmod.o +mofiles/rmtmod.o : mofiles/apimod.o +mofiles/rmtmod.o : mofiles/dbmod.o rmt.o : api.o rmt.o : http-transport.o -rmt.o : mofiles/apimod.o rmt.o : mofiles/commonmod.o -rmt.o : mofiles/configfmod.o +rmt.o : mofiles/apimod.o +rmt.o : mofiles/rmtmod.o rmt.o : mofiles/dbmod.o -rmt.o : mofiles/rmtmod.o +rmt.o : mofiles/configfmod.o rmt.o : mofiles/servermod.o runconfig.o : common.o runconfig.o : mofiles/commonmod.o -runs.o : archive.o +runs.o : db.o runs.o : common.o -runs.o : db.o runs.o : items.o +runs.o : runconfig.o +runs.o : tests.o +runs.o : server.o +runs.o : mt.o +runs.o : archive.o runs.o : mofiles/commonmod.o runs.o : mofiles/configfmod.o runs.o : mofiles/dbmod.o runs.o : mofiles/servermod.o -runs.o : mt.o -runs.o : runconfig.o -runs.o : server.o -runs.o : tests.o +mofiles/servermod.o : mofiles/commonmod.o +mofiles/servermod.o : mofiles/configfmod.o +mofiles/servermod.o : mofiles/dbmod.o server.o : common.o server.o : db.o server.o : http-transport.o server.o : launch.o server.o : mofiles/commonmod.o -server.o : mofiles/configfmod.o server.o : mofiles/dbmod.o +server.o : mofiles/configfmod.o server.o : mofiles/servermod.o sharedat.o : configf.o sharedat.o : margs.o sharedat.o : megatest-version.o spublish.o : margs.o -subrun.o : common.o subrun.o : db.o +subrun.o : common.o +subrun.o : mt.o subrun.o : mofiles/commonmod.o subrun.o : mofiles/configfmod.o subrun.o : mofiles/dbmod.o -subrun.o : mt.o synchash.o : db.o +synchash.o : server.o synchash.o : mofiles/dbmod.o -synchash.o : server.o -tasks.o : cgisetup/models/pgdb.o +tasks.o : db.o +tasks.o : rmt.o tasks.o : common.o -tasks.o : db.o +tasks.o : cgisetup/models/pgdb.o tasks.o : mofiles/commonmod.o tasks.o : mofiles/configfmod.o tasks.o : mofiles/dbmod.o -tasks.o : rmt.o -tcmt.o : common.o tcmt.o : margs.o +tcmt.o : rmt.o +tcmt.o : common.o tcmt.o : mofiles/commonmod.o -tcmt.o : rmt.o +tdb.o : common.o tdb.o : client.o -tdb.o : common.o +tdb.o : mt.o tdb.o : db.o tdb.o : mofiles/commonmod.o tdb.o : mofiles/dbmod.o -tdb.o : mt.o tdb.o : ods.o -tests.o : common.o +tests.o : lock-queue.o tests.o : db.o +tests.o : tdb.o +tests.o : common.o tests.o : items.o -tests.o : lock-queue.o -tests.o : mofiles/commonmod.o -tests.o : mofiles/configfmod.o -tests.o : mofiles/dbmod.o -tests.o : mofiles/servermod.o tests.o : runconfig.o tests.o : server.o -tests.o : tdb.o -tree.o : db.o -tree.o : dcommon.o -tree.o : gutils.o +tests.o : mofiles/commonmod.o +tests.o : mofiles/dbmod.o +tests.o : mofiles/configfmod.o +tests.o : mofiles/servermod.o +tree.o : margs.o tree.o : launch.o -tree.o : margs.o +tree.o : gutils.o +tree.o : db.o +tree.o : server.o +tree.o : dcommon.o tree.o : mofiles/commonmod.o tree.o : mofiles/dbmod.o -tree.o : server.o ulex.o : pkts.o Index: http-transport.scm ================================================================== --- http-transport.scm +++ http-transport.scm @@ -28,13 +28,12 @@ (declare (unit http-transport)) (declare (uses common)) (declare (uses db)) -(declare (uses tests)) (declare (uses tasks)) ;; tasks are where stuff is maintained about what is running. -(declare (uses server)) +;; (declare (uses server)) ;; (declare (uses daemon)) (declare (uses portlogger)) (declare (uses rmt)) (declare (uses commonmod)) @@ -49,13 +48,14 @@ (declare (uses servermod)) (import servermod) (include "common_records.scm") (include "db_records.scm") -(include "js-path.scm") +;; (include "js-path.scm") -(require-library stml) +;; (require-library stml) + (define (http-transport:make-server-url hostport) (if (not hostport) #f (conc "http://" (car hostport) ":" (cadr hostport)))) @@ -647,97 +647,7 @@ ;; "exit on ^C timer"))) ;; (thread-start! th2) ;; (thread-start! th1) ;; (thread-join! th2)))) -;;=============================================== -;; Java script -;;=============================================== -(define (http-transport:show-jquery) - (let* ((data (tests:readlines *java-script-lib*))) -(string-join data "\n"))) - - - -;;====================================================================== -;; web pages -;;====================================================================== - -(define (http-transport:html-test-log $) - (let* ((run-id ($ 'runid)) - (test-item ($ 'testname)) - (parts (string-split test-item ":")) - (test-name (car parts)) - - (item-name (if (equal? (length parts) 1) - "" - (cadr parts)))) - ;(print $) -(tests:get-test-log run-id test-name item-name))) - - -(define (http-transport:html-dboard $) - (let* ((page ($ 'page)) - (oup (open-output-string)) - (bdy "--------------------------") - - (ret (tests:dynamic-dboard page))) - (s:output-new oup ret) - (close-output-port oup) - - (set! bdy (get-output-string oup)) - (conc "

Dashboard

" bdy "

" ))) - -(define (http-transport:main-page) - (let ((linkpath (root-path))) - (conc "

" (pathname-strip-directory *toppath*) "

" - "" - "Run area: " *toppath* - "

Server Stats

" - (http-transport:stats-table) - "
" - (http-transport:runs linkpath) - "
" - ;; (http-transport:run-stats) - "" - ))) - -(define (http-transport:stats-table) - (mutex-lock! *heartbeat-mutex*) - (let ((res - (conc "" - ;; "" - "" - "" - "" - ;; "" - "" - "
Max cached queries " *max-cache-size* "
Number of cached writes " *number-of-writes* "
Average cached write time " (if (eq? *number-of-writes* 0) - "n/a (no writes)" - (/ *writes-total-delay* - *number-of-writes*)) - " ms
Number non-cached queries " *number-non-write-queries* "
Average non-cached time " (if (eq? *number-non-write-queries* 0) - ;; "n/a (no queries)" - ;; (/ *total-non-write-delay* - ;; *number-non-write-queries*)) - " ms
Last access" (seconds->time-string *db-last-access*) "
"))) - (mutex-unlock! *heartbeat-mutex*) - res)) - -(define (http-transport:runs linkpath) - (conc "

Runs

" - (string-intersperse - (let ((files (map pathname-strip-directory (glob (conc linkpath "/*"))))) - (map (lambda (p) - (conc "" p "
")) - files)) - " "))) - -#;(define (http-transport:run-stats) - (let ((stats (open-run-close db:get-running-stats #f))) - (conc "" - (string-intersperse - (map (lambda (stat) - (conc "")) - stats) - " ") - "
" (car stat) "" (cadr stat) "
"))) + + Index: mt.scm ================================================================== --- mt.scm +++ mt.scm @@ -21,15 +21,15 @@ (import (prefix sqlite3 sqlite3:)) (declare (unit mt)) (declare (uses db)) (declare (uses common)) -(declare (uses items)) -(declare (uses runconfig)) +;; (declare (uses items)) +;; (declare (uses runconfig)) (declare (uses tests)) -(declare (uses server)) -(declare (uses runs)) +;; (declare (uses server)) +;; (declare (uses runs)) (declare (uses rmt)) ;; (declare (uses filedb)) (declare (uses commonmod)) (import commonmod) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -55,10 +55,108 @@ (include "js-path.scm") (define (init-java-script-lib) (set! *java-script-lib* (conc (common:get-install-area) "/share/js/jquery-3.1.0.slim.min.js")) ) + + +;;====================================================================== +;; Stuff from http-transport +;;====================================================================== + +;;=============================================== +;; Java script +;;=============================================== +(define (http-transport:show-jquery) + (let* ((data (tests:readlines *java-script-lib*))) +(string-join data "\n"))) + +;;====================================================================== +;; web pages +;;====================================================================== + +(define (http-transport:html-test-log $) + (let* ((run-id ($ 'runid)) + (test-item ($ 'testname)) + (parts (string-split test-item ":")) + (test-name (car parts)) + + (item-name (if (equal? (length parts) 1) + "" + (cadr parts)))) + ;(print $) +(tests:get-test-log run-id test-name item-name))) + + +(define (http-transport:html-dboard $) + (let* ((page ($ 'page)) + (oup (open-output-string)) + (bdy "--------------------------") + + (ret (tests:dynamic-dboard page))) + (s:output-new oup ret) + (close-output-port oup) + + (set! bdy (get-output-string oup)) + (conc "

Dashboard

" bdy "

" ))) + +(define (http-transport:main-page) + (let ((linkpath (root-path))) + (conc "

" (pathname-strip-directory *toppath*) "

" + "" + "Run area: " *toppath* + "

Server Stats

" + (http-transport:stats-table) + "
" + (http-transport:runs linkpath) + "
" + ;; (http-transport:run-stats) + "" + ))) + +(define (http-transport:stats-table) + (mutex-lock! *heartbeat-mutex*) + (let ((res + (conc "" + ;; "" + "" + "" + "" + ;; "" + "" + "
Max cached queries " *max-cache-size* "
Number of cached writes " *number-of-writes* "
Average cached write time " (if (eq? *number-of-writes* 0) + "n/a (no writes)" + (/ *writes-total-delay* + *number-of-writes*)) + " ms
Number non-cached queries " *number-non-write-queries* "
Average non-cached time " (if (eq? *number-non-write-queries* 0) + ;; "n/a (no queries)" + ;; (/ *total-non-write-delay* + ;; *number-non-write-queries*)) + " ms
Last access" (seconds->time-string *db-last-access*) "
"))) + (mutex-unlock! *heartbeat-mutex*) + res)) + +(define (http-transport:runs linkpath) + (conc "

Runs

" + (string-intersperse + (let ((files (map pathname-strip-directory (glob (conc linkpath "/*"))))) + (map (lambda (p) + (conc "" p "
")) + files)) + " "))) + +#;(define (http-transport:run-stats) + (let ((stats (open-run-close db:get-running-stats #f))) + (conc "" + (string-intersperse + (map (lambda (stat) + (conc "")) + stats) + " ") + "
" (car stat) "" (cadr stat) "
"))) + + ;; Call this one to do all the work and get a standardized list of tests ;; gets paths from configs and finds valid tests ;; returns hash of testname --> fullpath ;;