37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
(import scheme
chicken.base
chicken.process-context.posix
chicken.string
chicken.time
chicken.condition
chicken.process
chicken.random
chicken.file
;; (prefix sqlite3 sqlite3:)
typed-records
srfi-18
srfi-69
|
>
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
(import scheme
chicken.base
chicken.process-context.posix
chicken.string
chicken.time
chicken.condition
chicken.process
chicken.pathname
chicken.random
chicken.file
;; (prefix sqlite3 sqlite3:)
typed-records
srfi-18
srfi-69
|
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
;; TASKS
tasks-add
tasks-set-state-given-param-key
))
(define (api:run-server-process apath dbname)
(let* ((cmd (conc "nbfake megatest -server - -area "apath
" -db "dbname))
(cleandbname (string-translate dbname "./" "_-"))
(logd (conc apath "/logs"))
(logf (conc logd "/server-"(current-seconds)cleandbname".log")))
(if (not (directory-exists? logd))
(create-directory logd #t))
(system (conc "NBFAKE_LOG="logf" "cmd))))
;; special function to get server
;; look up in db
;; if found -> return it
|
>
>
>
>
>
>
>
>
|
|
<
<
<
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
;; TASKS
tasks-add
tasks-set-state-given-param-key
))
(define (api:run-server-process apath dbname)
(let* ((cleandbname (pathname-strip-directory dbname)) ;; (string-translate dbname "./" "--"))
(logd (conc apath "/logs"))
(logf (conc logd "/server-launch-";;(current-process-id)
(seconds->year-work-week/day-time-fname (current-seconds))
"-"cleandbname".log"))
(logf2 (conc logd "/server-"
(seconds->year-work-week/day-time-fname (current-seconds))
"-"cleandbname"-"))
(cmd (conc "nbfake megatest -server - -area "apath
" -db "dbname" -autolog "logf2)))
(if (not (directory-exists? logd))
(create-directory logd #t))
(system (conc "NBFAKE_LOG="logf" "cmd))))
;; special function to get server
;; look up in db
;; if found -> return it
|
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
|
((get-runs-cnt-by-patt) (apply db:get-runs-cnt-by-patt dbstruct params))
((get-all-run-ids) (db:get-all-run-ids dbstruct))
((get-prev-run-ids) (apply db:get-prev-run-ids dbstruct params))
((get-run-ids-matching-target) (apply db:get-run-ids-matching-target dbstruct params))
((get-runs-by-patt) (apply db:get-runs-by-patt dbstruct params))
((get-run-name-from-id) (apply db:get-run-name-from-id dbstruct params))
((get-main-run-stats) (apply db:get-main-run-stats dbstruct params))
((log-to-main) (apply debug:print params))
((get-var) (apply db:get-var dbstruct params))
((get-run-stats) (apply db:get-run-stats dbstruct params))
((get-run-times) (apply db:get-run-times dbstruct params))
;; STEPS
((get-steps-data) (apply db:get-steps-data dbstruct params))
((get-steps-for-test) (apply db:get-steps-for-test dbstruct params))
|
|
|
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
((get-runs-cnt-by-patt) (apply db:get-runs-cnt-by-patt dbstruct params))
((get-all-run-ids) (db:get-all-run-ids dbstruct))
((get-prev-run-ids) (apply db:get-prev-run-ids dbstruct params))
((get-run-ids-matching-target) (apply db:get-run-ids-matching-target dbstruct params))
((get-runs-by-patt) (apply db:get-runs-by-patt dbstruct params))
((get-run-name-from-id) (apply db:get-run-name-from-id dbstruct params))
((get-main-run-stats) (apply db:get-main-run-stats dbstruct params))
((log-to-main) (apply debug:print 0 *default-log-port* params))
((get-var) (apply db:get-var dbstruct params))
((get-run-stats) (apply db:get-run-stats dbstruct params))
((get-run-times) (apply db:get-run-times dbstruct params))
;; STEPS
((get-steps-data) (apply db:get-steps-data dbstruct params))
((get-steps-for-test) (apply db:get-steps-for-test dbstruct params))
|