Index: api.scm ================================================================== --- api.scm +++ api.scm @@ -149,11 +149,12 @@ ;; STEPS ((teststep-set-status!) (apply db:teststep-set-status! dbstruct params)) ;; TEST DATA ((test-data-rollup) (apply db:test-data-rollup dbstruct params)) - ((csv->test-data) (apply db:csv->test-data dbstruct params)) + ;; unfinished and unused + ;; ((csv->test-data) (apply db:csv->test-data dbstruct params)) ;; MISC ((sync-inmem->db) (let ((run-id (car params))) (db:sync-touched dbstruct run-id force-sync: #t))) ((mark-incomplete) (apply db:find-and-mark-incomplete dbstruct params)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2663,10 +2663,12 @@ ;; Now rollup the counts to the central megatest.db (db:general-call dbdat 'pass-fail-counts (list pass-count fail-count test-id)) ;; if the test is not FAIL then set status based on the fail and pass counts. (db:general-call dbdat 'test_data-pf-rollup (list test-id test-id test-id test-id)))) +;; NOT USED!? +;; (define (db:csv->test-data dbstruct run-id test-id csvdata) (debug:print 4 "test-id " test-id ", csvdata: " csvdata) (let* ((dbdat (db:get-db dbstruct run-id)) (db (db:dbdat-get-db dbdat)) (csvlist (csv->list (make-csv-reader Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -671,12 +671,14 @@ (rmt:send-receive 'testmeta-update-field #f (list test-name fld val))) (define (rmt:test-data-rollup run-id test-id status) (rmt:send-receive 'test-data-rollup run-id (list run-id test-id status))) -(define (rmt:csv->test-data run-id test-id csvdata) - (rmt:send-receive 'csv->test-data run-id (list run-id test-id csvdata))) +;; Unfinished and unused +;; +;; (define (rmt:csv->test-data run-id test-id csvdata) +;; (rmt:send-receive 'csv->test-data run-id (list run-id test-id csvdata))) ;;====================================================================== ;; T A S K S ;;====================================================================== Index: tests/unit.logpro ================================================================== --- tests/unit.logpro +++ tests/unit.logpro @@ -1,5 +1,14 @@ +;; Ignore initial errors +(trigger "ScriptStart" #/^Script started/) +(trigger "TestStart" #/^megatest> \(/) +(section "startup" "ScriptStart" "TestStart") + +(expect:ignore in "startup" >= 0 "Ignore startup errors" #/error/i) + +(expect:ignore in "LogFileBody" >= 0 "Ignore .so files with error in name" #/loading.*error.*\.so/) +; loading /usr/local/lib/chicken/7/type-errors.import.so .. ;; You should have at least one expect:required. This ensures that your process ran (expect:required in "LogFileBody" > 0 "At least one PASS" #/\[.{0,4}PASS.{0,4}\]/) ;; You may need ignores to suppress false error or warning hits from the later expects ;; NOTE: Order is important here! Index: tests/unittests/misc.scm ================================================================== --- tests/unittests/misc.scm +++ tests/unittests/misc.scm @@ -43,11 +43,11 @@ (test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname GLOB '' AND item_path LIKE 'b%')" (tests:match->sqlqry "a/b,a%,/b%")) (test #f "(testname GLOB 'a' AND item_path GLOB 'b') OR (testname LIKE 'a%' AND item_path LIKE '%') OR (testname LIKE '%' AND item_path LIKE 'b%')" (tests:match->sqlqry "a/b,a%,%/b%")) -(let ((cmd "dunno") +(let* ((cmd "dunno") (run-id 1) (rid 1) (rawcmd "dunno") (params '()) (duration 100) @@ -90,28 +90,30 @@ (waitons '("a" "b" "c")) (ref-item-path "/d/e/f") (jobgroup "anl") (runpatt "run%") (keyvals '(("SYSTEM" "a")("RELEASE" "b"))) + (keys (map car keyvals)) (user "freddy") + (owner "tommy") (count 100) (keypatts '(("SYSTEM" "%a")("RELEASE" "%b"))) (lock #f) (unlock #t) (run-status "n/a") (runnamepatt "b%") - (targpatt "%a/%b/c%") + (targpatt "%a/%b") (fields "id,runname") (ovr-deadtime 100) (teststep-name "first") (state-in "COMPLETED") (status-in "FAIL") (comment "This is a comment eh!") (logfile "/tmp/alogfile.log") (categorypatt "stats") (work-area "/tmp") - (fld "voltage") + (fld "owner") (val 5) (csvdata "id,meas,val\n1,voltage,2") (action-patt "%") (param-key "dunno") (testname "atest") @@ -178,29 +180,31 @@ (test #f #t (begin (rmt:delete-run run-id) #t)) (test #f #t (begin (rmt:delete-old-deleted-test-records) #t)) (test #f #t (vector? (rmt:get-runs runpatt count offset keypatts))) (test #f '() (rmt:get-all-run-ids)) (test #f '() (rmt:get-prev-run-ids run-id)) -;; (test #f #f (rmt:lock/unlock-run run-id lock unlock user)) -;; (test #f #f (rmt:get-run-status run-id)) -;; (test #f #f (rmt:set-run-status run-id run-status msg: msg)) -;; (test #f #f (rmt:update-run-event_time run-id)) -;; (test #f #f (rmt:get-runs-by-patt keys runnamepatt targpatt offset limit fields)) ;; fields of #f uses default) -;; (test #f #f (rmt:find-and-mark-incomplete run-id ovr-deadtime)) -;; (test #f #f (rmt:find-and-mark-incomplete-all-runs ovr-deadtime: ovr-deadtime)) -;; (test #f #f (rmt:get-previous-test-run-record run-id test-name item-path)) -;; (test #f #f (rmt:teststep-set-status! run-id test-id teststep-name state-in status-in comment logfile)) -;; (test #f #f (rmt:get-steps-for-test run-id test-id)) -;; (test #f #f (rmt:read-test-data run-id test-id categorypatt work-area: work-area)) -;; (test #f #f (rmt:testmeta-add-record testname)) -;; (test #f #f (rmt:testmeta-get-record testname)) -;; (test #f #f (rmt:testmeta-update-field test-name fld val)) -;; (test #f #f (rmt:test-data-rollup run-id test-id status)) -;; (test #f #f (rmt:csv->test-data run-id test-id csvdata)) -;; (test #f #f (rmt:tasks-find-task-queue-records target run-name test-patt state-patt action-patt)) -;; (test #f #f (rmt:tasks-add action owner target runname testpatt params)) -;; (test #f #f (rmt:tasks-set-state-given-param-key param-key new-state)) + (test #f #t (begin (rmt:lock/unlock-run run-id lock unlock user) #t)) + (test #f #t (begin (rmt:set-run-status run-id "NONPASS" msg: msg) #t)) ;; run-status + (test #f "NONPASS" (rmt:get-run-status run-id)) + (test #f #t (begin (rmt:update-run-event_time run-id) #t)) + (test #f (vector '("SYSTEM" "RELEASE" "id") '()) (rmt:get-runs-by-patt keys runnamepatt targpatt offset limit '("id"))) ;; fields of #f uses default) + (test #f #t (begin (rmt:find-and-mark-incomplete run-id ovr-deadtime) #t)) + (test #f #t (begin (rmt:find-and-mark-incomplete-all-runs ovr-deadtime: ovr-deadtime) #t)) + (test #f #f (rmt:get-previous-test-run-record run-id test-name item-path)) + (test #f #t (begin (rmt:teststep-set-status! run-id test-id teststep-name state-in status-in comment logfile) #t)) + (test #f #t (vector? (car (rmt:get-steps-for-test run-id test-id)))) + (test #f '() (rmt:read-test-data run-id test-id categorypatt work-area: work-area)) + (test #f #t (begin (rmt:testmeta-add-record testname) #t)) + (test #f (vector 1 "atest" "" "" "" "" "" "" "" "" "default") (rmt:testmeta-get-record testname)) + (test #f #t (begin (rmt:testmeta-update-field test-name fld val) #t)) + (test #f #t (rmt:test-data-rollup run-id test-id status)) + ;; disabled as the function is unfinished and unused + ;; (test #f #f (rmt:csv->test-data run-id test-id csvdata)) + (test #f '() (rmt:tasks-find-task-queue-records target runname testpatt statepatt action-patt)) + (test #f #t (begin (rmt:tasks-add "action" owner target runname testpatt "params") #t)) + (test #f #t (begin (rmt:tasks-set-state-given-param-key param-key newstate) #t)) + (test #f #t (begin (rmt:test-set-state-status-by-id run-id test-id newstate newstatus newcomment) #t)) ;; ;; (test #f #f (rmt:archive-get-allocations testname itempath dneeded)) ;; (test #f #f (rmt:archive-register-block-name bdisk-id archive-path)) ;; (test #f #f (rmt:archive-allocate-testsuite/area-to-block block-id testsuite-name areakey)) ;; (test #f #f (rmt:archive-register-disk bdisk-name bdisk-path df)) @@ -207,11 +211,10 @@ ;; (test #f #f (rmt:test-set-archive-block-id run-id test-id archive-block-id)) ;; (test #f #f (rmt:test-get-archive-block-info archive-block-id)) ;; Defer these a little while ... ;; - ;; (test #f #f (rmt:test-set-state-status-by-id run-id test-id newstate newstatus newcomment)) ;; (test #f #f (rmt:synchash-get run-id proc synckey keynum params)) ;; (test #f #f (rmt:send-receive cmd rid params #!key (attemptnum 1)) ;; start attemptnum at 1 so the modulo below works as expected) ;; (test #f #f (rmt:open-qry-close-locally cmd run-id params #!key (remretries 5))) ;; (test #f #f (apply rmt:general-call stmtname run-id params)) ;; (test #f #f (rmt:sync-inmem->db run-id))