Megatest

Check-in [89a6bb7363]
Login
Overview
Comment:Added beginings of documentation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 89a6bb73630e6b89b89935ea3347a39738c4537b
User & Date: matt on 2011-05-07 22:38:01
Other Links: manifest | tags
Context
2011-05-07
22:45
Added installall.sh chicken scheme install script check-in: 65459fc75e user: matt tags: trunk
22:38
Added beginings of documentation check-in: 89a6bb7363 user: matt tags: trunk
13:20
Fixed redir snippet for bash check-in: 6696dc330f user: matt tags: trunk
Changes

Added docs/Makefile version [47143d4774].











>
>
>
>
>
1
2
3
4
5

megatest.html : megatest.lyx
	lyx -e html megatest.lyx
	cp megatest.html.LyXconv/megatest.html megatest.html

Added docs/megatest.html version [93abb428ee].



























































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="generator" content="http://www.nongnu.org/elyxer/"/>
<meta name="create-date" content="2011-05-07"/>
<link rel="stylesheet" href="http://www.nongnu.org/elyxer/lyx.css" type="text/css" media="screen"/>
<title>Megatest</title>
</head>
<body>
<div id="globalWrapper">

<h1 class="title">
Megatest
</h1>
<h2 class="Date">
5/5/2011 
</h2>
<h2 class="author">
Matt Welland
</h2>
<div class="abstract">

<p class="abstract-message">
Abstract
</p>Megatest is a minimalistic tool to help automate and manage the running of a suite of regression tests or other processes and to roll up the results for display on a web page or dashboard.
</div>
<div class="Unindented">

<div class="fulltoc">

<div class="tocheader">
Table of Contents
</div><div class="tocindent">
<div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Section-0.1">Section 0.1: About Megatest</a>
</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsection-0.1.1">Subsection 0.1.1: Megatest design philosophy</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsection-0.1.2">Subsection 0.1.2: Megatest architecture</a>
</div></div>

<div class="toc">
<a class="Link" href="#toc-Section-0.2">Section 0.2: Installation</a>
</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsection-0.2.1">Subsection 0.2.1: Compilation</a>
</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.1.1">Subsubsection 0.2.1.1: Dependencies</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.1.2">Subsubsection 0.2.1.2: Build and install</a>
</div></div>

<div class="toc">
<a class="Link" href="#toc-Subsection-0.2.2">Subsection 0.2.2: Setup</a>
</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.1">Subsubsection 0.2.2.1: Create megatest.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.2">Subsubsection 0.2.2.2: Create runconfigs.config</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.3">Subsubsection 0.2.2.3: Create the tests directory and your first test</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.4">Subsubsection 0.2.2.4: Create the testconfig file for your test</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.5">Subsubsection 0.2.2.5: Create your test running script, main.sh</a>
</div>
<div class="toc">
<a class="Link" href="#toc-Subsubsection-0.2.2.6">Subsubsection 0.2.2.6: Run megatest and watch your run progress</a>
</div></div>
</div>

<div class="toc">
<a class="Link" href="#toc-Section-0.3">Section 0.3: Reference</a>
</div><div class="tocindent">

<div class="toc">
<a class="Link" href="#toc-Subsection-0.3.1">Subsection 0.3.1: Environment variables</a>
</div></div>
</div>
</div>

</div>
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-0.1">0.1</a> About Megatest
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.1.1">0.1.1</a> Megatest design philosophy
</h3>
<div class="Unindented">
Megatest is intended to provide the minimum needed resources to make writing a suite of tests for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome. A call to megatest can then be made to record the result. 
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.1.2">0.1.2</a> Megatest architecture
</h3>
<div class="Unindented">
All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to “call home” to your master sqlite3 database.
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-0.2">0.2</a> Installation
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.2.1">0.2.1</a> Compilation
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.1.1">0.2.1.1</a> Dependencies
</h4>
<div class="Unindented">
Chicken scheme and a number of eggs are required for building megatest. See the file utils/installall.sh for an automated way to install the dependancies on Linux.
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.1.2">0.2.1.2</a> Build and install
</h4>
<div class="Unindented">
Run “make test” to create the megatest exectutable. You may wish to copy the executable to a centrally accessible location.
</div>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.2.2">0.2.2</a> Setup
</h3>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.1">0.2.2.1</a> Create megatest.config
</h4>
<div class="Unindented">
Create the file megatest.config using the megatest.config template from the tests directory. At a minimum you need the following:
</div>
<div class="Code">
# Fields are the keys under which your test runs are organised
</div>
<div class="Code">
[fields]
</div>
<div class="Code">
field1 TEXT
</div>
<div class="Code">
field2 TEXT
</div>
<div class="Code">

