Megatest

Check-in [34efa31216]
Login
Overview
Comment:Added test4 for high impact on db. Pulled in the beginings of multi-filter code
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 34efa31216b9330daa6a416d9e7d52e29e187cef
User & Date: mrwellan on 2012-04-04 17:29:33
Other Links: manifest | tags
Context
2012-04-04
17:30
Pulled in the beginings of multi-filter code check-in: 3e1180bef3 user: mrwellan tags: trunk
17:29
Added test4 for high impact on db. Pulled in the beginings of multi-filter code check-in: 34efa31216 user: mrwellan tags: trunk
2012-04-03
22:44
Run locks Closed-Leaf check-in: 93a73acc32 user: matt tags: run-locks
00:05
Fixed storage of path to be link dir, not run dir check-in: c4dc36c8ef user: matt tags: trunk, v1.41
Changes

Modified megatest.scm from [02de8ae88c] to [ff47085649].

87
88
89
90
91
92
93


94
95
96
97
98
99
100
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102







+
+







                            and :runname ,-testpatt and -itempatt
                            and -testpatt
  -rerun FAIL,WARN...     : re-run if called on a test that previously ran (nullified
                            if -keepgoing is also specified)
  -rebuild-db             : bring the database schema up to date
  -rollup                 : fill run (set by :runname)  with latest test(s) from
                            prior runs with same keys
  -lock                   : lock the run specified by target and runname as locked
                            which prevents -remove-runs from removing the run
  -update-meta            : update the tests metadata for all tests
  -env2file fname         : write the environment to fname.csh and fname.sh
  -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are
                                 overwritten by values set in config files.
  -archive                : archive tests, use -target, :runname, -itempatt and -testpatt
  -server -|hostname      : start the server (reduces contention on megatest.db), use
                            - to automatically figure out hostname
174
175
176
177
178
179
180

181
182
183
184
185
186
187
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190







+







			"-set-values"
			"-load-test-data"
			"-summarize-items"
		        "-gui"
			;; misc
			"-archive"
			"-repl"
			"-lock"
			;; queries
			"-test-paths" ;; get path(s) to a test, ordered by youngest first

			"-runall"    ;; run all tests
			"-remove-runs"
			"-keepgoing"
			"-usequeue"

Modified runs.scm from [dcd447f66f] to [f5e1ed9051].

503
504
505
506
507
508
509


510


511
512


513
514
515
516
517
518
519
503
504
505
506
507
508
509
510
511

512
513
514

515
516
517
518
519
520
521
522
523







+
+
-
+
+

-
+
+







    (debug:print 1 "Header: " header)
    (for-each
     (lambda (run)
       (let ((runkey (string-intersperse (map (lambda (k)
						(db:get-value-by-header run header (vector-ref k 0))) keys) "/"))
	     (dirs-to-remove (make-hash-table)))
	 (let* ((run-id (db:get-value-by-header run header "id") )
		(run-state (db:get-value-by-header run header "state"))
		(tests     (if (not (equal? run-state "locked"))
		(tests  (rdb:get-tests-for-run db (db:get-value-by-header run header "id") testpatt itempatt '() '()))
			       (rdb:get-tests-for-run db (db:get-value-by-header run header "id") testpatt itempatt '() '())
			       '()))
		(lasttpath "/does/not/exist/I/hope"))

	   (if (not (equal? run-state "locked"))
	       (begin
	   (if (not (null? tests))
	       (begin
		 (debug:print 1 "Removing tests for run: " runkey " " (db:get-value-by-header run header "runname"))
		 (for-each
		  (lambda (test)
		    (let* ((item-path (db:test-get-item-path test))
			   (test-name (db:test-get-testname test))
568
569
570
571
572
573
574
575

576
577
578
579
580
581
582
572
573
574
575
576
577
578

579
580
581
582
583
584
585
586







-
+







		   (db:delete-run db run-id)
		   ;; need to figure out the path to the run dir and remove it if empty
		   ;;    (if (null? (glob (conc runpath "/*")))
		   ;;        (begin
		   ;; 	 (debug:print 1 "Removing run dir " runpath)
		   ;; 	 (system (conc "rmdir -p " runpath))))
		   ))))
	 ))
	       ))))
     runs)))

;;======================================================================
;; Routines for manipulating runs
;;======================================================================

;; Since many calls to a run require pretty much the same setup 

Modified tests/Makefile from [c16d8b491b] to [9b4231f1d6].

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





-
+


-
+












+
+
+
+
+
+



-
+
-
-
-
-
-
-
-
-







# run some tests

BINPATH=$(shell realpath ../bin)
MEGATEST=$(BINPATH)/megatest
PATH := $(BINPATH):$(PATH)
RUNNAME := $(shell date +w%V.%u.%H)
RUNNAME := $(shell date +w%V.%u.%H.%M)
IPADDR := "-"
# Set SERVER to "-server -"
SERVER := ""
SERVER := 

runall : test1 test2

test1 : cleanprep
	$(MEGATEST) -runtests ez_pass -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_a $(SERVER)

test2 : cleanprep
	$(MEGATEST) -runtests runfirst -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b  $(SERVER) -debug 10

test3 : cleanprep
	$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_b -m "This is a comment specific to a run" -v $(SERVER)

test4 : cleanprep
	$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_aa -v $(SERVER) >& aa.log &
	$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ab -v $(SERVER) >& ab.log &
	$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ac -v $(SERVER) >& ac.log &
	$(MEGATEST) -runall -reqtarg ubuntu/nfs/none :runname $(RUNNAME)_ad -v $(SERVER) >& ad.log &	

cleanprep : ../*.scm
	sqlite3 megatest.db "delete from metadat where var='SERVER';"
	mkdir -p /tmp/mt_runs /tmp/mt_links
	cd ..;make
	cd ..;make install
	@sleep 1
	# @if ps -def |awk '{print $8}'|grep megatest; then \
	#    echo WARNING: These tests will kill megatest and dashboard!; \
	#    sleep 3; \
	#    killall -9 dboard || true; \
  	#    killall -9 megatest || true; \
	# fi
	cd ../;make install
	$(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt % -itempatt %
	$(BINPATH)/dboard -rows 15 &
	touch cleanprep

test :
	csi -b -I .. ../megatest.scm -- -runall -target ubuntu/afs/tmp :runname blah
	cd ../;make test

Added utils/cleanup-links-dir.sh version [2e6a90f3c8].




















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/usr/bin/env bash

export LINKSDIR=$1
export RUNSDIR=$2

if [ "x$LINKSDIR" == "x" ];then
   echo Usage: cleanup-links-dir /links/dir/path /runs/dir/path
   exit
fi


echo Removing dangling links....
for lnk in `find $LINKSDIR -type l ! -exec test -r {} \; -print`; do
  echo $lnk
  rm -f $lnk
done

echo Removing empty directories....
find $LINKSDIR -depth -type d -empty -print -exec rmdir {} \;