Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -3,11 +3,11 @@ CSCOPTS= SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ - process.scm runs.scm tasks.scm tests.scm archive.scm + process.scm runs.scm tasks.scm tests.scm GUISRCF = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm dashboard-main.scm OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -485,11 +485,14 @@ (sqlite3:execute db "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" rundir run-id testname item-path)) +;;====================================================================== ;; Misc. test related queries +;;====================================================================== + (define (db:test-get-paths-matching db keynames target) (let* ((res '()) (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) (statepatt (if (args:get-arg ":state") (args:get-arg ":state") "%")) @@ -500,10 +503,60 @@ (conc "r." key " like '" val "'")) keynames (string-split target "/")) " AND ")) (qrystr (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE " + keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '" + testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt + "'ORDER BY t.event_time ASC;"))) + (debug:print 3 "qrystr: " qrystr) + (sqlite3:for-each-row + (lambda (p) + (set! res (cons p res))) + db + qrystr) + res)) + +(define (db:test-get-test-records-matching db keynames target) + (let* ((res '()) + (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) + (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) + (statepatt (if (args:get-arg ":state") (args:get-arg ":state") "%")) + (statuspatt (if (args:get-arg ":status") (args:get-arg ":status") "%")) + (runname (if (args:get-arg ":runname") (args:get-arg ":runname") "%")) + (keystr (string-intersperse + (map (lambda (key val) + (conc "r." key " like '" val "'")) + keynames + (string-split target "/")) + " AND ")) + (qrystr (conc "SELECT + t.id + t.run_id + t.testname + t.host + t.cpuload + t.diskfree + t.uname + t.rundir + t.shortdir + t.item_path + t.state + t.status + t.attemptnum + t.final_logf + t.logdat + t.run_duratio + t.comment + t.event_time + t.fail_count + t.pass_count + t.archived + + + + FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE " keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '" testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt "'ORDER BY t.event_time ASC;"))) (debug:print 3 "qrystr: " qrystr) (sqlite3:for-each-row Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -409,10 +409,12 @@ (let* ((new-test-path (string-intersperse (cons test-path (map cadr itemdat)) "/")) (new-test-name (if (equal? item-path "") test-name (conc test-name "/" item-path))) ;; just need it to be unique (testdat (db:get-test-info db run-id test-name item-path))) (if (not testdat) (begin + ;; ensure that the path exists before registering the test + (system (conc "mkdir -p " new-test-path)) (register-test db run-id test-name item-path) (set! testdat (db:get-test-info db run-id test-name item-path)))) (change-directory test-path) (case (if force ;; (args:get-arg "-force") 'NOT_STARTED Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -426,5 +426,14 @@ minutes run-id testname item-path))) +;;====================================================================== +;; A R C H I V I N G +;;====================================================================== + +(define (test:archive db test-id) + #f) + +(define (test:archive-tests db keynames target) + #f) ADDED tests/tests/neverrun/testconfig Index: tests/tests/neverrun/testconfig ================================================================== --- /dev/null +++ tests/tests/neverrun/testconfig @@ -0,0 +1,4 @@ +[setup] +runscript idontexist + +