</div>
<div class="Code">
[jobtools]
</div>
<div class="Code">
# The launcher launches jobs to the local or remote hosts,
</div>
<div class="Code">
# the job is managed on the target host by megatest,
</div>
<div class="Code">
# comment out launcher to run local only. An example launcher
</div>
<div class="Code">
# "nbfake" can be found in the utils directory. 
</div>
<div class="Code">
launcher nbfake
</div>
<div class="Code">

</div>
<div class="Code">
# The disks section specifies where the tests will be run. As you
</div>
<div class="Code">
# run out of space in a partition you can add additional disks
</div>
<div class="Code">
# entries.
</div>
<div class="Code">
# Format is:
</div>
<div class="Code">
# name /path/to/area 
</div>
<div class="Code">
[disks]
</div>
<div class="Code">
1 /tmp 
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.2">0.2.2.2</a> Create runconfigs.config
</h4>
<div class="Unindented">
This file is used to set environment variables that are run specific. You can simply create an empty file to start.
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.3">0.2.2.3</a> Create the tests directory and your first test
</h4>
<div class="Unindented">
The structure should look like this:
</div>
<div class="Code">
../tests
</div>
<div class="Code">
├── megatest.config
</div>
<div class="Code">
├── runconfigs.config 
</div>
<div class="Code">
└── tests 
</div>
<div class="Code">
    └── mytest 
</div>
<div class="Code">
       ├── main.sh
</div>
<div class="Code">
       └── testconfig 
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.4">0.2.2.4</a> Create the testconfig file for your test
</h4>
<div class="Code">
[setup]
</div>
<div class="Code">
runscript main.sh
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.5">0.2.2.5</a> Create your test running script, main.sh
</h4>
<div class="Code">
#!/bin/bash
</div>
<div class="Code">

</div>
<div class="Code">
megatest -runstep mystep1 "sleep 20;echo Done" -m "mystep1 is done"
</div>
<div class="Code">
megatest -test-status :state COMPLETED :status PASS -m "This is a test level comment"
</div>
<h4 class="Subsubsection">
<a class="toc" name="toc-Subsubsection-0.2.2.6">0.2.2.6</a> Run megatest and watch your run progress
</h4>
<div class="Code">
megatest :field1 abc :field2 def :runname 2011week08.4a -runall
</div>
<div class="Code">
watch megatest -list-runs %
</div>
<h2 class="Section">
<a class="toc" name="toc-Section-0.3">0.3</a> Reference
</h2>
<h3 class="Subsection">
<a class="toc" name="toc-Subsection-0.3.1">0.3.1</a> Environment variables
</h3>
<div class="Unindented">

<table>

<tr>

<td align="left" valign="top">
Variable
</td>
<td align="left" valign="top">
Purpose
</td>
<td align="left" valign="top">
Default value/Comment
</td>
</tr>
<tr>

<td align="left" valign="top">
MT_CMDINFO
</td>
<td align="left" valign="top">
Conveys test variables to the megatest test runner.
</td>
<td align="left" valign="top">
Not for use by the end user
</td>
</tr>
<tr>

<td align="left" valign="top">
MT_TEST_RUN_DIR
</td>
<td align="left" valign="top">
Directory assigned by megatest for the test to run.
</td>
<td align="left" valign="top">
Tests can consider this their “home” directory
</td>
</tr>
<tr>

<td align="left" valign="top">
MT_TEST_NAME
</td>
<td align="left" valign="top">
Name of the test, corrosponds to the directory name under tests.
</td>
<td align="left" valign="top">

</td>
</tr>
<tr>

<td align="left" valign="top">
MT_ITEM_INFO
</td>
<td align="left" valign="top">
Iterated tests will set this to a sequence of key/values ((KEY val) ...) 
</td>
<td align="left" valign="top">

