Changes In Branch subtest-rollup Through [c7517d9a4c] Excluding Merge-Ins
This is equivalent to a diff from 5411a1be29 to c7517d9a4c
2011-05-14
| ||
18:09 | Merging subtest-rollup to trunk check-in: 00761e1112 user: matt tags: trunk, v1.06 | |
2011-05-13
| ||
00:01 | Added some of the commandline params and switches to the documentation. Bumped version to 1.06 check-in: 79713f34cb user: matt tags: subtest-rollup | |
2011-05-12
| ||
23:59 | Added setting the rundir field in the top test for iterated tests. Added MT_MEGATEST variable to make it easier to write tests and find the megatest executable check-in: c7517d9a4c user: matt tags: subtest-rollup | |
00:04 | Bumped version to 1.05 check-in: 1ee4c5753c user: matt tags: subtest-rollup | |
00:03 | Implemented parent tests for multipart tests, PASS and FAIL counts and net status are rolled up for tests check-in: 77871638c9 user: matt tags: subtest-rollup | |
2011-05-11
| ||
13:32 | Added blanking out the comment on reseting a test check-in: 5411a1be29 user: mrwellan tags: trunk | |
07:59 | Added proper cleanup after removing a run. test dirs and run dir are removed if empty check-in: 79c34d7700 user: matt tags: trunk | |
Modified db.scm from [3bc7d64bed] to [b69aff6aa1].
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 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 69 70 71 72 73 | + + - - + + + | fieldstr (if havekeys "," "") "runname TEXT," "state TEXT DEFAULT ''," "status TEXT DEFAULT ''," "owner TEXT DEFAULT ''," "event_time TIMESTAMP," "comment TEXT DEFAULT ''," "fail_count INTEGER DEFAULT 0," "pass_count INTEGER DEFAULT 0," "CONSTRAINT runsconstraint UNIQUE (runname" (if havekeys "," "") keystr "));")) (sqlite3:execute db (conc "CREATE INDEX runs_index ON runs (runname" (if havekeys "," "") keystr ");")) (sqlite3:execute db "CREATE TABLE tests (id INTEGER PRIMARY KEY, run_id INTEGER, testname TEXT, |
︙ | |||
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | + + + + + + + + + | ;; (define (db:test-set-comment db run-id testname item-path comment) (sqlite3:execute db "UPDATE tests SET comment=? WHERE run_id=? AND testname=? AND item_path=?;" comment run-id testname item-path)) ;; (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)) ;;====================================================================== ;; Steps ;;====================================================================== ;; Run steps ;; make-vector-record "Run steps" db step id test_id stepname step_complete step_pass event_time (define (make-db:step)(make-vector 6)) (define-inline (db:step-get-id vec) (vector-ref vec 0)) (define-inline (db:step-get-test_id vec) (vector-ref vec 1)) (define-inline (db:step-get-stepname vec) (vector-ref vec 2)) (define-inline (db:step-get-state vec) (vector-ref vec 3)) |
︙ |
Modified launch.scm from [6d04cfa4b6] to [4e0072fb2a].
︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | + + + + + - - + + + - + + + - + + | (runname (db-get-value-by-header (db:get-row run-info) (db:get-header run-info) "runname")) (key-vals (get-key-vals db run-id)) (key-str (string-intersperse key-vals "/")) (dfullp (conc disk-path "/" key-str "/" runname "/" testname item-path)) (toptest-path (conc disk-path "/" key-str "/" runname "/" testname)) (runsdir (config-lookup *configdat* "setup" "runsdir")) (lnkpath (conc (if runsdir runsdir (conc *toppath* "/runs")) "/" key-str "/" runname item-path))) ;; since this is an iterated test this is as good a place as any to ;; update the toptest record with its location rundir (if (not (equal? item-path "")) (db:test-set-rundir! db run-id testname "" toptest-path)) (print "Setting up test run area") (print " - creating run area in " dfullp) (system (conc "mkdir -p " dfullp)) (print " - creating link from " dfullp "/" testname " to " lnkpath) (system (conc "mkdir -p " lnkpath)) (if (file-exists? (conc lnkpath "/" testname)) (system (conc "rm -f " lnkpath "/" testname))) (system (conc "ln -sf " dfullp " " lnkpath "/" testname)) (if (directory? dfullp) (begin (system (conc "rsync -av " test-path "/ " dfullp "/")) |
︙ |
Modified megatest.scm from [1850c2555e] to [cd37504c15].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + | ;; Copyright 2006-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (include "common.scm") |
︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | + | Run status updates (these require that you are in a test directory and you have sourced the \"megatest.csh\" or \"megatest.sh\" file.) -step stepname -test-status : set the state and status of a test (use :state and :status) -setlog logfname : set the path/filename to the final log relative to the test directory. may be used with -test-status -set-toplog logfname : set the overall log for a suite of sub-tests -m comment : insert a comment for this test Run data :runname : required, name for this particular test run :state : required if updating step state; e.g. start, end, completed :status : required if updating step status; e.g. pass, fail, n/a |
︙ | |||
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | + | ":runname" ":state" ":status" "-list-runs" "-testpatt" "-itempatt" "-setlog" "-set-toplog" "-runstep" "-logpro" "-m" ) (list "-h" "-force" "-xterm" |
︙ | |||
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | + + + | (work-area (assoc/default 'work-area cmdinfo)) (test-name (assoc/default 'test-name cmdinfo)) (runscript (assoc/default 'runscript cmdinfo)) (db-host (assoc/default 'db-host cmdinfo)) (run-id (assoc/default 'run-id cmdinfo)) (itemdat (assoc/default 'itemdat cmdinfo)) (runname (assoc/default 'runname cmdinfo)) (megatest (assoc/default 'megatest cmdinfo)) (mt-bindir-path (assoc/default 'mt-bindir-path cmdinfo)) (fullrunscript (conc testpath "/" runscript)) (db #f)) (print "Exectuing " test-name " on " (get-host-name)) (change-directory testpath) (setenv "MT_TEST_RUN_DIR" work-area) (setenv "MT_TEST_NAME" test-name) (setenv "MT_ITEM_INFO" (conc itemdat)) (setenv "MT_RUNNAME" runname) (setenv "MT_MEGATEST" megatest) (setenv "PATH" (conc (getenv "PATH") ":" mt-bindir-path)) (if (not (setup-for-run)) (begin (print "Failed to setup, exiting") (exit 1))) ;; now can find our db (set! db (open-db)) (change-directory work-area) |
︙ | |||
443 444 445 446 447 448 449 450 451 452 453 454 455 456 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | + | (begin (print "ERROR: You must specify :state and :status with every call to -step") (exit 6))) (sqlite3:finalize! db) (set! *didsomething* #t)))) (if (or (args:get-arg "-setlog") ;; since setting up is so costly lets piggyback on -test-status (args:get-arg "-set-toplog") (args:get-arg "-test-status") (args:get-arg "-runstep")) (if (not (getenv "MT_CMDINFO")) (begin (print "ERROR: MT_CMDINFO env var not set, commands -test-status, -runstep and -setlog must be called *inside* a megatest environment!") (exit 5)) (let* ((startingdir (current-directory)) |
︙ | |||
468 469 470 471 472 473 474 475 476 477 478 479 480 481 | 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | + + | (if (not (setup-for-run)) (begin (print "Failed to setup, exiting") (exit 1))) (set! db (open-db)) (if (args:get-arg "-setlog") (test-set-log! db run-id test-name itemdat (args:get-arg "-setlog"))) (if (args:get-arg "-set-toplog") (test-set-toplog! db run-id test-name (args:get-arg "-set-toplog"))) (if (args:get-arg "-test-status") (test-set-status! db run-id test-name state status itemdat (args:get-arg "-m")) (if (and state status) (if (not (args:get-arg "-setlog")) (begin (print "ERROR: You must specify :state and :status with every call to -test-status\n" help) (sqlite3:finalize! db) |
︙ |
Modified runs.scm from [243bc1392b] to [482f7844a7].
︙ | |||
72 73 74 75 76 77 78 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + | (set! res (cons (list->vector (cons a r)) res))) db (conc "SELECT " keystr " FROM runs WHERE runname like ? " key-patt ";") runnamepatt) (vector header res))) (define (register-test db run-id test-name item-path) (let ((item-paths (if (equal? item-path "") (list item-path) (list item-path "")))) (for-each (lambda (pth) |
︙ |
Modified tests/tests/runfirst/main.sh from [62fd7b991d] to [75fea8b10f].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 | - + - + | #!/bin/bash # megatest -step wasting_time :state start :status n/a -m "This is a test step comment" # sleep 20 # megatest -step wasting_time :state end :status $? |