Check-in [60d6b0411d]
Not logged in
Overview
SHA1 Hash:60d6b0411d93ee77d2ff44ef75943ea4db3c3f2e
Date: 2011-11-09 15:09:58
User: mrwellan
Comment:Logpro (pass) + test_data (fail) should be fail but is pass. Added test case for this
Timelines: family | ancestors | descendants | both | fixing-logpro-test_data
Diffs: root of this branch
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified db.scm from [807a3e0dc9159003] to [29e62d469f625dc3].

567 (let loop ((lin (read-line))) 567 (let loop ((lin (read-line))) 568 (if (not (eof-object? lin)) 568 (if (not (eof-object? lin)) 569 (begin 569 (begin 570 (debug:print 4 lin) 570 (debug:print 4 lin) 571 (db:csv->test-data db test-id lin) 571 (db:csv->test-data db test-id lin) 572 (loop (read-line)))))) 572 (loop (read-line)))))) 573 ;; roll up the current results. 573 ;; roll up the current results. > 574 ;; FIXME: Add the status to 574 (db:test-data-rollup db test-id))) | 575 (db:test-data-rollup db test-id #f))) 575 576 576 ;; WARNING: Do NOT call this for the parent test on an iterated test 577 ;; WARNING: Do NOT call this for the parent test on an iterated test 577 ;; Roll up test_data pass/fail results 578 ;; Roll up test_data pass/fail results 578 ;; look at the test_data status field, 579 ;; look at the test_data status field, 579 ;; if all are pass (any case) and the test status is PASS or NULL or '' then 580 ;; if all are pass (any case) and the test status is PASS or NULL or '' then 580 ;; if one or more are fail (any case) then set test status to PASS, non "pass 581 ;; if one or more are fail (any case) then set test status to PASS, non "pass 581 (define (db:test-data-rollup db test-id) | 582 (define (db:test-data-rollup db test-id status) 582 (sqlite3:execute 583 (sqlite3:execute 583 db 584 db 584 "UPDATE tests 585 "UPDATE tests 585 SET fail_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status 586 SET fail_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status 586 pass_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status 587 pass_count=(SELECT count(id) FROM test_data WHERE test_id=? AND status 587 WHERE id=?;" 588 WHERE id=?;" 588 test-id test-id test-id) 589 test-id test-id test-id) ................................................................................................................................................................................ 589 ;; if the test is not FAIL then set status based on the fail and pass counts. 590 ;; if the test is not FAIL then set status based on the fail and pass counts. 590 (thread-sleep! 1) 591 (thread-sleep! 1) 591 (sqlite3:execute 592 (sqlite3:execute 592 db 593 db 593 "UPDATE tests 594 "UPDATE tests 594 SET status=CASE WHEN (SELECT fail_count FROM tests WHERE id=?) > 0 595 SET status=CASE WHEN (SELECT fail_count FROM tests WHERE id=?) > 0 595 THEN 'FAIL' 596 THEN 'FAIL' 596 WHEN (SELECT pass_count FROM tests WHERE id=?) > 0 | 597 WHEN (SELECT pass_count FROM tests WHERE id=?) > 0 AND > 598 (SELECT status FROM tests WHERE id=?) NOT IN ('WARN', 597 THEN 'PASS' 599 THEN 'PASS' 598 ELSE status 600 ELSE status 599 END WHERE id=?;" 601 END WHERE id=?;" 600 test-id test-id test-id)) 602 test-id test-id test-id)) 601 603 602 (define (db:get-prev-tol-for-test db test-id category variable) 604 (define (db:get-prev-tol-for-test db test-id category variable) 603 ;; Finish me? 605 ;; Finish me?

Modified launch.scm from [d206050f69bb87d2] to [1748d732463d7f78].

300 ;; (eq? (vector-ref exit-info 2) 0 300 ;; (eq? (vector-ref exit-info 2) 0 301 ;; "PASS" 301 ;; "PASS" 302 ;; "FAIL") 302 ;; "FAIL") 303 ;; "FAIL") 303 ;; "FAIL") 304 ;; New logic based on rollup-status 304 ;; New logic based on rollup-status 305 (cond 305 (cond 306 ((not (vector-ref exit-info 1)) "FAIL") ; 306 ((not (vector-ref exit-info 1)) "FAIL") ; 307 ((eq? rollup-status 0) "PASS") | 307 ((eq? rollup-status 0) > 308 ;; if the current status is AUTO the def > 309 (if (equal? (db:test-get-status testinfo 308 ((eq? rollup-status 1) "FAIL") 310 ((eq? rollup-status 1) "FAIL") 309 ((eq? rollup-status 2) "WARN") | 311 ((eq? rollup-status 2) > 312 ;; if the current status is AUTO the def > 313 (if (equal? (db:test-get-status testinfo 310 (else "FAIL")) 314 (else "FAIL")) 311 itemdat (args:get-arg "-m") #f))) 315 itemdat (args:get-arg "-m") #f))) 312 ;; for automated creation of the rollup html file this is a good p 316 ;; for automated creation of the rollup html file this is a good p 313 (if (not (equal? item-path "")) 317 (if (not (equal? item-path "")) 314 (tests:summarize-items db run-id test-name #f)) ;; don't force 318 (tests:summarize-items db run-id test-name #f)) ;; don't force 315 ) 319 ) 316 (mutex-unlock! m) 320 (mutex-unlock! m)

Modified runs.scm from [d434521016458489] to [1e2d7c663bc54155].

212 212 213 ;; update the primary record IF state AND status are defined 213 ;; update the primary record IF state AND status are defined 214 (if (and state status) 214 (if (and state status) 215 (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strfti 215 (sqlite3:execute db "UPDATE tests SET state=?,status=?,event_time=strfti 216 state real-status run-id test-name item-path)) 216 state real-status run-id test-name item-path)) 217 217 218 ;; if status is "AUTO" then call rollup 218 ;; if status is "AUTO" then call rollup 219 (if (and test-id state status (equal? status "AUTO")) | 219 (if (and test-id state status (or (equal? status "AUTO")(equal? status "AUTO 220 (db:test-data-rollup db test-id)) | 220 (db:test-data-rollup db test-id status)) 221 221 222 ;; add metadata (need to do this way to avoid SQL injection issues) 222 ;; add metadata (need to do this way to avoid SQL injection issues) 223 223 224 ;; :first_err 224 ;; :first_err 225 ;; (let ((val (hash-table-ref/default otherdat ":first_err" #f))) 225 ;; (let ((val (hash-table-ref/default otherdat ":first_err" #f))) 226 ;; (if val 226 ;; (if val 227 ;; (sqlite3:execute db "UPDATE tests SET first_err=? WHERE run_id=? AN 227 ;; (sqlite3:execute db "UPDATE tests SET first_err=? WHERE run_id=? AN

Added tests/tests/ezlog_fail_then_pass/firststep.logpro version [1d9c0ef873fc449b]

> 1 ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com > 2 ;; > 3 ;; License GPL. > 4 > 5 > 6 (expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) > 7 > 8 (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\ > 9 (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) > 10 (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;;

Added tests/tests/ezlog_fail_then_pass/main.sh version [fd6c1c1d59d66f0b]

> 1 #!/bin/bash > 2 > 3 megatest -step yepstep :state start :status n/a > 4 ls /tmp > 5 megatest -step yepstep :state end :status $? > 6 > 7 megatest -load-test-data << EOF > 8 OPER,du, 1.2, 1.2, < , GBytes ,System didn't use too much space > 9 EOF > 10 > 11 megatest -test-status :state COMPLETED :status AUTO

Added tests/tests/ezlog_fail_then_pass/testconfig version [be9f816262caf64c]

> 1 [setup] > 2 > 3 [ezsteps] > 4 firststep main.sh > 5 > 6 [test_meta] > 7 author matt > 8 owner bob > 9 description This test runs a single ezstep which is logpro clean > 10 but fails based on -test-data loaded. > 11 > 12 tags first,single > 13 reviewed 09/10/2011, by Matt