</td>
</tr>
<tr>

<td align="left" valign="top">
MT_RUN_AREA_HOME
</td>
<td align="left" valign="top">
Directory where megatest was launched from and where the tests code can be found
</td>
<td align="left" valign="top">

</td>
</tr>
<tr>

<td align="left" valign="top">
MT_RUNNAME
</td>
<td align="left" valign="top">
Name of this run as set by the :runname parameter
</td>
<td align="left" valign="top">

</td>
</tr>
<tr>

<td align="left" valign="top">
&lt;field1&gt; ....
</td>
<td align="left" valign="top">
The field values as set on the megatest -runall command line (e.g. :field1 abc)
</td>
<td align="left" valign="top">
Planning ahead your field names is important so as to avoid collisions with other environment variables
</td>
</tr>
</table>
</div>
<div class="Code">

</div>

<hr/>
<p>Copyright (C) 2011 Matt Welland</p>
</div>
</body>
</html>

Added docs/megatest.lyx version [312589161f].





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass docbook
\use_default_options false
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 0
\use_esint 0
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Title
Megatest
\end_layout

\begin_layout Date
5/5/2011 
\end_layout

\begin_layout Author
Matt Welland
\end_layout

\begin_layout Abstract
Megatest is a minimalistic tool to help automate and manage the running
 of a suite of regression tests or other processes and to roll up the results
 for display on a web page or dashboard.
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Section
About Megatest
\end_layout

\begin_layout Subsection
Megatest design philosophy
\end_layout

\begin_layout Standard
Megatest is intended to provide the minimum needed resources to make writing
 a suite of tests for software, design engineering or process control (via
 owlfs for example) without being specialized for any specific problem space.
 Megatest in of itself does not know what constitutes a PASS or FAIL of
 a test.
 In most cases megatest is best used in conjunction with logpro or a similar
 tool to parse, analyze and decide on the test outcome.
 A call to megatest can then be made to record the result.
 
\end_layout

\begin_layout Subsection
Megatest architecture
\end_layout

\begin_layout Standard
All data to specify the tests and configure the system is stored in plain
 text files.
 All system state is stored in an sqlite3 database.
 Tests are launched using the launching system available for the distributed
 compute platform in use.
 A template script is provided which can launch jobs on local and remote
 Linux hosts.
 Currently megatest uses the network filesystem to 
\begin_inset Quotes eld
\end_inset

call home
\begin_inset Quotes erd
\end_inset

 to your master sqlite3 database.
\end_layout

\begin_layout Section
Installation
\end_layout

\begin_layout Subsection
Compilation
\end_layout

\begin_layout Subsubsection
Dependencies
\end_layout

\begin_layout Standard
Chicken scheme and a number of eggs are required for building megatest.
 See the file utils/installall.sh for an automated way to install the dependancie
s on Linux.
\end_layout

\begin_layout Subsubsection
Build and install
\end_layout

\begin_layout Standard
Run 
\begin_inset Quotes eld
\end_inset

make test
\begin_inset Quotes erd
\end_inset

 to create the megatest exectutable.
 You may wish to copy the executable to a centrally accessible location.
\end_layout

\begin_layout Subsection
Setup
\end_layout

\begin_layout Subsubsection
Create megatest.config
\end_layout

\begin_layout Standard
Create the file megatest.config using the megatest.config template from the
 tests directory.
 At a minimum you need the following:
\end_layout

\begin_layout Code
# Fields are the keys under which your test runs are organised
\end_layout

\begin_layout Code
[fields]
\end_layout

\begin_layout Code
field1 TEXT
\end_layout

\begin_layout Code
field2 TEXT
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
[jobtools]
\end_layout

\begin_layout Code
# The launcher launches jobs to the local or remote hosts,
\end_layout

\begin_layout Code
# the job is managed on the target host by megatest,
\end_layout

\begin_layout Code
# comment out launcher to run local only.
 An example launcher
\end_layout

\begin_layout Code
# "nbfake" can be found in the utils directory.
 
\end_layout

\begin_layout Code
launcher nbfake
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
# The disks section specifies where the tests will be run.
 As you
\end_layout

\begin_layout Code
# run out of space in a partition you can add additional disks
\end_layout

\begin_layout Code
# entries.
\end_layout

