Megatest

Diff
Login

Differences From Artifact [dc12e408b1]:

To Artifact [bf898c3d9e]:


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
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







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+









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

-
-
-
+
+
+








-
+








;; (declare (uses ftail))
;; (import ftail)

(import dbmod
	commonmod
	dbfile)

(import
chicken.condition
  chicken.file
  chicken.pathname
  chicken.port
  chicken.pretty-print
  chicken.process
  chicken.process-context
  chicken.process-context.posix
  chicken.process.signal
  chicken.repl
  chicken.sort
  chicken.string
  chicken.time
  chicken.time.posix
  srfi-1
  srfi-13
  srfi-69
  system-information
 
 )

(define *db* #f) ;; this is only for the repl, do not use in general!!!!

(include "common_records.scm")
(include "key_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "megatest-fossil-hash.scm")

(import
 (prefix sqlite3 sqlite3:) srfi-1
 ;; posix
(use (prefix sqlite3 sqlite3:) srfi-1 posix regex regex-case srfi-69 (prefix base64 base64:)
     readline apropos json http-client directory-utils typed-records
     http-client srfi-18 extras format)
 regex regex-case srfi-69 (prefix base64 base64:)
 breadline apropos json http-client
 ;; directory-utils
 typed-records
 http-client srfi-18
 ;; extras
 (chicken.format)

;; Added for csv stuff - will be removed
;;
(use sparse-vectors)
 ;; Added for csv stuff - will be removed
 ;;
 sparse-vectors)

(require-library mutils)

(define *usage-log-file* #f)    ;; put path to file for logging usage in this var in the ~/.megatestrc file
(define *usage-use-seconds* #t) ;; for Epoc seconds in usage logging change this to #t in ~/.megatestrc file

(dbfile:db-init-proc db:initialize-main-db)

;; load the ~/.megatestrc file, put (use trace)(trace-call-sites #t)(trace function-you-want-to-trace) in this file
;; load the ~/.megatestrc file, put (import trace)(trace-call-sites #t)(trace function-you-want-to-trace) in this file
;;
(let ((debugcontrolf (conc (get-environment-variable "HOME") "/.megatestrc")))
  (if (common:file-exists? debugcontrolf)
      (load debugcontrolf)))

;; usage logging, careful with this, it is not designed to deal with all real world challenges!
;;
161
162
163
164
165
166
167
168

169
170
171
172
173
174
175
190
191
192
193
194
195
196

197
198
199
200
201
202
203
204







-
+







  -status                 : Applies to runs, tests or steps depending on context
  -modepatt key           : load testpatt from <key> in runconfigs instead of default TESTPATT if -testpatt and -tagexpr are not specified
  -tagexpr tag1,tag2%,..  : select tests with tags matching expression
  

Test helpers (for use inside tests)
  -step stepname
  -test-status            : set the state and status of a test (use :state and :status)
  -test-status            : set the state and status of a test (import :state and :status)
  -setlog logfname        : set the path/filename to the final log relative to the test
                            directory. may be used with -test-status
  -set-toplog logfname    : set the overall log for a suite of sub-tests
  -summarize-items        : for an itemized test create a summary html 
  -m comment              : insert a comment for this test

Test data capture
244
245
246
247
248
249
250
251

252
253
254
255
256
257
258
273
274
275
276
277
278
279

280
281
282
283
284
285
286
287







-
+







  -refdb2dat refdb        : convert refdb to sexp or to format specified by s-dumpmode
                            formats: perl, ruby, sqlite3, csv (for csv the -o param
                            will substitute %s for the sheet name in generating 
                            multiple sheets)
  -o                      : output file for refdb2dat (defaults to stdout)
  -archive cmd            : archive runs specified by selectors to one of disks specified
                            in the [archive-disks] section.
                            cmd: keep-html, restore, save, save-remove, get, replicate-db (use 
                            cmd: keep-html, restore, save, save-remove, get, replicate-db (import 
                            -dest to set destination), -include path1,path2... to get or save specific files
  -generate-html          : create a simple html dashboard for browsing your runs
  -generate-html-structure  : create a top level html veiw to list targets/runs and a Run view within each run directory.  
  -list-run-time          : list time requered to complete runs. It supports following switches
                            -run-patt <patt> -target-patt <patt> -dumpmode <csv,json,plain-text>
  -list-test-time	  : list time requered to complete each test in a run. It following following arguments
                            -runname <patt> -target <patt> -dumpmode <csv,json,plain-text>
2397
2398
2399
2400
2401
2402
2403
2404

2405
2406

2407
2408
2409
2410
2411
2412
2413
2426
2427
2428
2429
2430
2431
2432

2433
2434

2435
2436
2437
2438
2439
2440
2441
2442







-
+

-
+







	    ;; (exit)
	    ;; EOF

	    (repl))
	   (else
	    (begin
	      (set! *db* dbstructs)
	      (import extras) ;; might not be needed
	      ;; (import extras) ;; might not be needed
	      ;; (import csi)
	      (import readline)
	      (import breadline)
	      (import apropos)
	      (import dbfile)
	      ;; (import (prefix sqlite3 sqlite3:)) ;; doesn't work ...

	      (if *use-new-readline*
		  (begin
		    (install-history-file (get-environment-variable "HOME") ".megatest_history") ;;  [homedir] [filename] [nlines])