Megatest

Diff
Login

Differences From Artifact [a7b6fe1509]:

To Artifact [1ccd181f1b]:


2044
2045
2046
2047
2048
2049
2050

2051
2052
2053
2054
2055
2056
2057
2058
2059










2060
2061
2062
2063
2064
2065
2066
2044
2045
2046
2047
2048
2049
2050
2051









2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068







+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+







  (seconds->time-string (db:step-get-event_time vec)))

;; db-get-test-steps-for-run
(define (db:get-steps-for-test db test-id #!key (work-area #f))
  (let* ((tdb (db:open-test-db-by-test-id db test-id work-area: work-area))
	 (res '()))
    (if tdb
	(handle-exceptions
	(begin
	  (sqlite3:for-each-row 
	   (lambda (id test-id stepname state status event-time logfile)
	     (set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "")) res)))
	   tdb
	   "SELECT id,test_id,stepname,state,status,event_time,logfile FROM test_steps WHERE test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
	   test-id)
	  (sqlite3:finalize! tdb)
	  (reverse res))
	 exn
	 '()
	 (sqlite3:for-each-row 
	  (lambda (id test-id stepname state status event-time logfile)
	    (set! res (cons (vector id test-id stepname state status event-time (if (string? logfile) logfile "")) res)))
	  tdb
	  "SELECT id,test_id,stepname,state,status,event_time,logfile FROM test_steps WHERE test_id=? ORDER BY id ASC;" ;; event_time DESC,id ASC;
	  test-id)
	 (sqlite3:finalize! tdb)
	 (reverse res))
	'())))

;; get a pretty table to summarize steps
;;
(define (db:get-steps-table db test-id #!key (work-area #f))
  (let ((steps   (db:get-steps-for-test db test-id work-area: work-area)))
    ;; organise the steps for better readability