\begin_layout Code
# Format is:
\end_layout

\begin_layout Code
# name /path/to/area 
\end_layout

\begin_layout Code
[disks]
\end_layout

\begin_layout Code
1 /tmp 
\end_layout

\begin_layout Subsubsection
Create runconfigs.config
\end_layout

\begin_layout Standard
This file is used to set environment variables that are run specific.
 You can simply create an empty file to start.
\end_layout

\begin_layout Subsubsection
Create the tests directory and your first test
\end_layout

\begin_layout Standard
The structure should look like this:
\end_layout

\begin_layout Code
../tests
\end_layout

\begin_layout Code
├── megatest.config
\end_layout

\begin_layout Code
├── runconfigs.config 
\end_layout

\begin_layout Code
└── tests 
\end_layout

\begin_layout Code
    └── mytest 
\end_layout

\begin_layout Code
       ├── main.sh
\end_layout

\begin_layout Code
       └── testconfig 
\end_layout

\begin_layout Subsubsection
Create the testconfig file for your test
\end_layout

\begin_layout Code
[setup]
\end_layout

\begin_layout Code
runscript main.sh
\end_layout

\begin_layout Subsubsection
Create your test running script, main.sh
\end_layout

\begin_layout Code
#!/bin/bash
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
megatest -runstep mystep1 "sleep 20;echo Done" -m "mystep1 is done"
\end_layout

\begin_layout Code
megatest -test-status :state COMPLETED :status PASS -m "This is a test level
 comment"
\end_layout

\begin_layout Subsubsection
Run megatest and watch your run progress
\end_layout

\begin_layout Code
megatest :field1 abc :field2 def :runname 2011week08.4a -runall
\end_layout

\begin_layout Code
watch megatest -list-runs %
\end_layout

\begin_layout Section
Reference
\end_layout

\begin_layout Subsection
Environment variables
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="3">
<features>
<column alignment="left" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<row>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Variable
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Purpose
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Default value/Comment
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_CMDINFO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Conveys test variables to the megatest test runner.
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Not for use by the end user
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_TEST_RUN_DIR
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Directory assigned by megatest for the test to run.
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Tests can consider this their 
\begin_inset Quotes eld
\end_inset

home
\begin_inset Quotes erd
\end_inset

 directory
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_TEST_NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Name of the test, corrosponds to the directory name under tests.
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_ITEM_INFO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Iterated tests will set this to a sequence of key/values ((KEY val) ...) 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_RUN_AREA_HOME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Directory where megatest was launched from and where the tests code can
 be found
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
MT_RUNNAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Name of this run as set by the :runname parameter
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<field1> ....
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The field values as set on the megatest -runall command line (e.g.
 :field1 abc)
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Planning ahead your field names is important so as to avoid collisions with
 other environment variables
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Code

\end_layout

\end_body
\end_document

Modified megatest.scm from [a21f856323] to [69504632d4].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;; Copyright 2006-2011, Matthew Welland.
;; 
;;  This program is made available under the GNU GPL version 2.0 or
;;  greater. See the accompanying file COPYING for details.
;; 
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.

(include "common.scm")
(define megatest-version 1.02)

