Check-in [e6213e8dbb]
Not logged in
Overview
SHA1 Hash:e6213e8dbb92fb500d7a38531e70d825580330b0
Date: 2012-01-26 23:18:44
User: matt
Comment:Added -test-paths query for getting paths to previous tests
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified db.scm from [cf37c2a3a0f0491d] to [5aeed6583f9faaf6].

478 478 479 ;; 479 ;; 480 (define (db:test-set-rundir! db run-id testname item-path rundir) 480 (define (db:test-set-rundir! db run-id testname item-path rundir) 481 (sqlite3:execute 481 (sqlite3:execute 482 db 482 db 483 "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" 483 "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;" 484 rundir run-id testname item-path)) 484 rundir run-id testname item-path)) > 485 > 486 ;; Misc. test related queries > 487 (define (db:test-get-paths-matching db keyvallst runname keys keynames target) > 488 ;; (print "keyvallst: " keyvallst ", runname: " runname) > 489 ;; (print "keys: " keys " keynames: " keynames) > 490 (let ((res '()) > 491 (itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%")) > 492 (testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%")) > 493 (qrystr (string-intersperse > 494 (map (lambda (key val) > 495 (conc "r." key " like '" val "'")) > 496 keynames > 497 (string-split target "/")) > 498 " AND "))) > 499 ;; (print "qrystr: " qrystr) > 500 (sqlite3:for-each-row > 501 (lambda (p) > 502 (set! res (cons p res))) > 503 db > 504 (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.i > 505 qrystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itemp > 506 testpatt "' ORDER BY t.event_time ASC;")) > 507 res)) > 508 485 509 486 ;;====================================================================== 510 ;;====================================================================== 487 ;; Tests meta data 511 ;; Tests meta data 488 ;;====================================================================== 512 ;;====================================================================== 489 513 490 ;; read the record given a testname 514 ;; read the record given a testname 491 (define (db:testmeta-get-record db testname) 515 (define (db:testmeta-get-record db testname)

Modified launch.scm from [a165297934aef0f4] to [3d741a045bcae29c].

215 ( 215 ( 216 (debug:print 4 "Exit valu 216 (debug:print 4 "Exit valu 217 " this-step- 217 " this-step- 218 " next-statu 218 " next-statu 219 (case next-status 219 (case next-status 220 ((warn) 220 ((warn) 221 (set! rollup-status 2) 221 (set! rollup-status 2) 222 ;; (test-set-status! d < 223 (test-set-status! db r 222 (test-set-status! db r 224 (if 223 (if 225 #f)) 224 #f)) 226 ((pass) 225 ((pass) 227 ;; (test-set-status! d < 228 (test-set-status! db r 226 (test-set-status! db r 229 (else ;; 'fail 227 (else ;; 'fail 230 (set! rollup-status 1) 228 (set! rollup-status 1) 231 ;; (test-set-status! d < 232 (test-set-status! db r 229 (test-set-status! db r 233 )))) 230 )))) 234 (if (and (steprun-good? logpr 231 (if (and (steprun-good? logpr 235 (not (null? tal))) 232 (not (null? tal))) 236 (loop (car tal) (cdr tal) 233 (loop (car tal) (cdr tal) 237 (debug:print 4 "WARNING: a prior st 234 (debug:print 4 "WARNING: a prior st 238 (monitorjob (lambda () 235 (monitorjob (lambda ()

Modified megatest.scm from [5624d22f1c63648d] to [19704606e8f7c835].

70 fields category,variable,value,comment 70 fields category,variable,value,comment 71 71 72 Queries 72 Queries 73 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 73 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 74 -testpatt patt : in list-runs show only these tests, % is the wildcar 74 -testpatt patt : in list-runs show only these tests, % is the wildcar 75 -itempatt patt : in list-runs show only tests with items that match p 75 -itempatt patt : in list-runs show only tests with items that match p 76 -showkeys : show the keys used in this megatest setup 76 -showkeys : show the keys used in this megatest setup > 77 -test-paths targpatt : get the most recent test path(s) matching targpatt e > 78 returns list sorted by age ascending, see examples b 77 79 78 Misc 80 Misc 79 -force : override some checks 81 -force : override some checks 80 -xterm : start an xterm instead of launching the test < 81 -remove-runs : remove the data for a run, requires all fields be sp 82 -remove-runs : remove the data for a run, requires all fields be sp 82 and :runname ,-testpatt and -itempatt 83 and :runname ,-testpatt and -itempatt 83 and -testpatt 84 and -testpatt 84 -keepgoing : continue running until no jobs are \"LAUNCHED\" or < 85 \"NOT_STARTED\" < 86 -rerun FAIL,WARN... : re-run if called on a test that previously ran (null 85 -rerun FAIL,WARN... : re-run if called on a test that previously ran (null 87 if -keepgoing is also specified) 86 if -keepgoing is also specified) 88 -rebuild-db : bring the database schema up to date 87 -rebuild-db : bring the database schema up to date 89 -rollup : fill run (set by :runname) with latest test(s) from 88 -rollup : fill run (set by :runname) with latest test(s) from 90 prior runs with same keys 89 prior runs with same keys 91 -update-meta : update the tests metadata for all tests 90 -update-meta : update the tests metadata for all tests 92 -env2file fname : write the environment to fname.csh and fname.sh 91 -env2file fname : write the environment to fname.csh and fname.sh ................................................................................................................................................................................ 95 Spreadsheet generation 94 Spreadsheet generation 96 -extract-ods fname.ods : extract an open document spreadsheet from the databa 95 -extract-ods fname.ods : extract an open document spreadsheet from the databa 97 -pathmod path : insert path, i.e. path/runame/itempath/logfile.html 96 -pathmod path : insert path, i.e. path/runame/itempath/logfile.html 98 will clear the field if no rundir/testname/itempath/ 97 will clear the field if no rundir/testname/itempath/ 99 if it contains forward slashes the path will be conv 98 if it contains forward slashes the path will be conv 100 to windows style 99 to windows style 101 100 102 Helpers | 101 Helpers (these only apply in test run mode) 103 -runstep stepname ... : take remaining params as comand and execute as stepn 102 -runstep stepname ... : take remaining params as comand and execute as stepn 104 log will be in stepname.log. Best to put command in 103 log will be in stepname.log. Best to put command in 105 -logpro file : with -exec apply logpro file to stepname.log, create 104 -logpro file : with -exec apply logpro file to stepname.log, create 106 stepname.html and sets log to same 105 stepname.html and sets log to same 107 If using make use stepname_logpro.log as your target 106 If using make use stepname_logpro.log as your target 108 107 > 108 Examples > 109 > 110 # Get test paths > 111 megatest -test-paths -target ubuntu/n%/no% :runname w49% -testpatt test_mt% > 112 109 Called as " (string-intersperse (argv) " "))) 113 Called as " (string-intersperse (argv) " "))) 110 114 111 ;; -gui : start a gui interface 115 ;; -gui : start a gui interface 112 ;; -config fname : override the runconfig file with fname 116 ;; -config fname : override the runconfig file with fname 113 117 114 ;; process args 118 ;; process args 115 (define remargs (args:get-args 119 (define remargs (args:get-args ................................................................................................................................................................................ 156 "-xterm" 160 "-xterm" 157 "-showkeys" 161 "-showkeys" 158 "-test-status" 162 "-test-status" 159 "-set-values" 163 "-set-values" 160 "-load-test-data" 164 "-load-test-data" 161 "-summarize-items" 165 "-summarize-items" 162 "-gui" 166 "-gui" > 167 ;; queries > 168 "-test-paths" ;; get path(s) to a test, ordered by young > 169 163 "-runall" ;; run all tests 170 "-runall" ;; run all tests 164 "-remove-runs" 171 "-remove-runs" 165 "-keepgoing" 172 "-keepgoing" 166 "-usequeue" 173 "-usequeue" 167 "-rebuild-db" 174 "-rebuild-db" 168 "-rollup" 175 "-rollup" 169 "-update-meta" 176 "-update-meta" ................................................................................................................................................................................ 378 "rollup tests" 385 "rollup tests" 379 (lambda (db keys keynames keyvallst) 386 (lambda (db keys keynames keyvallst) 380 (runs:rollup-run db 387 (runs:rollup-run db 381 keys 388 keys 382 (keys->alist keys "na") 389 (keys->alist keys "na") 383 (args:get-arg ":runname") 390 (args:get-arg ":runname") 384 user)))) 391 user)))) > 392 > 393 ;;====================================================================== > 394 ;; Get paths to tests > 395 ;;====================================================================== > 396 ;; run all tests are are Not COMPLETED and PASS or CHECK > 397 (if (args:get-arg "-test-paths") > 398 (general-run-call > 399 "-test-paths" > 400 "Get paths to tests" > 401 (lambda (db target runname keys keynames keyvallst) > 402 (let* ((itempatt (args:get-arg "-itempatt")) > 403 (paths (db:test-get-paths-matching db keyvallst runname keys ke > 404 (for-each (lambda (path) > 405 (print path)) > 406 paths))))) 385 407 386 ;;====================================================================== 408 ;;====================================================================== 387 ;; Extract a spreadsheet from the runs database 409 ;; Extract a spreadsheet from the runs database 388 ;;====================================================================== 410 ;;====================================================================== 389 411 390 (if (args:get-arg "-extract-ods") 412 (if (args:get-arg "-extract-ods") 391 (general-run-call 413 (general-run-call