Index: apimod.scm ================================================================== --- apimod.scm +++ apimod.scm @@ -24,11 +24,17 @@ (declare (uses debugprint)) (declare (uses tasksmod)) (declare (uses servermod)) (module apimod - * + ( +api:run-server-process +api:start-server +api:dispatch-cmd +api:execute-requests +api:process-request +) (import scheme chicken.base chicken.process-context.posix chicken.string Index: archivemod.scm ================================================================== --- archivemod.scm +++ archivemod.scm @@ -33,11 +33,26 @@ (declare (uses launchmod)) (declare (uses processmod)) (declare (uses servermod)) (module archivemod - * + ( +archive:get-archive-disks +archive:get-archive +archive:allocate-new-archive-block +archive:run-bup +archive:megatest-db +archive:restore-db +archive:ls->list +time-string->seconds +seconds->std-time-str +archive:get-timestamp-dir +archive:bup-restore +common:get-youngest-test +archive:bup-get-data +) + (import scheme (prefix sqlite3 sqlite3:) chicken.base chicken.condition Index: commonmod.scm ================================================================== --- commonmod.scm +++ commonmod.scm @@ -31,11 +31,486 @@ ;; odd but it works? ;; (declare (uses itemsmod)) (module commonmod - * + ( +make-db:test +db:test-get-id +db:test-get-run_id +db:test-get-testname +db:test-get-state +db:test-get-status +db:test-get-event_time +db:test-get-host +db:test-get-cpuload +db:test-get-diskfree +db:test-get-uname +db:test-get-rundir +db:test-get-item-path +db:test-get-run_duration +db:test-get-final_logf +db:test-get-comment +db:test-get-process_id +db:test-get-archived +db:test-get-last_update +db:test-get-fullname +db:test-make-full-name +db:test-get-first_err +db:test-get-first_warn +db:test-set-cpuload! +db:test-set-diskfree! +db:test-set-testname! +db:test-set-state! +db:test-set-status! +db:test-set-run_duration! +db:test-set-final_logf! +db:test-get-is-toplevel +make-db:mintest +db:mintest-get-id +db:mintest-get-run_id +db:mintest-get-testname +db:mintest-get-state +db:mintest-get-status +db:mintest-get-event_time +db:mintest-get-item_path +make-db:testmeta +db:testmeta-get-id +db:testmeta-get-testname +db:testmeta-get-author +db:testmeta-get-owner +db:testmeta-get-description +db:testmeta-get-reviewed +db:testmeta-get-iterated +db:testmeta-get-avg_runtime +db:testmeta-get-avg_disk +db:testmeta-get-tags +db:testmeta-set-id! +db:testmeta-set-testname! +db:testmeta-set-author! +db:testmeta-set-owner! +db:testmeta-set-description! +db:testmeta-set-reviewed! +db:testmeta-set-iterated! +db:testmeta-set-avg_runtime! +db:testmeta-set-avg_disk! +make-db:test-data +db:test-data-get-id +db:test-data-get-test_id +db:test-data-get-category +db:test-data-get-variable +db:test-data-get-value +db:test-data-get-expected +db:test-data-get-tol +db:test-data-get-units +db:test-data-get-comment +db:test-data-get-status +db:test-data-get-type +db:test-data-get-last_update +db:test-data-set-id! +db:test-data-set-test_id! +db:test-data-set-category! +db:test-data-set-variable! +db:test-data-set-value! +db:test-data-set-expected! +db:test-data-set-tol! +db:test-data-set-units! +db:test-data-set-comment! +db:test-data-set-status! +db:test-data-set-type! +make-db:step +tdb:step-get-id +tdb:step-get-test_id +tdb:step-get-stepname +tdb:step-get-state +tdb:step-get-status +tdb:step-get-event_time +tdb:step-get-logfile +tdb:step-get-comment +tdb:step-get-last_update +tdb:step-set-id! +tdb:step-set-test_id! +tdb:step-set-stepname! +tdb:step-set-state! +tdb:step-set-status! +tdb:step-set-event_time! +tdb:step-set-logfile! +tdb:step-set-comment! +make-db:steps-table +tdb:steps-table-get-stepname +tdb:steps-table-get-start +tdb:steps-table-get-end +tdb:steps-table-get-status +tdb:steps-table-get-runtime +tdb:steps-table-get-log-file +tdb:step-stable-set-stepname! +tdb:step-stable-set-start! +tdb:step-stable-set-end! +tdb:step-stable-set-status! +tdb:step-stable-set-runtime! +make-cdb:packet +cdb:packet-get-client-sig +cdb:packet-get-qtype +cdb:packet-get-immediate +cdb:packet-get-query-sig +cdb:packet-get-params +cdb:packet-get-qtime +cdb:packet-set-client-sig! +cdb:packet-set-qtype! +cdb:packet-set-immediate! +cdb:packet-set-query-sig! +cdb:packet-set-params! +cdb:packet-set-qtime! +runs:runrec-make-record +runs:runrec-get-target +runs:runrec-get-runname +runs:runrec-testpatt +runs:runrec-keys +runs:runrec-keyvals +runs:runrec-environment +runs:runrec-mconfig +runs:runrec-runconfig +runs:runrec-serverdat +runs:runrec-transport +runs:runrec-db +runs:runrec-top-path +runs:runrec-run_id +test:get-id +test:get-run_id +test:get-test-name +test:get-state +test:get-status +test:get-item-path +test:test-get-fullname +make-and-init-bigdata +call-with-environment-variables +common:simple-file-lock +common:simple-file-lock-and-wait +common:simple-file-release-lock +common:fail-safe +get-file-descriptor-count +common:get-this-exe-fullpath +common:get-sync-lock-filepath +common:find-local-megatest +common:logpro-exit-code->status-sym +common:worse-status-sym +common:steps-can-proceed-given-status-sym +status-sym->string +common:logpro-exit-code->test-status +common:clear-caches +common:get-full-version +common:version-signature +common:snapshot-file +common:rotate-logs +make-sparse-array +sparse-array? +sparse-array-ref +sparse-array-set! +common:db-block-further-queries +common:db-access-allowed? +common:to-alist +common:alist-ref/default +common:low-noise-print +common:get-megatest-exe +common:read-encoded-string +common:special-sort +get-with-default +assoc/default +common:get-area-name +common:get-toppath +common:get-db-tmp-area +common:get-signature +common:get-area-path-signature +common:calc-area-key +common:get-area-key +common:human-time +std-signal-handler +special-signal-handler +any->number +any->number-if-possible +patt-list-match +common:get-disks +common:which +common:get-install-area +common:get-create-writeable-dir +common:get-youngest +common:bash-glob +common:list-or-null +common:get-runconfig-targets +common:args-get-state +common:args-get-status +common:args-get-testpatt +common:false-on-exception +common:file-exists? +common:directory-exists? +common:directory-writable? +common:get-linktree +common:args-get-runname +common:args-get-target +common:get-full-test-name +common:use-cache? +common:force-server? +common:list-is-sublist +common:max +common:min-max +common:sum +common:list->htree +common:htree->html +common:htree->atree +common:sparse-list-generate-index +common:lazy-convert +common:val->alist +common:lazy-modification-time +common:lazy-sqlite-db-modification-time +common:get-intercept +common:get-delay +common:print-delay-table +get-cpu-load +common:get-cached-info +common:write-cached-info +common:raw-get-remote-host-load +common:get-cpu-load +common:get-normalized-cpu-load +common:get-normalized-cpu-load-raw +common:unix-ping +launch:is-test-alive +common:get-num-cpus +common:wait-for-normalized-load +common:wait-for-cpuload +tasks:kill-server +server:get-logs-list +server:get-list +server:get-num-alive +server:get-best +server:get-first-best +server:get-rand-best +server:record->id +server:get-num-servers +server:logf-get-start-info +get-uname +realpath +common:real-path +common:get-disk-space-used +get-df +get-free-inodes +get-unix-df +get-unix-inodes +common:check-space-in-dir +common:check-db-dir-space +common:check-db-dir-and-exit-if-insufficient +common:get-disk-with-most-free-space +common:spec-string->list-of-specs +common:file-find-rule +common:dir-clean-up +bb-check-path +save-environment-as-files +common:get-param-mapping +alist->env-vars +get-the-original-environment +common:with-orig-env +common:without-vars +common:run-a-command +common:hms-string->seconds +seconds->hr-min-sec +seconds->time-string +seconds->work-week/day-time +seconds->work-week/day +seconds->year-work-week/day +seconds->year-work-week/day-time +seconds->year-week/day-time +seconds->quarter +common:date-time->seconds +common:find-start-mark-and-mark-delta +common:expand-cron-slash +common:cron-expand +common:cron-event +common:extended-cron +common:name->iup-color +common:iup-color->rgb-hex +common:in-running-test? +common:get-color-from-status +common:load-views-config +hh:make-hh +hh:get +hh:set! +common:get-pkts-dirs +common:save-pkt +common:minimal-save-pkt +common:get-pkt-alists +common:get-pkt-times +common:send-thunk-to-background-thread +common:join-backgrounded-threads +dtests:get-pre-command +dtests:get-post-command +db:patt->like +tests:cache-regexp +tests:glob-like-match +tests:match +tests:match->sqlqry +tests:get-itemmaps +tests:lookup-itemmap +tests:get-tests-search-path +server:get-best-guess-address +tests:readlines +server:expiration-timeout +runs:get-mt-env-alist +keys:make-key/field-string +sexpr->string +string->sexpr +*bdat* +*user-hash-data* +*db-keys* +*pkts-info* +*configinfo* +*runconfigdat* +*configdat* +*configstatus* +*toppath* +*already-seen-runconfig-info* +*test-meta-updated* +*globalexitstatus* +*passnum* +*common:denoise* +*time-zero* +*default-area-tag* +*dbstruct-db* +*db-stats* +*db-stats-mutex* +*db-last-access* +*db-write-access* +*db-last-sync* +*db-sync-in-progress* +*db-multi-sync-mutex* +*task-db* +*db-access-allowed* +*db-access-mutex* +*db-transaction-mutex* +*db-cache-path* +*db-with-db-mutex* +*db-api-call-time* +*no-sync-db* +*my-signature* +*transport-type* +*logged-in-clients* +*server-info* +*server-run* +*run-id* +*server-kind-run* +*home-host* +*heartbeat-mutex* +*api-process-request-count* +*max-api-process-requests* +*server-overloaded* +*writes-total-delay* +*unclean-shutdown* +*rmt-mutex* +*keys* +*keyvals* +*toptest-paths* +*test-paths* +*test-ids* +*test-info* +*run-info-cache* +*launch-setup-mutex* +*homehost-mutex* +*triggers-mutex* +*numcpus-cache* +*host-loads* +*env-vars-by-run-id* +*testconfigs* +*runconfigs* +*pre-reqs-met-cache* +*verbosity-cache* +*fdb* +*last-launch* +*common:std-states* +*common:dont-roll-up-states* +*common:std-statuses* +*common:ended-states* +*common:badly-ended-states* +*common:well-ended-states* +*common:running-states* +*common:cant-run-states* +*common:not-started-ok-statuses* +*verbosity* +*logging* +*common:thread-punchlist* +*last-num-running-tests* +*seen-cant-run-tests* +*runs:denoise* +*max-tries-hash* +*send-receive-mutex* +*db:process-queue-mutex* +*http-functions* +*http-mutex* +*http-requests-in-progress* +*http-connections-next-cleanup* +*number-of-writes* +*number-non-write-queries* +*global-db-store* +*common:logpro-exit-code->status-sym-alist* +*glob-like-match-cache* + +;; bad name - clean this up +keys:config-get-fields +sdb:qry + +;; record accessors and settors + +bdat-home +bdat-user +bdat-watchdog +bdat-time-to-exit +bdat-task-db +bdat-target +bdat-this-exe-fullpath +bdat-this-exe-dir +bdat-this-exe-name +bdat-orig-env +bdat-runs-data + +bdat-task-db-set! +bdat-time-to-exit-set! +bdat-watchdog-set! +bdat-task-db-set! + +make-launch:einf +launch:einf-pid +launch:einf-exit-status +launch:einf-exit-code +launch:einf-rollup-status +launch:einf-pid-set! +launch:einf-exit-status-set! +launch:einf-exit-code-set! +launch:einf-rollup-status-set! + +make-host +host-reachable +host-last-update +host-last-used +host-last-cpuload +host-reachable-set! +host-last-update-set! +host-last-used-set! +host-last-cpuload-set! + +runs:gendat-inc-results +runs:gendat-inc-results-last-update +runs:gendat-inc-results-fmt +runs:gendat-run-info +runs:gendat-runname +runs:gendat-target +runs:gendat-inc-results-set! +runs:gendat-inc-results-last-update-set! +runs:gendat-inc-results-fmt-set! +runs:gendat-run-info-set! +runs:gendat-runname-set! +runs:gendat-target-set! + +megatest-fossil-hash +) + (import scheme chicken.base chicken.condition chicken.file Index: dashboard-context-menu.scm ================================================================== --- dashboard-context-menu.scm +++ dashboard-context-menu.scm @@ -36,11 +36,20 @@ (declare (uses debugprint)) (declare (uses testsmod)) (declare (uses dcommon)) (module dashboard-context-menu - * + ( +dboard:launch-testpanel +dashboard:run-menu-items +dashboard:test-menu-items +dashboard:step-logs-menu-item +dashboard:toplevel-menu-items +dashboard:custom-menu-items +dashboard:context-menu +) + (import format fmt) (import (prefix iup iup:)) (import canvas-draw) Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -37,11 +37,35 @@ (declare (uses mtmod)) (declare (uses dcommon)) (declare (uses launchmod)) (module dashboard-tests - * + ( +message-window +test-info-panel +test-meta-panel-get-description +test-meta-panel +run-info-panel +host-info-panel +submegatest-panel +update-state-status-buttons +set-fields-panel +dashboard-tests:run-a-step +dashboard-tests:waiver +dashboard-tests:examine-test +colors-similar? +dashboard:draw-tests +dboard:tabdat-test-patts-use +dashboard:update-run-command +iuplistbox-fill-list +*tim* +*dashboard-comment-share-slot* +*state-status* +*dashboard-test-db* +*dashboard-comment-share-slot* +) + (import scheme chicken.file.posix chicken.base chicken.string Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -18,20 +18,20 @@ ;; ;;====================================================================== (declare (uses ducttape-lib)) +(declare (uses debugprint)) (declare (uses bigmod)) ;; (declare (uses gutils)) (declare (uses bigmod.import)) (declare (uses commonmod)) (declare (uses configfmod)) (declare (uses dashboard-context-menu)) (declare (uses dashboard-tests)) (declare (uses dbmod)) (declare (uses dcommon)) -(declare (uses debugprint)) (declare (uses debugprint.import)) (declare (uses itemsmod)) (declare (uses launchmod)) (declare (uses mtargs)) (declare (uses mtmod)) @@ -73,15 +73,15 @@ ;; (include "task_records.scm") ;; (include "megatest-version.scm") (include "megatest-fossil-hash.scm") ;; (include "vg_records.scm") -(import commonmod +(import debugprint + commonmod ;; gutils configfmod dbmod - debugprint itemsmod launchmod (prefix mtargs args:) mtmod mtver Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -30,12 +30,253 @@ (declare (uses mtmod)) (declare (uses pkts)) (declare (uses dbi)) (module dbmod - * - + ( +dbr:dbstruct-get-dbdat +dbr:dbstruct-dbdat-put! +db:run-id->first-num +db:run-id->path +db:dbname->path +db:run-id->dbname +db:get-dbdat +db:get-inmem +db:get-ddb +db:open-dbdat +db:open-run-db +db:open-inmem-db +db:setup +db:get-main-lock +db:with-lock-db +db:get-iam-server-lock +db:get-locker +db:take-lock +db:release-lock +db:general-sqlite-error-dump +db:first-result-default +db:generic-error-printout +db:with-db +db:set-sync +db:get-last-update-time +db:sync-inmem->disk +db:sync-main-list +db:sync-all-tables-list +db:move-and-recreate-db +db:repair-db +db:sync-one-table +db:sync-tables +db:patch-schema-rundb +db:patch-schema-maindb +db:adj-target +db:get-access-mode +db:dispatch-query +db:create-all-triggers +db:create-triggers +db:drop-all-triggers +db:is-trigger-dropped +db:drop-triggers +db:initialize-db +db:archive-get-allocations +db:archive-register-disk +db:archive-register-block-name +db:test-set-archive-block-id +db:test-get-archive-block-info +open-logging-db +db:log-local-event +db:log-event +db:have-incompletes? +db:get-status-from-final-status-file +db:find-and-mark-incomplete +db:top-test-set-per-pf-counts +db:clean-up +db:clean-up-rundb +db:get-var +db:inc-var +db:dec-var +db:set-var +db:add-var +db:del-var +db:open-no-sync-db +db:no-sync-db +db:no-sync-set +db:no-sync-del! +db:no-sync-get/default +db:no-sync-get-lock +db:get-keys +db:get-index-by-header +db:get-value-by-header +db:get-header +db:get-rows +db:get-run-times +db:get-run-name-from-id +db:get-run-key-val +runs:get-std-run-fields +db:register-run +db:insert-run +db:get-runs +db:simple-get-runs +db:get-changed-run-ids +db:get-targets +db:get-num-runs +db:get-runs-cnt-by-patt +db:get-raw-run-stats +db:update-run-stats +db:get-main-run-stats +db:print-current-query-stats +db:get-all-run-ids +db:get-run-stats +db:get-runs-by-patt +db:get-run-info +db:set-comment-for-run +db:delete-run +db:update-run-event_time +db:lock/unlock-run +db:set-run-status +db:set-run-state-status +db:get-run-status +db:get-run-state +db:get-key-val-pairs +db:get-key-vals +db:get-target +db:get-prev-run-ids +db:get-tests-for-run +db:test-short-record->norm +db:get-tests-for-run-state-status +db:get-testinfo-state-status +db:get-tests-for-run-mindata +db:get-tests-for-runs +db:delete-test-records +db:delete-old-deleted-test-records +db:set-tests-state-status +db:test-set-state-status +db:get-count-tests-running +db:get-count-tests-actually-running +db:get-count-tests-running-for-run-id +db:get-count-tests-running-for-testname +db:get-not-completed-cnt +db:get-count-tests-running-in-jobgroup +db:estimated-tests-remaining +db:get-test-id +db:test-set-top-process-pid +db:test-get-top-process-pid +db:field->number +db:update-tesdata-on-repilcate-db +db:get-all-tests-info-by-run-id +db:replace-test-records +db:get-test-info-by-id +db:get-test-info-by-ids +db:get-test-info +db:test-get-rundir-from-test-id +db:get-test-times +db:teststep-set-status! +db:delete-steps-for-test! +db:get-steps-for-test +db:get-steps-data +db:get-data-info-by-id +db:test-data-rollup +db:logpro-dat->csv +db:csv->test-data +db:read-test-data +db:read-test-data-varpatt +db:get-run-ids-matching-target +db:test-get-paths-matching-keynames-target-new +db:test-toplevel-num-items +db:obj->string +db:string->obj +db:set-state-status-and-roll-up-items +db:roll-up-rules +db:set-state-status-and-roll-up-run +db:get-all-state-status-counts-for-run +db:get-all-state-status-counts-for-test +db:test-get-logfile-info +db:lookup-query +db:login +db:general-call +db:get-state-status-summary +db:get-latest-host-load +db:set-top-level-from-items +db:get-matching-previous-test-run-records +db:test-get-records-for-index-file +db:get-tests-tags +db:testmeta-get-record +db:testmeta-add-record +db:testmeta-update-field +db:testmeta-get-all +db:compare-itempaths +db:convert-test-itempath +db:multi-pattern-apply +db:get-prereqs-not-met +db:get-run-record-ids +db:get-changed-record-ids +tdb:read-test-data +tdb:get-prev-tol-for-test +tdb:step-get-time-as-string +tdb:get-steps-table +tdb:get-steps-table-list +tdb:get-compressed-steps +mt:run-trigger +mt:process-triggers +mt:lazy-read-test-config +mt:get-run-stats +server:reply +common:with-queue-db +common:load-pkts-to-db +db:hoh-set! +db:hoh-get +db:get-cache-stmth +db:register-server +db:deregister-server +db:get-server-info +db:get-count-servers +db:get-steps-info-by-id + +make-dbr:dbdat +dbr:dbdat-db +dbr:dbdat-inmem +dbr:dbdat-last-sync +dbr:dbdat-last-write +dbr:dbdat-run-id +dbr:dbdat-fname +dbr:dbdat-db-set! +dbr:dbdat-inmem-set! +dbr:dbdat-last-sync-set! +dbr:dbdat-last-write-set! +dbr:dbdat-run-id-set! +dbr:dbdat-fname-set! + +make-dbr:dbstruct +dbr:dbstruct-mtdb +dbr:dbstruct-dbdats +dbr:dbstruct-read-only +dbr:dbstruct-stmt-cache +dbr:dbstruct-mtdb-set! +dbr:dbstruct-dbdats-set! +dbr:dbstruct-read-only-set! +dbr:dbstruct-stmt-cache-set! + +make-simple-run +simple-run-target +simple-run-id +simple-run-runname +simple-run-state +simple-run-status +simple-run-owner +simple-run-event_time +simple-run-target-set! +simple-run-id-set! +simple-run-runname-set! +simple-run-state-set! +simple-run-status-set! +simple-run-owner-set! +simple-run-event_time-set! + +;; fix naming on these ones +db:test-record-fields +db:test-record-qry-selector +) + (import scheme (prefix sqlite3 sqlite3:) chicken.base chicken.condition chicken.eval @@ -3536,24 +3777,24 @@ db "SELECT id,test_id,stepname,state,status,event_time,logfile,comment FROM test_steps WHERE status != 'DELETED' AND test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC; test-id) (reverse res))))) - (define (db:get-steps-info-by-id dbstruct test-step-id) - (db:with-db - dbstruct - #f - #f - (lambda (db) - (let* ((res (vector #f #f #f #f #f #f #f #f #f))) - (sqlite3:for-each-row - (lambda (id test-id stepname state status event-time logfile comment last-update) - (set! res (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment last-update))) - db - "SELECT id,test_id,stepname,state,status,event_time,logfile,comment,last_update FROM test_steps WHERE id=? ORDER BY id ASC;" ;; event_time DESC,id ASC; - test-step-id) - res)))) +(define (db:get-steps-info-by-id dbstruct test-step-id) + (db:with-db + dbstruct + #f + #f + (lambda (db) + (let* ((res (vector #f #f #f #f #f #f #f #f #f))) + (sqlite3:for-each-row + (lambda (id test-id stepname state status event-time logfile comment last-update) + (set! res (vector id test-id stepname state status event-time (if (string? logfile) logfile "") comment last-update))) + db + "SELECT id,test_id,stepname,state,status,event_time,logfile,comment,last_update FROM test_steps WHERE id=? ORDER BY id ASC;" ;; event_time DESC,id ASC; + test-step-id) + res)))) (define (db:get-steps-data dbstruct run-id test-id) (db:with-db dbstruct run-id ADDED scripts/gen-module-list.sh Index: scripts/gen-module-list.sh ================================================================== --- /dev/null +++ scripts/gen-module-list.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +TARGFILE=$1 + +echo ' (' +egrep '^\(define \(' $TARGFILE | tr '()' ' '|awk '{print $2}' +egrep '^\(define \*' $TARGFILE | awk '{print $2}' +echo ')'