Megatest

Diff
Login

Differences From Artifact [75889bb557]:

To Artifact [05bd95b7e6]:


934
935
936
937
938
939
940

















941
942
943
944
945
946
947
	     (curr-time (current-seconds))
	     (res      '())
	     (last-update (if use-last-update (cons "last_update" targ-db-last-mod) #f)))
	(db:sync-tables (db:sync-main-list source-db) last-update source-db cache-db)
	(db:sync-tables db:sync-tests-only last-update source-db cache-db)
	(hash-table-set! *global-db-store* target cache-db)
	cache-db)))


















;; ;; call a proc with a cached db
;; ;;
;; (define (db:call-with-cached-db proc . params)
;;   ;; first cache the db in /tmp
;;   (let* ((cname-part (conc "megatest_cache/" (common:get-testsuite-name)))
;; 	 (fname      (conc  (common:get-area-path-signature) ".db"))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
	     (curr-time (current-seconds))
	     (res      '())
	     (last-update (if use-last-update (cons "last_update" targ-db-last-mod) #f)))
	(db:sync-tables (db:sync-main-list source-db) last-update source-db cache-db)
	(db:sync-tables db:sync-tests-only last-update source-db cache-db)
	(hash-table-set! *global-db-store* target cache-db)
	cache-db)))

;; move records for runs untouched for over given time (2 weeks default) to
;; megatest_additional.db if there are more than 5000 test records in the db
;;
(define (db:reduce-records #!key (use-last-update #f))
  (let* ((toppath   (launch:setup))
	 (srcdir    toppath)
	 (srcname   "megatest.db")
	 (trgdir    toppath)
	 (trgname   "megatest_additional.db")
	 (dest-db   (db:open-megatest-db path: trgdir name: trgname))
	 (source-db (db:open-megatest-db path: srcdir name: srcname)))
    ;; (db:sync-tables (db:sync-main-list source-db) last-update source-db cache-db)
    ;; (db:sync-tables db:sync-tests-only last-update source-db cache-db)
    ;; (hash-table-set! *global-db-store* target cache-db)
    ;; cache-db
    ))

;; ;; call a proc with a cached db
;; ;;
;; (define (db:call-with-cached-db proc . params)
;;   ;; first cache the db in /tmp
;;   (let* ((cname-part (conc "megatest_cache/" (common:get-testsuite-name)))
;; 	 (fname      (conc  (common:get-area-path-signature) ".db"))