Megatest

Check-in [3b30783a4a]
Login
Overview
Comment:Fixed in/not-in logic on get-tests-for-run
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.55
Files: files | file ages | folders
SHA1: 3b30783a4a8ccf89b3aef79ed205888971bf37ac
User & Date: mrwellan on 2013-06-14 17:30:51
Other Links: branch diff | manifest | tags
Context
2013-06-14
18:45
Fixed dashboard filtering broken by reqlen queue changes. check-in: 36fddc6e10 user: mrwellan tags: v1.55, v1.5504
17:30
Fixed in/not-in logic on get-tests-for-run check-in: 3b30783a4a user: mrwellan tags: v1.55
2013-06-12
14:54
Bumped version check-in: fa200b5553 user: icfadm tags: v1.55, v1.5503
Changes

Modified db.scm from [4b686abf43] to [c821aeab9a].

775
776
777
778
779
780
781
782

783
784
785
786
787
788
789

790
791
792









793
794
795
796
797
798
799
800
801
802
803
804
			      )
  (debug:print-info 11 "db:get-tests-for-run START run-id=" run-id ", testpatt=" testpatt ", states=" states ", statuses=" statuses ", not-in=" not-in ", sort-by=" sort-by)
  (let* ((res '())
	 ;; if states or statuses are null then assume match all when not-in is false
	 (states-qry      (if (null? states) 
			      #f
			      (conc " state "  
				    (if not-in "NOT" "") 

				    " IN ('" 
				    (string-intersperse states   "','")
				    "')")))
	 (statuses-qry    (if (null? statuses)
			      #f
			      (conc " status "
				    (if not-in "NOT" "") 

				    " IN ('" 
				    (string-intersperse statuses "','")
				    "')")))









	 (tests-match-qry (tests:match->sqlqry testpatt))
	 (qry             (conc "SELECT " qryvals
				" FROM tests WHERE run_id=? AND state != 'DELETED' "
				(if states-qry   (conc " AND " states-qry)   "")
				(if statuses-qry (conc " AND " statuses-qry) "")
				(if tests-match-qry (conc " AND (" tests-match-qry ") ") "")
				(case sort-by
				  ((rundir)     " ORDER BY length(rundir) DESC ")
				  ((event_time) " ORDER BY event_time ASC ")
				  (else         (if (string? sort-by)
						    (conc " ORDER BY " sort-by) 
						    "")))







|
>
|





|
>
|


>
>
>
>
>
>
>
>
>



<
|







775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806

807
808
809
810
811
812
813
814
			      )
  (debug:print-info 11 "db:get-tests-for-run START run-id=" run-id ", testpatt=" testpatt ", states=" states ", statuses=" statuses ", not-in=" not-in ", sort-by=" sort-by)
  (let* ((res '())
	 ;; if states or statuses are null then assume match all when not-in is false
	 (states-qry      (if (null? states) 
			      #f
			      (conc " state "  
				    (if not-in
					" NOT IN ('"
					" IN ('") 
				    (string-intersperse states   "','")
				    "')")))
	 (statuses-qry    (if (null? statuses)
			      #f
			      (conc " status "
				    (if not-in 
					" NOT IN ('"
					" IN ('") 
				    (string-intersperse statuses "','")
				    "')")))
	 (states-statuses-qry 
	                  (cond 
			   ((and states-qry statuses-qry)
			    (conc " AND ( " states-qry " AND " statuses-qry " ) "))
			   (states-qry  
			    (conc " AND " states-qry))
			   (statuses-qry 
			    (conc " AND " statuses-qry))
			   (else "")))
	 (tests-match-qry (tests:match->sqlqry testpatt))
	 (qry             (conc "SELECT " qryvals
				" FROM tests WHERE run_id=? AND state != 'DELETED' "

				states-statuses-qry
				(if tests-match-qry (conc " AND (" tests-match-qry ") ") "")
				(case sort-by
				  ((rundir)     " ORDER BY length(rundir) DESC ")
				  ((event_time) " ORDER BY event_time ASC ")
				  (else         (if (string? sort-by)
						    (conc " ORDER BY " sort-by) 
						    "")))

Modified mt.scm from [8545e808df] to [db089a3853].

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(include "run_records.scm")
(include "test_records.scm")

;; This is the Megatest API. All generally "useful" routines will be wrapped or extended
;; here.


(define (mt:get-tests-for-run run-id testpatt states status #!key (not-in #f) (sort-by #f))
  (let loop ((testsdat (cdb:remote-run db:get-tests-for-run #f run-id testpatt states status 0 500 not-in sort-by))
	     (res      '())
	     (offset   0)
	     (limit    500))
    (let* ((full-list (append res testsdat))
	   (have-more (eq? (length testsdat) limit)))
      (if have-more 







|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(include "run_records.scm")
(include "test_records.scm")

;; This is the Megatest API. All generally "useful" routines will be wrapped or extended
;; here.


(define (mt:get-tests-for-run run-id testpatt states status #!key (not-in #t) (sort-by #f))
  (let loop ((testsdat (cdb:remote-run db:get-tests-for-run #f run-id testpatt states status 0 500 not-in sort-by))
	     (res      '())
	     (offset   0)
	     (limit    500))
    (let* ((full-list (append res testsdat))
	   (have-more (eq? (length testsdat) limit)))
      (if have-more