Megatest

Check-in [5458437545]
Login
Overview
Comment:Added improved new to old converter
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.70
Files: files | file ages | folders
SHA1: 5458437545a6583b344dc4c6e513cfc0704881b1
User & Date: mrwellan on 2022-11-08 14:24:48
Other Links: branch diff | manifest | tags
Context
2022-11-08
22:15
Added stop-the-train, crowbar switch check-in: bf43672760 user: matt tags: v1.70
14:24
Added improved new to old converter check-in: 5458437545 user: mrwellan tags: v1.70
2022-11-05
21:04
Merged check-in: a4c88b57c9 user: matt tags: v1.70
Changes

Modified dashboard.scm from [f5c119fd95] to [124f6f1518].

2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
;; This is the Run Summary tab
;; 
(define (dashboard:runs-summary commondat tabdat #!key (tab-num #f))
  (let* ((update-mutex (dboard:commondat-update-mutex commondat))
	 (tb      (iup:treebox
		   #:value 0
		   ;;#:name "Runs"
                   #:title "Runs" ;;  was #:name -- iup 3.19 changed this... "Changed: [DEPRECATED REMOVED] removed the old attribute NAMEid from IupTree to avoid conflict with the common attribute NAME. Use the TITLEid attribute."
		   #:expand "YES"
		   #:addexpanded "YES"
		   #:selection-cb
		   (lambda (obj id state)
		     (debug:catch-and-dump
		      (lambda ()
			;; (print "obj: " obj ", id: " id ", state: " state)







|







2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
;; This is the Run Summary tab
;; 
(define (dashboard:runs-summary commondat tabdat #!key (tab-num #f))
  (let* ((update-mutex (dboard:commondat-update-mutex commondat))
	 (tb      (iup:treebox
		   #:value 0
		   ;;#:name "Runs"
                   #:title "Runs"
		   #:expand "YES"
		   #:addexpanded "YES"
		   #:selection-cb
		   (lambda (obj id state)
		     (debug:catch-and-dump
		      (lambda ()
			;; (print "obj: " obj ", id: " id ", state: " state)

Added utils/mt-new-to-old.scm version [34ae67e282].



















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(module mt-new-to-old
 *

(import
 scheme
 chicken.file
 chicken.base
 chicken.string
 chicken.pretty-print
 sqlite3)

(if (not (file-exists? ".megatest/main.db"))
    (begin
     (print "No .megatest/main.db found, exiting")
     (exit 1)))

(copy-file ".megatest/main.db" "megatest.db" #t)


(define tests_fields "run_id,testname,host,cpuload,diskfree,uname,rundir,shortdir,item_path,state,status,attemptnum,final_logf,logdat,run_duration,comment,event_time,fail_count,pass_count,archived")

(define extra_fields "testname,item_path")

(define (import-one dbfile destdb)
  (print "Importing "dbfile)
  (let* ((db   (open-database dbfile))
	 (rows (fold-row
		(lambda (res . row)
		  (cons row res))
		'()
		db
		(conc "SELECT "extra_fields","tests_fields" FROM tests;"))))
    (finalize! db)
    (print "Found "(length rows)" records to insert.")
    (for-each
     (lambda (row)
       (let* ((testname (car row))
	      (itempath (cadr row))
	      (remrow   (cddr row))
	      (run-id   (car remrow))
	      (ready-row (string-intersperse
			  (map (lambda (x)
				 (if (number? x)
				     (conc x)
				     (conc "'"x"'")))
			       remrow)

			  ",")))
	 (print run-id","testname"/"itempath)
	 (execute destdb "DELETE FROM tests WHERE testname=? AND item_path=? AND run_id=?;"
		  (or testname "")
		  (or itempath "")
		  (or run-id ""))
	 (apply execute destdb (conc "INSERT INTO tests ("tests_fields") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);") remrow)))
     ;; ("ready-row");"))))
     rows)))

(define (process-all)
  (let* ((outdb (open-database "megatest.db"))
	 (indbs (glob ".megatest/[0-9]*.db")))
    (with-transaction
     outdb
     (lambda ()
       (for-each
	(lambda (dbfname)
	  (import-one dbfname outdb))
	indbs)))
    (finalize! outdb)))

)

(import mt-new-to-old)
(process-all)