Megatest

Check-in [91504daf87]
Login
Overview
Comment:This one looks good.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | test-specific-db
Files: files | file ages | folders
SHA1: 91504daf87e823566a71728ef85e094125215483
User & Date: mrwellan on 2012-09-25 12:06:32
Other Links: branch diff | manifest | tags
Context
2012-09-25
18:03
Snapshot - still problematic in the test queue check-in: b3fb6e132e user: mrwellan tags: test-specific-db
12:06
This one looks good. check-in: 91504daf87 user: mrwellan tags: test-specific-db
2012-09-24
00:02
Added comment on mode check-in: eb47e2c93d user: matt tags: test-specific-db
Changes

Modified tests.scm from [9c29f324c9] to [ca0ab90b21].

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "test_records.scm")

(define (tests:register-test db run-id test-name item-path)
;;   (with-dot-lock ;; NOTE: This locking only reduces the number of overlapping db accesses on a single machine!! 
;;    "megatest.lock"
   (let ((item-paths (if (equal? item-path "")
			 (list item-path)
			 (list item-path ""))))
     (for-each 
      (lambda (pth)
	(sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_time,item_path,state,status) VALUES (?,?,strftime('%s','now'),?,'NOT_STARTED','n/a');" 
			 run-id 
			 test-name
			 pth))
      item-paths ))) ;; )

;; get the previous record for when this test was run where all keys match but runname
;; returns #f if no such test found, returns a single test record if found
(define (test:get-previous-test-run-record db run-id test-name item-path)
  (let* ((keys    (db:get-keys db))
	 (selstr  (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ","))
	 (qrystr  (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND "))







<
<









|







26
27
28
29
30
31
32


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "test_records.scm")

(define (tests:register-test db run-id test-name item-path)


   (let ((item-paths (if (equal? item-path "")
			 (list item-path)
			 (list item-path ""))))
     (for-each 
      (lambda (pth)
	(sqlite3:execute db "INSERT OR IGNORE INTO tests (run_id,testname,event_time,item_path,state,status) VALUES (?,?,strftime('%s','now'),?,'NOT_STARTED','n/a');" 
			 run-id 
			 test-name
			 pth))
      item-paths)))

;; get the previous record for when this test was run where all keys match but runname
;; returns #f if no such test found, returns a single test record if found
(define (test:get-previous-test-run-record db run-id test-name item-path)
  (let* ((keys    (db:get-keys db))
	 (selstr  (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ","))
	 (qrystr  (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND "))