Megatest

Check-in [3dbc84ebdc]
Login
Overview
Comment:Fixed handling of runname in test path search
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3dbc84ebdc61f5dec40d0723981a5c6f5a281101
User & Date: matt on 2012-01-29 18:07:48
Other Links: manifest | tags
Context
2012-01-29
18:08
Updated docs check-in: 7f0234156e user: matt tags: trunk
18:07
Fixed handling of runname in test path search check-in: 3dbc84ebdc user: matt tags: trunk
18:07
Fixed handling of runname in test path search check-in: 29be07e3a4 user: matt tags: trunk
Changes

Modified db.scm from [22f2e6b05a] to [5c4216dd3a].

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
(define (db:test-set-rundir! db run-id testname item-path rundir)
  (sqlite3:execute 
   db 
   "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;"
   rundir run-id testname item-path))

;; Misc. test related queries
(define (db:test-get-paths-matching db runname keynames target)
  (let ((res '())
	(itempatt (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%"))
	(testpatt (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%"))



	(qrystr (string-intersperse 
		 (map (lambda (key val)
			(conc "r." key " like '" val "'"))
		      keynames 
		      (string-split target "/"))
		 " AND ")))




    ;; (print "qrystr: " qrystr)
    (sqlite3:for-each-row 
     (lambda (p)
       (set! res (cons p res)))
     db 
     (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE "
	   qrystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '"
	   testpatt "' ORDER BY t.event_time ASC;"))
    res))


;;======================================================================
;; Tests meta data
;;======================================================================








|
|
|
|
>
>
>
|
|
|
|
|
|
>
>
>
>
|




<
|
<







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
(define (db:test-set-rundir! db run-id testname item-path rundir)
  (sqlite3:execute 
   db 
   "UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;"
   rundir run-id testname item-path))

;; Misc. test related queries
(define (db:test-get-paths-matching db keynames target)
  (let* ((res '())
	 (itempatt   (if (args:get-arg "-itempatt")(args:get-arg "-itempatt") "%"))
	 (testpatt   (if (args:get-arg "-testpatt")(args:get-arg "-testpatt") "%"))
	 (statepatt  (if (args:get-arg ":state")   (args:get-arg ":state")    "%"))
	 (statuspatt (if (args:get-arg ":status")  (args:get-arg ":status")   "%"))
	 (runname    (if (args:get-arg ":runname") (args:get-arg ":runname")  "%"))
	 (keystr (string-intersperse 
		  (map (lambda (key val)
			 (conc "r." key " like '" val "'"))
		       keynames 
		       (string-split target "/"))
		  " AND "))
	 (qrystr (conc "SELECT t.rundir FROM tests AS t INNER JOIN runs AS r ON t.run_id=r.id WHERE "
		       keystr " AND r.runname LIKE '" runname "' AND item_path LIKE '" itempatt "' AND testname LIKE '"
		       testpatt "' AND t.state LIKE '" statepatt "' AND t.status LIKE '" statuspatt 
		       "'ORDER BY t.event_time ASC;")))
    (debug:print 3 "qrystr: " qrystr)
    (sqlite3:for-each-row 
     (lambda (p)
       (set! res (cons p res)))
     db 

     qrystr)

    res))


;;======================================================================
;; Tests meta data
;;======================================================================