Overview
Comment: | Consolidated cache clearing, added calls to clear caches, added -show-runconfig option, setup-env-defaults now returns data struct of vars collected, |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9d86c222ff3312ed16e0f4390c01da41 |
User & Date: | mrwellan on 2012-12-11 08:54:47 |
Other Links: | manifest | tags |
Context
2012-12-11
| ||
08:56 | bumped version to v1.5207 check-in: 9ca9ef6b1d user: mrwellan tags: trunk, v1.5207 | |
08:54 | Consolidated cache clearing, added calls to clear caches, added -show-runconfig option, setup-env-defaults now returns data struct of vars collected, check-in: 9d86c222ff user: mrwellan tags: trunk | |
2012-12-06
| ||
17:27 | Removed run info caching. Cache needs to be invalidated on removal of runs. check-in: 858eb80b3f user: mrwellan tags: trunk | |
Changes
Modified common.scm from [0c5c3a4b91] to [1ba863b641].
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - + + + + + + + + + + + + + + + | (define *keys* (make-hash-table)) ;; cache the keys here (define *keyvals* (make-hash-table)) (define *toptest-paths* (make-hash-table)) ;; cache toptest path settings here (define *test-paths* (make-hash-table)) ;; cache test-id to test run paths here (define *test-ids* (make-hash-table)) ;; cache run-id, testname, and item-path => test-id (define *test-info* (make-hash-table)) ;; cache the test info records, update the state, status, run_duration etc. from testdat.db |
︙ |
Modified db.scm from [b7906df61d] to [f636cf1069].
︙ | |||
592 593 594 595 596 597 598 599 600 601 602 603 604 605 | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | + | (define (db:set-comment-for-run db run-id comment) (debug:print-info 11 "db:set-comment-for-run START run-id: " run-id " comment: " comment) (sqlite3:execute db "UPDATE runs SET comment=? WHERE id=?;" comment run-id) (debug:print-info 11 "db:set-comment-for-run END run-id: " run-id " comment: " comment)) ;; does not (obviously!) removed dependent data. But why not!!? (define (db:delete-run db run-id) (common:clear-caches) ;; don't trust caches after doing any deletion (sqlite3:execute db "DELETE FROM runs WHERE id=?;" run-id)) (define (db:update-run-event_time db run-id) (debug:print-info 11 "db:update-run-event_time START run-id: " run-id) (sqlite3:execute db "UPDATE runs SET event_time=strftime('%s','now') WHERE id=?;" run-id) (debug:print-info 11 "db:update-run-event_time END run-id: " run-id)) |
︙ | |||
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | + + | (begin (sqlite3:execute tdb "DELETE FROM test_steps;") (sqlite3:execute tdb "DELETE FROM test_data;") (sqlite3:finalize! tdb))))) ;; (define (db:delete-test-records db tdb test-id #!key (force #f)) (common:clear-caches) (if tdb (begin (sqlite3:execute tdb "DELETE FROM test_steps;") (sqlite3:execute tdb "DELETE FROM test_data;"))) ;; (sqlite3:execute db "DELETE FROM tests WHERE id=?;" test-id)) (if db (begin (sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" test-id) (sqlite3:execute db "DELETE FROM test_data WHERE test_id=?;" test-id) (if force (sqlite3:execute db "DELETE FROM tests WHERE id=?;" test-id) (sqlite3:execute db "UPDATE tests SET state='DELETED',status='n/a' WHERE id=?;" test-id))))) (define (db:delete-tests-for-run db run-id) (common:clear-caches) (sqlite3:execute db "DELETE FROM tests WHERE run_id=?;" run-id)) (define (db:delete-old-deleted-test-records db) (let ((targtime (- (current-seconds)(* 30 24 60 60)))) ;; one month in the past (sqlite3:execute db "DELETE FROM tests WHERE state='DELETED' AND event_time<?;" targtime))) ;; set tests with state currstate and status currstatus to newstate and newstatus |
︙ |
Modified megatest.scm from [f0f3da05f7] to [2bf02a0d8b].
︙ | |||
187 188 189 190 191 192 193 194 195 196 197 198 199 200 | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | + | "-lock" "-unlock" "-list-servers" ;; mist queries "-list-disks" "-list-targets" "-list-db-targets" "-show-runconfig" ;; queries "-test-paths" ;; get path(s) to a test, ordered by youngest first "-runall" ;; run all tests "-remove-runs" "-usequeue" "-rebuild-db" |
︙ | |||
347 348 349 350 351 352 353 354 355 356 357 358 359 360 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | + + + + | (let ((targets (common:get-runconfig-targets))) (print "Found "(length targets) " targets") (for-each (lambda (x) (print "[" x "]")) targets) (set! *didsomething* #t))) (if (args:get-arg "-show-runconfig") (begin (pp (hash-table->alist (open-run-close setup-env-defaults #f "runconfigs.config" #f #f change-env: #f))) (set! *didsomething* #t))) ;;====================================================================== ;; Remove old run(s) ;;====================================================================== ;; since several actions can be specified on the command line the removal ;; is done first |
︙ |
Modified runconfig.scm from [2fcfa8c039] to [e60c2bb3c8].
︙ | |||
8 9 10 11 12 13 14 | 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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + - - + + + + + + + + + + + - - - - - + + + + + + - + + - + + | (declare (unit runconfig)) (declare (uses common)) (include "common_records.scm") |
︙ |
Modified runs.scm from [ac5e3e62fc] to [fcf8110ccc].
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - - - - | (vector header res))) (define (runs:test-get-full-path test) (let* ((testname (db:test-get-testname test)) (itempath (db:test-get-item-path test))) (conc testname (if (equal? itempath "") "" (conc "(" itempath ")"))))) |
︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | + | ;; keyvals. ;; ;; test-names: Comma separated patterns same as test-patts but used in selection ;; of tests to run. The item portions are not respected. ;; FIXME: error out if /patt specified ;; (define (runs:run-tests target runname test-names test-patts user flags) (common:clear-caches) ;; clear all caches (let* ((db #f) (keys (cdb:remote-run db:get-keys #f)) (keyvallst (keys:target->keyval keys target)) (run-id (cdb:remote-run runs:register-run #f keys keyvallst runname "new" "n/a" user)) ;; test-name))) (deferred '()) ;; delay running these since they have a waiton clause ;; keepgoing is the defacto modality now, will add hit-n-run a bit later ;; (keepgoing (hash-table-ref/default flags "-keepgoing" #f)) |
︙ | |||
726 727 728 729 730 731 732 733 734 735 736 737 738 739 | 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | + | ;; action: ;; 'remove-runs ;; 'set-state-status ;; ;; NB// should pass in keys? ;; (define (runs:operate-on action runnamepatt testpatt #!key (state #f)(status #f)(new-state-status #f)) (common:clear-caches) ;; clear all caches (let* ((db #f) (keys (open-run-close db:get-keys db)) (rundat (open-run-close runs:get-runs-by-patt db keys runnamepatt)) (header (vector-ref rundat 0)) (runs (vector-ref rundat 1)) (states (if state (string-split state ",") '())) (statuses (if status (string-split status ",") '())) |
︙ |