(define help (conc "
Megatest, documentation at http://www.kiatoa.com/fossils/megatest
  version " megatest-version "
  license GPL, Copyright Matt Welland 2006-2011

Usage: megatest [options]










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;; Copyright 2006-2011, Matthew Welland.
;; 
;;  This program is made available under the GNU GPL version 2.0 or
;;  greater. See the accompanying file COPYING for details.
;; 
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.

(include "common.scm")
(define megatest-version 1.03)

(define help (conc "
Megatest, documentation at http://www.kiatoa.com/fossils/megatest
  version " megatest-version "
  license GPL, Copyright Matt Welland 2006-2011

Usage: megatest [options]
307
308
309
310
311
312
313

314
315
316
317
318
319



320
321
322
323
324
325
326
	  (let* ((testpath  (assoc/default 'testpath  cmdinfo))
		 (work-area (assoc/default 'work-area cmdinfo))
		 (test-name (assoc/default 'test-name cmdinfo))
		 (runscript (assoc/default 'runscript cmdinfo))
		 (db-host   (assoc/default 'db-host   cmdinfo))
		 (run-id    (assoc/default 'run-id    cmdinfo))
		 (itemdat   (assoc/default 'itemdat   cmdinfo))

		 (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo))
		 (fullrunscript (conc testpath "/" runscript))
		 (db        #f))
	    (print "Exectuing " test-name " on " (get-host-name))
	    (change-directory testpath)
	    (setenv "MT_TEST_RUN_DIR" testpath)



	    (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path))
	    (if (not (setup-for-run))
		(begin
		  (print "Failed to setup, exiting") 
		  (exit 1)))
	    ;; now can find our db
	    (set! db (open-db))







>






>
>
>







307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	  (let* ((testpath  (assoc/default 'testpath  cmdinfo))
		 (work-area (assoc/default 'work-area cmdinfo))
		 (test-name (assoc/default 'test-name cmdinfo))
		 (runscript (assoc/default 'runscript cmdinfo))
		 (db-host   (assoc/default 'db-host   cmdinfo))
		 (run-id    (assoc/default 'run-id    cmdinfo))
		 (itemdat   (assoc/default 'itemdat   cmdinfo))
		 (runname   (assoc/default 'runname   cmdinfo))
		 (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo))
		 (fullrunscript (conc testpath "/" runscript))
		 (db        #f))
	    (print "Exectuing " test-name " on " (get-host-name))
	    (change-directory testpath)
	    (setenv "MT_TEST_RUN_DIR" testpath)
	    (setenv "MT_TEST_NAME" test-name)
	    (setenv "MT_ITEM_INFO" (conc itemdat))
	    (setenv "MT_RUNNAME"   runname)
	    (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path))
	    (if (not (setup-for-run))
		(begin
		  (print "Failed to setup, exiting") 
		  (exit 1)))
	    ;; now can find our db
	    (set! db (open-db))
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
		    (if logprofile
			(let* ((htmllogfile (conc stepname ".html"))
			       (cmd         (string-intersperse (list "logpro" logprofile htmllogfile "<" logfile ">" (conc stepname "_logpro.log")) " ")))
			  (print "INFO: running \"" cmd "\"")
			  (change-directory startingdir)
			  (set! exitstat (system cmd))
			  (change-directory testpath)
			  (test-set-log! db run-id test-name itemdat logfile)))
		    (test-set-status! db run-id test-name "end" exitstat itemdat (args:get-arg "-m"))
		    (sqlite3:finalize! db)
		    (exit exitstat)
		    ;; open the db
		;; mark the end of the test
		)))
	  (sqlite3:finalize! db)







|







506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
		    (if logprofile
			(let* ((htmllogfile (conc stepname ".html"))
			       (cmd         (string-intersperse (list "logpro" logprofile htmllogfile "<" logfile ">" (conc stepname "_logpro.log")) " ")))
			  (print "INFO: running \"" cmd "\"")
			  (change-directory startingdir)
			  (set! exitstat (system cmd))
			  (change-directory testpath)
			  (test-set-log! db run-id test-name itemdat htmllogfile)))
		    (test-set-status! db run-id test-name "end" exitstat itemdat (args:get-arg "-m"))
		    (sqlite3:finalize! db)
		    (exit exitstat)
		    ;; open the db
		;; mark the end of the test
		)))
	  (sqlite3:finalize! db)

Modified tests/tests/runfirst/main.sh from [90abad0086] to [62fd7b991d].

1
2
3
4
5
6
7
8
9
#!/bin/bash

# megatest -step wasting_time :state start :status n/a -m "This is a test step comment"
# sleep 20
# megatest -step wasting_time :state end :status $?

megatest -runstep wasting_time -logpro wasting_time.logpro "sleep 20;echo all done eh?" -m "This is a test step comment"

megatest -test-status :state COMPLETED :status PASS -setlog thelogfile.log -m "This is a test level comment"








|
1
2
3
4
5
6
7
8
9
#!/bin/bash

# megatest -step wasting_time :state start :status n/a -m "This is a test step comment"
# sleep 20
# megatest -step wasting_time :state end :status $?

megatest -runstep wasting_time -logpro wasting_time.logpro "sleep 20;echo all done eh?" -m "This is a test step comment"

megatest -test-status :state COMPLETED :status PASS -m "This is a test level comment"