Megatest

Diff
Login

Differences From Artifact [f0edd2b867]:

To Artifact [13b90bf40e]:


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
74

75

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102






















103
104
105
106
107


108
109
110


111
112
113
114
























115
116
117






























118
119
120
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104






















105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198







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

-
+




+
+
+


+

+
+
+
+
+
+
+

+



+

+
+
+
+


+

+

+



+

+





+

+





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





+
+


-
+
+




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



;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Megatest.  If not, see <http://www.gnu.org/licenses/>.

;;======================================================================

(declare (unit megamod))
(declare (uses commonmod))
(declare (uses dbmod))
;;(declare (uses apimod))
(declare (uses ftail))
;; (declare (uses rmtmod))
(declare (uses commonmod))
(declare (uses apimod))
(declare (uses archivemod))
(declare (uses clientmod))
(declare (uses configfmod))
(declare (uses dbmod))
(declare (uses dcommonmod))
(declare (uses envmod))
(declare (uses ezstepsmod))
(declare (uses itemsmod))
(declare (uses keysmod))
(declare (uses launchmod))
(declare (uses odsmod))
(declare (uses processmod))
(declare (uses runconfigmod))
(declare (uses runsmod))
(declare (uses servermod))
(declare (uses subrunmod))
(declare (uses tasksmod))
(declare (uses testsmod))
(declare (uses vgmod))
;; (declare (uses commonmod))
;; (declare (uses dbmod))
;; ;;(declare (uses apimod))
;; (declare (uses ftail))
;; ;; (declare (uses rmtmod))
;; (declare (uses commonmod))
;; (declare (uses apimod))
;; (declare (uses archivemod))
;; (declare (uses clientmod))
;; (declare (uses configfmod))
;; (declare (uses dbmod))
;; (declare (uses dcommonmod))
;; (declare (uses envmod))
;; (declare (uses ezstepsmod))
;; (declare (uses itemsmod))
;; (declare (uses keysmod))
;; (declare (uses launchmod))
;; (declare (uses odsmod))
;; (declare (uses processmod))
;; (declare (uses runconfigmod))
;; (declare (uses runsmod))
;; (declare (uses servermod))
;; (declare (uses subrunmod))
;; (declare (uses tasksmod))
;; (declare (uses testsmod))
;; (declare (uses vgmod))

(module rmtmod
(module megamod
	*
	
(import scheme chicken data-structures extras)
(import
 (prefix base64 base64:)
 (prefix dbi dbi:)
 (prefix nanomsg nmsg:)
 (prefix sqlite3 sqlite3:)
 call-with-environment-variables
 canvas-draw
 csv
 csv-xml
 data-structures
 directory-utils
 dot-locking
 extras
 files
 fmt
 format
 hostinfo
 http-client
 intarweb
 irregex
 (prefix iup iup:)
 matchable
 md5
 message-digest
 pathname-expand
 pkts
 ports
 posix
 ;; queue
 regex
 regex-case
 s11n
 sparse-vectors
 spiffy
 spiffy-directory-listing
 spiffy-request-vars
 sql-de-lite
 srfi-1
 srfi-4
 srfi-13
 srfi-18
 srfi-69
 stack
 stml2
 tcp
 typed-records
 udp
 uri-common
 z3
 )

;; (import apimod)
(import archivemod)
(import clientmod)
(import commonmod)
(import configfmod)
(import dbmod)
(import dcommonmod)
(import envmod)
(import ezstepsmod)
(import ftail)
(import itemsmod)
(import keysmod)
(import launchmod)
(import odsmod)
(import processmod)
;; (import rmtmod)
(import runconfigmod)
(import runsmod)
(import servermod)
(import subrunmod)
(import tasksmod)
(import testsmod)
(import vgmod)
;; (import archivemod)
;; (import clientmod)
;; (import commonmod)
;; (import configfmod)
;; (import dbmod)
;; (import dcommonmod)
;; (import envmod)
;; (import ezstepsmod)
;; (import ftail)
;; (import itemsmod)
;; (import keysmod)
;; (import launchmod)
;; (import odsmod)
;; (import processmod)
;; ;; (import rmtmod)
;; (import runconfigmod)
;; (import runsmod)
;; (import servermod)
;; (import subrunmod)
;; (import tasksmod)
;; (import testsmod)
;; (import vgmod)

(use (prefix ulex ulex:))

(include "common_records.scm")
(include "db_records.scm")
(include "key_records.scm")
(include "run_records.scm")
(include "task_records.scm")
(include "test_records.scm")
(include "run_records.scm")
(include "vg_records.scm")
(include "js-path.scm")

;;======================================================================
;; L O C K I N G   M E C H A N I S M S 
;;======================================================================

(include "megatest-fossil-hash.scm")
(include "megatest-version.scm")

;; globals
(define *writes-total-delay* 0)
(define *exit-started* #f)

(define *tim* (iup:timer))

;; The watchdog is to keep an eye on things like db sync etc.
;;

;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage
(define *watchdog* (make-thread
		    (lambda ()
		      (handle-exceptions
			  exn
			  (begin
			    (print-call-chain)
			    (print " message: " ((condition-property-accessor 'exn 'message) exn)))
			(common:watchdog)))
		    "Watchdog thread"))

(include "f1.scm")
(include "f2.scm")
(include "f3.scm")
(include "api-inc.scm")
(include "archive-inc.scm")
(include "client-inc.scm")
(include "common-inc.scm")
(include "configf-inc.scm")
(include "db-inc.scm")
(include "dcommon-inc.scm")
(include "dashboard-tests-inc.scm")
(include "env-inc.scm")
(include "ezsteps-inc.scm")
(include "gutils-inc.scm")
(include "http-transport-inc.scm")
(include "items-inc.scm")
(include "keys-inc.scm")
(include "launch-inc.scm")
(include "margs-inc.scm")
(include "mt-inc.scm")
(include "ods-inc.scm")
(include "pgdb-inc.scm")
(include "portlogger-inc.scm")
(include "process-inc.scm")
(include "rmt-inc.scm")
(include "runconfig-inc.scm")
(include "runs-inc.scm")
(include "server-inc.scm")
(include "subrun-inc.scm")
(include "tasks-inc.scm")
(include "tests-inc.scm")
(include "vg-inc.scm")

)
;; http-transport:server-dat definition moved to common_records.scm
;; bunch of small functions factored out of send-receive to make debug easier