Megatest

Check-in [772558f8b5]
Login
Overview
Comment:Missing fixes redone. runs:test-get-info -> db:test-get-info
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 772558f8b5722d3eae4e2097b9d400da85750d8a
User & Date: mrwellan on 2011-05-06 10:20:01
Other Links: manifest | tags
Context
2011-05-06
12:22
Partial checkin for fixes to -runstep check-in: 0add4d5d70 user: mrwellan tags: trunk
10:20
Missing fixes redone. runs:test-get-info -> db:test-get-info check-in: 772558f8b5 user: mrwellan tags: trunk
2011-05-05
23:24
Partial fix to bug in launching and running updates check-in: 8f7db81841 user: matt tags: trunk
Changes

Modified megatest.scm from [004777f9a8] to [2fe3656792].

378
379
380
381
382
383
384
385

386
387
388
389
390
391
392
378
379
380
381
382
383
384

385
386
387
388
389
390
391
392







-
+







		   (th1          (make-thread monitorjob))
		   (th2          (make-thread runit)))
	      (thread-start! th1)
	      (thread-start! th2)
	      (thread-join! th2)
	      (mutex-lock! m)
	      (set! db (open-db))
	      (let* ((testinfo (runs:get-test-info db run-id test-name (item-list->path itemdat))))
	      (let* ((testinfo (db:get-test-info db run-id test-name (item-list->path itemdat))))
		(if (not (equal? (db:test-get-state testinfo) "COMPLETED"))
		    (begin
		      (print "Test NOT logged as COMPLETED, (state=" (db:test-get-state testinfo) "), updating result")
		      (test-set-status! db run-id test-name
					(if kill-job? "KILLED" "COMPLETED")
					(if (vector-ref exit-info 1) ;; look at the exit-status
					    (if (eq? (vector-ref exit-info 2) 0)

Modified runs.scm from [db89a09415] to [55dbaeab50].

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







-
+














-
+







	item)))

(define (teststep-set-status! db run-id test-name teststep-name state-in status-in itemdat comment)
  ;; (print "run-id: " run-id " test-name: " test-name)
  (let* ((state     (check-valid-items "state" state-in))
	 (status    (check-valid-items "status" status-in))
	 (item-path (item-list->path itemdat))
	 (testdat   (runs:get-test-info db run-id test-name item-path)))
	 (testdat   (db:get-test-info db run-id test-name item-path)))
    ;; (print "testdat: " testdat)
    (if (and testdat ;; if the section exists then force specification BUG, I don't like how this works.
	     (or (not state)(not status)))
	(print "WARNING: Invalid " (if status "status" "state")
	       " value \"" (if status status-in state-in) "\", update your validstates section in megatest.config"))
    (if testdat
	(let ((test-id (test:get-id testdat)))
	  (sqlite3:execute db 
			"INSERT OR REPLACE into test_steps (test_id,stepname,state,status,event_time,comment) VALUES(?,?,?,?,strftime('%s','now'),?);"
			test-id teststep-name state status (if comment comment "")))
	(print "ERROR: Can't update " test-name " for run " run-id " -> no such test in db"))))

(define (test-get-kill-request db run-id test-name itemdat)
  (let* ((item-path (item-list->path itemdat))
	 (testdat   (runs:get-test-info db run-id test-name item-path)))
	 (testdat   (db:get-test-info db run-id test-name item-path)))
    (equal? (test:get-state testdat) "KILLREQ")))

(define (test-set-meta-info db run-id testname itemdat)
  (let ((item-path (item-list->path itemdat))
	(cpuload  (get-cpu-load))
	(hostname (get-host-name))
	(diskfree (get-df (current-directory)))

Modified tests/Makefile from [192cc0f807] to [fa62ae4881].

1
2


3
4
5

6
7
8
9
10
11
12
1
2
3
4
5
6

7
8
9
10
11
12
13
14


+
+


-
+







# run some tests

MEGATEST=$(shell realpath ../megatest)

runall :
	cd ../;make 
	../megatest -runall :sysname ubuntu :fsname nfs :datapath none :runname `date +%GWW%V.%u` -m "This is a comment specific to a run"
	$(MEGATEST) -runall :sysname ubuntu :fsname nfs :datapath none :runname `date +%GWW%V.%u` -m "This is a comment specific to a run"

test :
	cd ../;make test
	make runall

dashboard :
	cd ../;make dashboard

Modified tests/megatest.config from [a84bbe77f9] to [c2d2bae88c].

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
1
2
3
4
5
6


7
8
9
10
11
12
13
14
15






-
-
+
+







[fields]
sysname TEXT
fsname TEXT
datapath TEXT

[setup]
executable /home/matt/data/megatest/megatest
max_concurrent_jobs 3
# executable /home/matt/data/megatest/megatest
max_concurrent_jobs 5

[jobtools]
# ## launcher launches jobs, the job is managed on the target host
## by megatest, comment out launcher to run local
# workhosts localhost hermes
launcher nbfake

Modified tests/tests/sqlitespeed/runscript.rb from [df18637493] to [0c7cdb0a88].

1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







#! /usr/bin/ruby
#! /usr/bin/env ruby

require "#{ENV['MT_RUN_AREA_HOME']}/supportfiles/ruby/librunscript.rb"

# run_record(stepname, cmd) - will record in db if exit code of script was zero or not
run_and_record('create db',"sqlite3 testing.db << EOF\ncreate table if not exists blah(id INTEGER PRIMARY KEY,name TEXT);\n.q\nEOF","")

# file_size_checker(stepname, filename, minsize, maxsize) - negative means ignore