Megatest

Diff
Login

Differences From Artifact [d2e9fe8c20]:

To Artifact [dc5879432a]:


22
23
24
25
26
27
28


29
30
31
32
33
34
35
(declare (uses commonmod))
(declare (uses debugprint))
(declare (uses apimod))
(declare (uses dbmod))
(declare (uses configfmod))
(declare (uses margsmod))
(declare (uses portlogger))



(module rmtmod
	*
	
(import scheme chicken data-structures extras ports)
(import (prefix sqlite3 sqlite3:)
	directory-utils







>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(declare (uses commonmod))
(declare (uses debugprint))
(declare (uses apimod))
(declare (uses dbmod))
(declare (uses configfmod))
(declare (uses margsmod))
(declare (uses portlogger))
(declare (uses items))
(declare (uses tdb))

(module rmtmod
	*
	
(import scheme chicken data-structures extras ports)
(import (prefix sqlite3 sqlite3:)
	directory-utils
54
55
56
57
58
59
60


61
62
63
64
65
66
67
(import apimod)
(import commonmod)
(import debugprint)
(import dbmod)
(import configfmod)
(import margsmod)
(import portlogger)



(defstruct alldat
  (areapath #f)
  (ulexdat  #f)
  )

(define (rmtmod:calc-ro-mode runremote *toppath*)







>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
(import apimod)
(import commonmod)
(import debugprint)
(import dbmod)
(import configfmod)
(import margsmod)
(import portlogger)
(import items)
(import tdb)

(defstruct alldat
  (areapath #f)
  (ulexdat  #f)
  )

(define (rmtmod:calc-ro-mode runremote *toppath*)
2566
2567
2568
2569
2570
2571
2572
2573













2574













2575










			  )))
		  (begin    ;; no server registered
		    ;; (server:kind-run areapath)
		    (server:start-and-wait areapath)
		    (debug:print-info 0 *default-log-port* "client:setup, no server registered, remaining-tries=" remaining-tries)
		    (thread-sleep! 1) ;; (+ 5 (random (- 20 remaining-tries))))  ;; give server a little time to start up, randomize a little to avoid start storms.
		    (client:setup-http areapath remaining-tries: (- remaining-tries 1)))))))))




























)


















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

>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
			  )))
		  (begin    ;; no server registered
		    ;; (server:kind-run areapath)
		    (server:start-and-wait areapath)
		    (debug:print-info 0 *default-log-port* "client:setup, no server registered, remaining-tries=" remaining-tries)
		    (thread-sleep! 1) ;; (+ 5 (random (- 20 remaining-tries))))  ;; give server a little time to start up, randomize a little to avoid start storms.
		    (client:setup-http areapath remaining-tries: (- remaining-tries 1)))))))))

;; NOTE: Run this local with #f for db !!!
(define (tdb:load-test-data run-id test-id)
  (let loop ((lin (read-line)))
    (if (not (eof-object? lin))
	(begin
	  (debug:print 4 *default-log-port* lin)
          ;;(when lin ;; this when blocked stack dump caused by .dat file from logpro being 0-byte.  fixed by upgrading logpro
          (rmt:csv->test-data run-id test-id lin)
          ;;)
	  (loop (read-line)))))
  ;; roll up the current results.
  ;; FIXME: Add the status too 
  (rmt:test-data-rollup run-id test-id #f))

;; NOTE: Run this local with #f for db !!!
(define (tdb:load-logpro-data run-id test-id)
  (let loop ((lin (read-line)))
    (if (not (eof-object? lin))
	(begin
	  (debug:print 4 *default-log-port* lin)
          ;;(when lin  ;; this when blocked stack dump caused by .dat file from logpro being 0-byte.  fixed by upgrading logpro
          (rmt:csv->test-data run-id test-id lin)
          ;;)
	  (loop (read-line)))))
  ;; roll up the current results.
  ;; FIXME: Add the status too 
  (rmt:test-data-rollup run-id test-id #f))

;; find and open the testdat.db file for an existing test
(define (tdb:open-test-db-by-test-id test-id #!key (work-area #f))
  (let* ((test-path (if work-area
			work-area
			(rmt:test-get-rundir-from-test-id test-id))))
    (debug:print 3 *default-log-port* "TEST PATH: " test-path)
    (open-test-db test-path)))


)