Comment: | Merged with latest and run tab fix |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | db-new |
Files: | files | file ages | folders |
SHA1: |
28bf2c1d250f4dd622886963e1a8265d |
User & Date: | ritikaag on 2016-10-27 15:13:37 |
Other Links: | branch diff | manifest | tags |
2016-11-14
| ||
10:36 | Fixed spelling and added comment check-in: 3438d7c75e user: mrwellan tags: db-new | |
2016-10-27
| ||
15:13 | Merged with latest and run tab fix check-in: 28bf2c1d25 user: ritikaag tags: db-new | |
2016-10-25
| ||
10:37 | Updated plans check-in: c449bba35a user: mrwellan tags: v1.62 | |
2016-10-18
| ||
15:15 | Create new branch named "db-new" check-in: 049fdd2534 user: ritikaag tags: db-new | |
Modified common.scm from [8514527bdb] to [87c3dc36b9].
︙ | ︙ | |||
358 359 360 361 362 363 364 | (define (assoc/default key lst . default) (let ((res (assoc key lst))) (if res (cadr res)(if (null? default) #f (car default))))) (define (common:get-testsuite-name) (or (configf:lookup *configdat* "setup" "testsuite" ) | > | > | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | (define (assoc/default key lst . default) (let ((res (assoc key lst))) (if res (cadr res)(if (null? default) #f (car default))))) (define (common:get-testsuite-name) (or (configf:lookup *configdat* "setup" "testsuite" ) (if *toppath* (pathname-file *toppath*) (pathname-file (current-directory))))) ;;====================================================================== ;; E X I T H A N D L I N G ;;====================================================================== (define (common:legacy-sync-recommended) (or (args:get-arg "-runtests") |
︙ | ︙ | |||
617 618 619 620 621 622 623 624 625 626 627 628 629 630 | (hed (car inlst)) (tal (cdr inlst))) (if (not (null? tal)) (loop (max hed max-val) (car tal) (cdr tal)) (max hed max-val)))) ;; path list to hash-table tree ;; ((a b c)(a b d)(e b c)) => ((a (b (d) (c))) (e (b (c)))) ;; (define (common:list->htree lst) (let ((resh (make-hash-table))) (for-each | > > > > > > > > > > | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | (hed (car inlst)) (tal (cdr inlst))) (if (not (null? tal)) (loop (max hed max-val) (car tal) (cdr tal)) (max hed max-val)))) ;; get min or max, use > for max and < for min, this works around the limits on apply ;; (define (common:min-max comp lst) (if (null? lst) #f ;; better than an exception for my needs (fold (lambda (a b) (if (comp a b) a b)) (car lst) lst))) ;; path list to hash-table tree ;; ((a b c)(a b d)(e b c)) => ((a (b (d) (c))) (e (b (c)))) ;; (define (common:list->htree lst) (let ((resh (make-hash-table))) (for-each |
︙ | ︙ |
Modified dashboard.scm from [6bac3ad2ce] to [5cca40df4a].
︙ | ︙ | |||
1257 1258 1259 1260 1261 1262 1263 | (lambda () (if b (dboard:tabdat-target-set! tabdat (string-split b "/"))) (dashboard:update-run-command tabdat)) "command-testname-selector tb action")) #:value (dboard:test-patt->lines (dboard:tabdat-test-patts-use tabdat)) #:expand "HORIZONTAL" | < > | 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 | (lambda () (if b (dboard:tabdat-target-set! tabdat (string-split b "/"))) (dashboard:update-run-command tabdat)) "command-testname-selector tb action")) #:value (dboard:test-patt->lines (dboard:tabdat-test-patts-use tabdat)) #:expand "HORIZONTAL" )) (tb (iup:treebox #:value 0 #:name "Runs" #:expand "YES" #:addexpanded "NO" #:size "10x" #:selection-cb (lambda (obj id state) (debug:catch-and-dump (lambda () (let* ((run-path (tree:node->path obj id)) (run-id (tree-path->run-id tabdat (cdr run-path)))) ;; (dboard:tabdat-view-changed-set! tabdat #t) ;; ?? done below when run-id is a number |
︙ | ︙ | |||
1446 1447 1448 1449 1450 1451 1452 | (dboard:graph-dat-flag-set! graph-dat #t))) (hash-table-keys (dboard:tabdat-graph-cell-table tabdat)))))) (iup:hbox (iup:button "Hide All" #:action (lambda (obj) (for-each (lambda (graph-cell) (let* ((graph-dat (hash-table-ref (dboard:tabdat-graph-cell-table tabdat) graph-cell))) (dboard:graph-dat-flag-set! graph-dat #f))) | | > | 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | (dboard:graph-dat-flag-set! graph-dat #t))) (hash-table-keys (dboard:tabdat-graph-cell-table tabdat)))))) (iup:hbox (iup:button "Hide All" #:action (lambda (obj) (for-each (lambda (graph-cell) (let* ((graph-dat (hash-table-ref (dboard:tabdat-graph-cell-table tabdat) graph-cell))) (dboard:graph-dat-flag-set! graph-dat #f))) (hash-table-keys (dboard:tabdat-graph-cell-table tabdat))) (dboard:tabdat-view-changed-set! tabdat #t))))) )))) ;;====================================================================== ;; R U N ;;====================================================================== ;; ;; display and manage a single run at a time |
︙ | ︙ | |||
2446 2447 2448 2449 2450 2451 2452 | (iup:show (iup:dialog #:title (conc "Megatest dashboard " (current-user-name) ":" *toppath*) #:menu (dcommon:main-menu) (let* ((runs-view (iup:vbox (iup:split #:orientation "VERTICAL" ;; "HORIZONTAL" | | | | | | | | | | | 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 | (iup:show (iup:dialog #:title (conc "Megatest dashboard " (current-user-name) ":" *toppath*) #:menu (dcommon:main-menu) (let* ((runs-view (iup:vbox (iup:split #:orientation "VERTICAL" ;; "HORIZONTAL" #:value 200 (dboard:runs-tree-browser commondat runs-dat) (iup:split ;; left most block, including row names (apply iup:vbox lftlst) ;; right hand block, including cells (iup:vbox ;; the header (apply iup:hbox (reverse hdrlst)) (apply iup:hbox (reverse bdylst))))) controls )) (views-cfgdat (common:load-views-config)) (additional-tabnames '()) (tab-start-num 5) ;; DON'T FORGET TO UPDATE THIS WHEN CHANGING THE STANDARD TABS BELOW ;; (data (dboard:tabdat-init (make-d:data))) (additional-views ;; process views-dat |
︙ | ︙ | |||
2567 2568 2569 2570 2571 2572 2573 | (define (dashboard:get-youngest-run-db-mod-time tabdat) (handle-exceptions exn (begin (debug:print 0 *default-log-port* "WARNING: error in accessing databases in get-youngest-run-db-mod-time: " ((condition-property-accessor 'exn 'message) exn)) (current-seconds)) ;; something went wrong - just print an error and return current-seconds | | | 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 | (define (dashboard:get-youngest-run-db-mod-time tabdat) (handle-exceptions exn (begin (debug:print 0 *default-log-port* "WARNING: error in accessing databases in get-youngest-run-db-mod-time: " ((condition-property-accessor 'exn 'message) exn)) (current-seconds)) ;; something went wrong - just print an error and return current-seconds (common:max (map (lambda (filen) (file-modification-time filen)) (glob (conc (dboard:tabdat-dbdir tabdat) "/*.db")))))) (define (dashboard:monitor-changed? commondat tabdat) (let* ((run-update-time (current-seconds)) (monitor-db-path (dboard:tabdat-monitor-db-path tabdat)) (monitor-modtime (if (and monitor-db-path (file-exists? monitor-db-path)) |
︙ | ︙ | |||
2644 2645 2646 2647 2648 2649 2650 | (hash-table-set! rowhash (+ i rownum) (cons (cons x1 x2) (hash-table-ref/default rowhash (+ i rownum) '()))) (if (< i num-rows) (loop (+ i 1))))) | < < < < < < < < < < | 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 | (hash-table-set! rowhash (+ i rownum) (cons (cons x1 x2) (hash-table-ref/default rowhash (+ i rownum) '()))) (if (< i num-rows) (loop (+ i 1))))) ;; sort a list of test-ids by the event _time using a hash table of id => testdat ;; (define-inline (dboard:sort-testsdat-by-event-time test-ids tests-ht) (sort test-ids (lambda (a b) (< (db:test-get-event_time (hash-table-ref tests-ht a)) (db:test-get-event_time (hash-table-ref tests-ht b)))))) |
︙ | ︙ | |||
2768 2769 2770 2771 2772 2773 2774 2775 | (list? (dboard:tabdat-target tabdat)) (not (null? (dboard:tabdat-target tabdat)))) (last (dboard:tabdat-target tabdat)) "%")) (testpatt (or (dboard:tabdat-test-patts tabdat) "%")) (filtrstr (conc targpatt "/" runpatt "/" testpatt))) ;; (print "targpatt: " targpatt " runpatt: " runpatt " testpatt: " testpatt) | > | > | 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 | (list? (dboard:tabdat-target tabdat)) (not (null? (dboard:tabdat-target tabdat)))) (last (dboard:tabdat-target tabdat)) "%")) (testpatt (or (dboard:tabdat-test-patts tabdat) "%")) (filtrstr (conc targpatt "/" runpatt "/" testpatt))) ;; (print "targpatt: " targpatt " runpatt: " runpatt " testpatt: " testpatt) (print "RA => dboard:tabdat-last-filter-str " dboard:tabdat-last-filter-str "filtrstr" filtrstr "dboard:tabdat-view-changed" (dboard:tabdat-view-changed tabdat)) (if (or (not (equal? (dboard:tabdat-last-filter-str tabdat) filtrstr)) (dboard:tabdat-view-changed tabdat)) (let ((dwg (dboard:tabdat-drawing tabdat))) (print "reseting drawing") (dboard:tabdat-layout-update-ok-set! tabdat #f) (vg:drawing-libs-set! dwg (make-hash-table)) (vg:drawing-insts-set! dwg (make-hash-table)) (vg:drawing-cache-set! dwg '()) (dboard:tabdat-allruns-by-id-set! tabdat (make-hash-table)) |
︙ | ︙ | |||
2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 | (if (and cnv dwg vch) (begin (vg:drawing-xoff-set! dwg (dboard:tabdat-xadj tabdat)) (vg:drawing-yoff-set! dwg (dboard:tabdat-yadj tabdat)) (mutex-lock! mtx) (canvas-clear! cnv) (vg:draw dwg tabdat) (mutex-unlock! mtx) (dboard:tabdat-view-changed-set! tabdat #f))))) ;; doesn't work. ;; ;;(define (gotoescape tabdat escape) ;; (or (dboard:tabdat-layout-update-ok tabdat) ;; (escape #t))) | > > | 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 | (if (and cnv dwg vch) (begin (vg:drawing-xoff-set! dwg (dboard:tabdat-xadj tabdat)) (vg:drawing-yoff-set! dwg (dboard:tabdat-yadj tabdat)) (mutex-lock! mtx) (canvas-clear! cnv) (vg:draw dwg tabdat) ;; RA => (dashboard:run-times-tab-run-data-updater commondat tabdat tab-num) (mutex-unlock! mtx) (print "RA => View changed found to be set" ) (dboard:tabdat-view-changed-set! tabdat #f))))) ;; doesn't work. ;; ;;(define (gotoescape tabdat escape) ;; (or (dboard:tabdat-layout-update-ok tabdat) ;; (escape #t))) |
︙ | ︙ | |||
3078 3079 3080 3081 3082 3083 3084 | (dboard:rundat-hierdat rundat))) (tests-ht (dboard:rundat-tests rundat)) (all-tids (hash-table-keys tests-ht)) ;; (apply append hierdat)) ;; was testsdat (testsdat (hash-table-values tests-ht)) (runcomp (vg:comp-new));; new component for this run (rows-used (make-hash-table)) ;; keep track of what parts of the rows are used here row1 = (obj1 obj2 ...) ;; (row-height 4) | | | | 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 | (dboard:rundat-hierdat rundat))) (tests-ht (dboard:rundat-tests rundat)) (all-tids (hash-table-keys tests-ht)) ;; (apply append hierdat)) ;; was testsdat (testsdat (hash-table-values tests-ht)) (runcomp (vg:comp-new));; new component for this run (rows-used (make-hash-table)) ;; keep track of what parts of the rows are used here row1 = (obj1 obj2 ...) ;; (row-height 4) (run-start (common:min-max < (map db:test-get-event_time testsdat))) (run-end (let ((re (common:min-max > (map (lambda (t)(+ (db:test-get-event_time t)(db:test-get-run_duration t))) testsdat)))) (max re (+ 1 run-start)))) ;; use run-start+1 if run-start == run-end so delta is not zero (timeoffset (- run-start)) ;; (+ fixed-originx canvas-margin) run-start)) (run-duration (- run-end run-start)) (timescale (/ (- sizex (* 2 canvas-margin)) (if (> run-duration 0) run-duration (current-seconds)))) ;; a least lously guess |
︙ | ︙ |
Modified dcommon.scm from [adcc5f42ce] to [eb6ea73393].
︙ | ︙ | |||
214 215 216 217 218 219 220 | ;; (iup:attribute-set! tb (conc "COLOR" node-num) color) ) (hash-table-set! (dboard:tabdat-path-test-ids data) test-path test-id) (if (not rownum) (let ((rownums (hash-table-values testname-to-row))) (set! rownum (if (null? rownums) 1 | | | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | ;; (iup:attribute-set! tb (conc "COLOR" node-num) color) ) (hash-table-set! (dboard:tabdat-path-test-ids data) test-path test-id) (if (not rownum) (let ((rownums (hash-table-values testname-to-row))) (set! rownum (if (null? rownums) 1 (+ 1 (common:max rownums)))) (hash-table-set! testname-to-row fullname rownum) ;; create the label (set! changed (dcommon:modifiy-if-different (dboard:tabdat-runs-matrix data) (conc rownum ":" 0) dispname changed)) |
︙ | ︙ | |||
266 267 268 269 270 271 272 | (define (dcommon:runsdat-get-col-num dat target runname force-set) (let* ((runs-index (dboard:runsdat-runs-index dat)) (col-name (conc target "/" runname)) (res (hash-table-ref/default runs-index col-name #f))) (if res res (if force-set | | | | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | (define (dcommon:runsdat-get-col-num dat target runname force-set) (let* ((runs-index (dboard:runsdat-runs-index dat)) (col-name (conc target "/" runname)) (res (hash-table-ref/default runs-index col-name #f))) (if res res (if force-set (let ((max-col-num (+ 1 (common:max (cons-1 (hash-table-values runs-index)))))) (hash-table-set! runs-index col-name max-col-num) max-col-num))))) (define (dcommon:runsdat-get-row-num dat testname itempath force-set) (let* ((tests-index (dboard:runsdat-runs-index dat)) (row-name (conc testname "/" itempath)) (res (hash-table-ref/default runs-index row-name #f))) (if res res (if force-set (let ((max-row-num (+ 1 (common:max (cons -1 (hash-table-values tests-index)))))) (hash-table-set! runs-index row-name max-row-num) max-row-num))))) (define (dcommon:rundat-copy-tests-to-by-name rundat) (let ((src-ht (dboard:rundat-tests rundat)) (trg-ht (dboard:rundat-tests-by-name rundat))) (if (and (hash-table? src-ht)(hash-table? trg-ht)) |
︙ | ︙ | |||
546 547 548 549 550 551 552 | (changed #f) (stats-updater (lambda () (if (dashboard:database-changed? commondat tabdat context-key: 'run-stats) (let* ((run-stats (rmt:get-run-stats)) (indices (common:sparse-list-generate-index run-stats)) ;; proc: set-cell)) (row-indices (car indices)) (col-indices (cadr indices)) | | | | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | (changed #f) (stats-updater (lambda () (if (dashboard:database-changed? commondat tabdat context-key: 'run-stats) (let* ((run-stats (rmt:get-run-stats)) (indices (common:sparse-list-generate-index run-stats)) ;; proc: set-cell)) (row-indices (car indices)) (col-indices (cadr indices)) (max-row (if (null? row-indices) 1 (common:max (map cadr row-indices)))) (max-col (if (null? col-indices) 1 (common:max (map cadr col-indices)))) (max-visible (max (- (dboard:tabdat-num-tests tabdat) 15) 3)) (max-col-vis (if (> max-col 10) 10 max-col)) (numrows 1) (numcols 1)) (iup:attribute-set! stats-matrix "CLEARVALUE" "CONTENTS") (iup:attribute-set! stats-matrix "NUMCOL" max-col ) (iup:attribute-set! stats-matrix "NUMLIN" (if (< max-row max-visible) max-visible max-row)) ;; min of 20 |
︙ | ︙ |
Modified docs/manual/Makefile from [a594ea8bc3] to [bf9f3b126b].
︙ | ︙ | |||
11 12 13 14 15 16 17 | # design_spec.html : $(SRCFILES) $(CSVFILES) # asciidoc -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 design_spec.txt # all : server.ps megatest_manual.html client.ps complex-itemmap.png | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # design_spec.html : $(SRCFILES) $(CSVFILES) # asciidoc -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 design_spec.txt # all : server.ps megatest_manual.html client.ps complex-itemmap.png megatest_manual.html : megatest_manual.txt getting_started.txt writing_tests.txt reference.txt ../plan.txt howto.txt installation.txt *png asciidoc -b html5 -a icons -a iconsdir=$(DISPATH)/images/icons -a toc2 megatest_manual.txt # dos2unix megatest_manual.html megatest.pdf : megatest_manual.txt getting_started.txt writing_tests.txt reference.txt ../plan.txt howto.txt *png a2x -a toc -f pdf megatest_manual.txt server.ps : server.dot |
︙ | ︙ |
Modified docs/manual/getting_started.txt from [d4e6b12deb] to [de12299551].
1 2 | Getting Started | < > | | < > > | | < | > | > > > > > | < | < < < < < < < < < < < < < < < < < < | | | | < < < < | < > > | | | < < < < < < > | | > > > > | > > > | < | < < | < < < | | | > > | > > > > > > | > > | > > > | > > > | > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 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 69 70 71 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 | Getting Started --------------- [partintro] .Getting started with Megatest -- Creating a testsuite or flow and your first test or task. -- After installing Megatest you can create a flow or testsuite and add some tests using the helpers. Here is a quickstart sequence to get you up and running your first automated testsuite. Creating a Megatest Area ~~~~~~~~~~~~~~~~~~~~~~~~ Choose Target Keys ^^^^^^^^^^^^^^^^^^ First choose your "target" keys. These are used to organise your runs in a way that is meaningful to your project. If you are unsure about what to use for keys just use a single generic key such as "RUNTYPE". These keys will be used to hand values to your tests via environment variables so ensure they are unique. Prefixing them with something such as PROJKEYS_ is a good strategy. Examples of keys: .Example keys [width="60%",options="header"] |============================================== | Option | Description | RELEASE/ITERATION | This example is used by Megatest for its internal QA. | ARCH/OS/RELEASE | For a software project targeting multiple platforms | UCTRLR/NODETYPE | Microcontroller project with different controllers running same software |============================================== Create Area Config Files ^^^^^^^^^^^^^^^^^^^^^^^^ You will need to choose locations for your runs (the data generated every time you run the testsuite) and link tree. For getting started answer the prompts with "runs" and "links". We use the Unix editor "vi" in the examples below but you can use any plain text editor. .Using the helper to create a Megatest area ------------------ megatest -create-megatest-area # optional: verify that the settings are ok vi megatest.config vi runconfigs.config ------------------ Creating a Test ~~~~~~~~~~~~~~~ Choose the test name for your first test and run the helper. You can edit the files after the initial creation. You will need to enter names and scripts for the steps to be run and then edit the tests/<testname>/testconfig file and modify the logpro rules to properly process the log output from your steps. For your first test just hit enter for the "waiton", "priority" and iteration variable prompts. Hint: for geting started make your logpro rules very liberal. expect:error patterns should match nothing and comment out expect:required rules. .Using the helper to create a Megatest test --------------- megatest -create-test myfirsttest # then edit the generated config vi tests/myfirsttest/testconfig --------------- Running your test ~~~~~~~~~~~~~~~~~ First choose a target and runname. If you have a two-place target such as RELEASE/ITERATION a target would look like v1.0/aff3 where v1.0 is the RELEASE and aff3 is the ITERATION. For a run name just use something like run1. .Running all tests (testpatt of "%" matches all tests) --------------- megatest -run -target v1.0/aff3 -runname run1 -testpatt % -log run1.log --------------- Viewing the results ~~~~~~~~~~~~~~~~~~~ Start the dashboard and browse your run in the "Runs" tab. .Starting dashboard ---------------- dashboard -rows 24 ---------------- |
Modified docs/manual/howto.txt from [8d66a8b9b7] to [b7c69b99ac].
1 2 | How To Do Things | < > < > < > < > < > < > | 1 2 3 4 5 6 7 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 | How To Do Things ---------------- Process Runs ~~~~~~~~~~~~ Remove Runs ^^^^^^^^^^^ From the dashboard click on the button (PASS/FAIL...) for one of the tests. From the test control panel that comes up push the clean test button. The command field will be prefilled with a template command for removing that test. You can edit the command, for example change the argument to -testpatt to "%" to remove all tests. .Remove the test diskperf and all it's items ---------------- megatest -remove-runs -target ubuntu/nfs/none -runname ww28.1a -testpatt diskperf/% -v ---------------- .Remove all tests for all runs and all targets ---------------- megatest -remove-runs -target %/%/% -runname % -testpatt % -v ---------------- Archive Runs ^^^^^^^^^^^^ Megatest supports using the bup backup tool (https://bup.github.io/) to archive your tests for efficient storage and retrieval. Archived data can be rapidly retrieved if needed. The metadata for the run (PASS/FAIL status, run durations, time stamps etc.) are all preserved in the megatest database. For setup information see the Archiving topic in the reference section of this manual. To Archive ++++++++++ Hint: use the test control panel to create a template command by pushing the "Archive Tests" button. .Archive a full run ---------------- megatest -target ubuntu/nfs/none -runname ww28.1a -archive save-remove -testpatt % ---------------- To Restore ++++++++++ .Retrieve a single test ---------------- megatest -target ubuntu/nfs/none -runname ww28.1a -archive restore -testpatt diskperf/% ---------------- Hint: You can browse the archive using bup commands directly. |
︙ | ︙ | |||
76 77 78 79 80 81 82 | launcher bsub # if defined and not "no" flexi-launcher will bypass launcher unless there is no # match. flexi-launcher yes ------------------------ Tricks | < > < > < < < | 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 | launcher bsub # if defined and not "no" flexi-launcher will bypass launcher unless there is no # match. flexi-launcher yes ------------------------ Tricks ------ This section is a compendium of a various useful tricks for debugging, configuring and generally getting the most out of Megatest. Limiting your running jobs ~~~~~~~~~~~~~~~~~~~~~~~~~~ The following example will limit a test in the jobgroup "group1" to no more than 10 tests simultaneously. In your testconfig: ---------------- [test_meta] jobgroup group1 ---------------- In your megatest.config: --------------- [jobgroups] group1 10 custdes 4 --------------- Debugging Tricks ---------------- Examining The Environment ~~~~~~~~~~~~~~~~~~~~~~~~~ |
︙ | ︙ |
Added docs/manual/installation.txt version [6d6c5f2d2a].
> > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 | Installation ------------ Dependencies ~~~~~~~~~~~~ Chicken scheme and a number of "eggs" are required for building Megatest. See the script installall.sh in the utils directory of the source distribution for an automated way to install everything needed for building Megatest on Linux. |
Modified docs/manual/megatest_manual.html from [360970d205] to [2d6199dc08].
1 2 3 4 | <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | | | 1 2 3 4 5 6 7 8 9 10 11 12 | <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="generator" content="AsciiDoc 8.6.7"> <title>The Megatest Users Manual</title> <style type="text/css"> /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ /* Default font. */ body { font-family: Georgia,serif; |
︙ | ︙ | |||
82 83 84 85 86 87 88 | ul, ol, li > p { margin-top: 0; } ul > li { color: #aaa; } ul > li > * { color: black; } | | < < < < < < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | ul, ol, li > p { margin-top: 0; } ul > li { color: #aaa; } ul > li > * { color: black; } pre { padding: 0; margin: 0; } #author { color: #527bbd; font-weight: bold; font-size: 1.1em; } #email { |
︙ | ︙ | |||
220 221 222 223 224 225 226 | div.exampleblock > div.content { border-left: 3px solid #dddddd; padding-left: 0.5em; } div.imageblock div.content { padding-left: 0; } | | | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | div.exampleblock > div.content { border-left: 3px solid #dddddd; padding-left: 0.5em; } div.imageblock div.content { padding-left: 0; } span.image img { border-style: none; } a.image:visited { color: white; } dl { margin-top: 0.8em; margin-bottom: 0.8em; } dt { |
︙ | ︙ | |||
415 416 417 418 419 420 421 422 423 424 425 426 427 428 | div.unbreakable { page-break-inside: avoid; } /* * xhtml11 specific * * */ div.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } div.tableblock > table { border: 3px solid #527bbd; | > > > > > > | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | div.unbreakable { page-break-inside: avoid; } /* * xhtml11 specific * * */ tt { font-family: "Courier New", Courier, monospace; font-size: inherit; color: navy; } div.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } div.tableblock > table { border: 3px solid #527bbd; |
︙ | ︙ | |||
448 449 450 451 452 453 454 455 456 457 458 459 460 461 | } /* * html5 specific * * */ table.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } thead, p.tableblock.header { font-weight: bold; | > > > > > > | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | } /* * html5 specific * * */ .monospaced { font-family: "Courier New", Courier, monospace; font-size: inherit; color: navy; } table.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } thead, p.tableblock.header { font-weight: bold; |
︙ | ︙ | |||
528 529 530 531 532 533 534 | body.manpage div.sectionbody { margin-left: 3em; } @media print { body.manpage div#toc { display: none; } } | < < | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | body.manpage div.sectionbody { margin-left: 3em; } @media print { body.manpage div#toc { display: none; } } @media screen { body { max-width: 50em; /* approximately 80 characters wide */ margin-left: 16em; } #toc { |
︙ | ︙ | |||
777 778 779 780 781 782 783 | </div> </div> <div id="content"> <div class="sect1"> <h2 id="_preface">Preface</h2> <div class="sectionbody"> <div class="paragraph"><p>This book is organised as three sub-books; getting started, writing tests and reference.</p></div> | > > | | > > | | > | 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 | </div> </div> <div id="content"> <div class="sect1"> <h2 id="_preface">Preface</h2> <div class="sectionbody"> <div class="paragraph"><p>This book is organised as three sub-books; getting started, writing tests and reference.</p></div> </div> </div> <div class="sect1"> <h2 id="_why_megatest">Why Megatest?</h2> <div class="sectionbody"> <div class="paragraph"><p>The Megatest project was started for two reasons, the first was an immediate and pressing need for a generalized tool to manage a suite of regression tests and the second was the fact that the author had written or maintained several such tools at different companies over the years and it seemed a good thing to have a single open source tool, flexible enough to meet the needs of any team doing continuous integrating and or running a complex suite of tests for release qualification.</p></div> </div> </div> <div class="sect1"> <h2 id="_megatest_design_philosophy">Megatest Design Philosophy</h2> <div class="sectionbody"> <div class="paragraph"><p>Megatest is intended to provide the minimum needed resources to make writing a suite of tests and tasks for implementing continuous build for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test or task. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide |
︙ | ︙ | |||
840 841 842 843 844 845 846 | <li> <p> Deployable - anyone on the team, at any site, at any time can run the flow </p> </li> </ul></div> </div> | > | | > | | > | | > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 | <li> <p> Deployable - anyone on the team, at any site, at any time can run the flow </p> </li> </ul></div> </div> </div> <div class="sect1"> <h2 id="_megatest_architecture">Megatest Architecture</h2> <div class="sectionbody"> <div class="paragraph"><p>All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to call home to your master sqlite3 database.</p></div> </div> </div> <div class="sect1"> <h2 id="_road_map">Road Map</h2> <div class="sectionbody"> <div class="paragraph"><p>Note 1: This road-map is still evolving and subject to change without notice.</p></div> <div class="sect2"> <h3 id="_architecture_refactor">Architecture Refactor</h3> <div class="sect3"> <h4 id="_goals">Goals</h4> <div class="olist arabic"><ol class="arabic"> <li> <p> Reduce load on the file system. Sqlite3 files on network filesystem can be a burden. </p> </li> <li> <p> Reduce number of servers and frequency of start/stop. This is mostly an issue of clutter but also a reduction in "moving parts". </p> </li> <li> <p> Coalesce activities to a single home host where possible. Give the user feedback that they have started the dashboard on a host other than the home host. </p> </li> <li> <p> Reduce number of processes involved in managing running tests. </p> </li> </ol></div> </div> <div class="sect3"> <h4 id="_changes_needed">Changes Needed</h4> <div class="olist arabic"><ol class="arabic"> <li> <p> ACID compliant db will be on /tmp and synced to megatest.db with a five second max delay. </p> </li> <li> <p> Read/writes to db for processes on homehost will go direct to /tmp megatest.db file. </p> </li> <li> <p> Read/wites fron non-homehost processes will go through one server. Bulk reads (e.g. for dashboard or list-runs) will be cached on the current host in /tmp and synced from the home megatest.db in the testsuite area. </p> </li> <li> <p> Db syncs rely on the target db file timestame minus some margin. </p> </li> <li> <p> Since bulk reads do not use the server we can switch to simple RPC for the network transport. </p> </li> <li> <p> Test running manager process extended to manage multiple running tests. </p> </li> </ol></div> </div> </div> <div class="sect2"> <h3 id="_current_items">Current Items</h3> <div class="sect3"> <h4 id="_ww05_migrate_to_inmem_db">ww05 - migrate to inmem-db</h4> <div class="olist arabic"><ol class="arabic"> <li> <p> Switch to inmem db with fast sync to on disk db’s [DONE] </p> </li> <li> |
︙ | ︙ | |||
889 890 891 892 893 894 895 896 897 898 | <p> Task table used for queueing runner actions (remove runs, cleanRunExecute, etc) </p> </li> </ol></div> </li> </ol></div> </div> </div> </div> | > < < < < < | | | | > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | <p> Task table used for queueing runner actions (remove runs, cleanRunExecute, etc) </p> </li> </ol></div> </li> </ol></div> <div class="paragraph"><p>shifting, note that the preceding blank line is needed.</p></div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_installation">Installation</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_dependencies">Dependencies</h3> <div class="paragraph"><p>Chicken scheme and a number of "eggs" are required for building Megatest. See the script installall.sh in the utils directory of the source distribution for an automated way to install everything needed for building Megatest on Linux.</p></div> </div> </div> </div> <div class="sect1"> <h2 id="_getting_started">Getting Started</h2> <div class="sectionbody"> <div class="openblock"> <div class="title">Getting started with Megatest</div> <div class="content"> <div class="paragraph"><p>Creating a testsuite or flow and your first test or task.</p></div> </div></div> <div class="paragraph"><p>After installing Megatest you can create a flow or testsuite and add some tests using the helpers. Here is a quickstart sequence to get you up and running your first automated testsuite.</p></div> <div class="sect2"> <h3 id="_creating_a_megatest_area">Creating a Megatest Area</h3> <div class="sect3"> <h4 id="_choose_target_keys">Choose Target Keys</h4> <div class="paragraph"><p>First choose your "target" keys. These are used to organise your runs in a way that is meaningful to your project. If you are unsure about what to use for keys just use a single generic key such as "RUNTYPE". These keys will be used to hand values to your tests via environment variables so ensure they are unique. Prefixing them with something such as PROJKEYS_ is a good strategy.</p></div> <div class="paragraph"><p>Examples of keys:</p></div> <table class="tableblock frame-all grid-all" style=" width:60%; "> <caption class="title">Table 1. Example keys</caption> <col style="width:50%;"> <col style="width:50%;"> <thead> <tr> <th class="tableblock halign-left valign-top" > Option </th> <th class="tableblock halign-left valign-top" > Description</th> </tr> </thead> <tbody> <tr> <td class="tableblock halign-left valign-top" ><p class="tableblock">RELEASE/ITERATION</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock">This example is used by Megatest for its internal QA.</p></td> </tr> <tr> <td class="tableblock halign-left valign-top" ><p class="tableblock">ARCH/OS/RELEASE</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock">For a software project targeting multiple platforms</p></td> </tr> <tr> <td class="tableblock halign-left valign-top" ><p class="tableblock">UCTRLR/NODETYPE</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock">Microcontroller project with different controllers running same software</p></td> </tr> </tbody> </table> </div> <div class="sect3"> <h4 id="_create_area_config_files">Create Area Config Files</h4> <div class="paragraph"><p>You will need to choose locations for your runs (the data generated every time you run the testsuite) and link tree. For getting started answer the prompts with "runs" and "links". We use the Unix editor "vi" in the examples below but you can use any plain text editor.</p></div> <div class="listingblock"> <div class="title">Using the helper to create a Megatest area</div> <div class="content monospaced"> <pre>megatest -create-megatest-area # optional: verify that the settings are ok vi megatest.config vi runconfigs.config</pre> </div></div> </div> </div> <div class="sect2"> <h3 id="_creating_a_test">Creating a Test</h3> <div class="paragraph"><p>Choose the test name for your first test and run the helper. You can edit the files after the initial creation. You will need to enter names and scripts for the steps to be run and then edit the tests/<testname>/testconfig file and modify the logpro rules to properly process the log output from your steps. For your first test just hit enter for the "waiton", "priority" and iteration variable prompts.</p></div> <div class="paragraph"><p>Hint: for geting started make your logpro rules very liberal. expect:error patterns should match nothing and comment out expect:required rules.</p></div> <div class="listingblock"> <div class="title">Using the helper to create a Megatest test</div> <div class="content monospaced"> <pre>megatest -create-test myfirsttest # then edit the generated config vi tests/myfirsttest/testconfig</pre> </div></div> </div> <div class="sect2"> <h3 id="_running_your_test">Running your test</h3> <div class="paragraph"><p>First choose a target and runname. If you have a two-place target such as RELEASE/ITERATION a target would look like v1.0/aff3 where v1.0 is the RELEASE and aff3 is the ITERATION. For a run name just use something like run1.</p></div> <div class="listingblock"> <div class="title">Running all tests (testpatt of "%" matches all tests)</div> <div class="content monospaced"> <pre>megatest -run -target v1.0/aff3 -runname run1 -testpatt % -log run1.log</pre> </div></div> </div> <div class="sect2"> <h3 id="_viewing_the_results">Viewing the results</h3> <div class="paragraph"><p>Start the dashboard and browse your run in the "Runs" tab.</p></div> <div class="listingblock"> <div class="title">Starting dashboard</div> <div class="content monospaced"> <pre>dashboard -rows 24</pre> </div></div> </div> </div> </div> <div class="sect1"> <h2 id="_writing_tests">Writing Tests</h2> <div class="sectionbody"> <div class="sect2"> |
︙ | ︙ | |||
950 951 952 953 954 955 956 | </div></div> <div class="paragraph"><p>This test runs a single step called "stepname1" which runs a script "stepname.sh". Note that although it is common to put the actions needed for a test step into a script it is not necessary.</p></div> </div> </div> </div> | > | | < | > | | | | | | | | > | 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | </div></div> <div class="paragraph"><p>This test runs a single step called "stepname1" which runs a script "stepname.sh". Note that although it is common to put the actions needed for a test step into a script it is not necessary.</p></div> </div> </div> </div> <div class="sect1"> <h2 id="_how_to_do_things">How To Do Things</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_process_runs">Process Runs</h3> <div class="sect3"> <h4 id="_remove_runs">Remove Runs</h4> <div class="paragraph"><p>From the dashboard click on the button (PASS/FAIL…) for one of the tests. From the test control panel that comes up push the clean test button. The command field will be prefilled with a template command for removing that test. You can edit the command, for example change the argument to -testpatt to "%" to remove all tests.</p></div> <div class="listingblock"> <div class="title">Remove the test diskperf and all it’s items</div> <div class="content monospaced"> <pre>megatest -remove-runs -target ubuntu/nfs/none -runname ww28.1a -testpatt diskperf/% -v</pre> </div></div> <div class="listingblock"> <div class="title">Remove all tests for all runs and all targets</div> <div class="content monospaced"> <pre>megatest -remove-runs -target %/%/% -runname % -testpatt % -v</pre> </div></div> </div> <div class="sect3"> <h4 id="_archive_runs">Archive Runs</h4> <div class="paragraph"><p>Megatest supports using the bup backup tool (<a href="https://bup.github.io/">https://bup.github.io/</a>) to archive your tests for efficient storage and retrieval. Archived data can be rapidly retrieved if needed. The metadata for the run (PASS/FAIL status, run durations, time stamps etc.) are all preserved in the megatest database.</p></div> <div class="paragraph"><p>For setup information see the Archiving topic in the reference section of this manual.</p></div> <div class="sect4"> <h5 id="_to_archive">To Archive</h5> <div class="paragraph"><p>Hint: use the test control panel to create a template command by pushing the "Archive Tests" button.</p></div> <div class="listingblock"> <div class="title">Archive a full run</div> <div class="content monospaced"> <pre>megatest -target ubuntu/nfs/none -runname ww28.1a -archive save-remove -testpatt %</pre> </div></div> </div> <div class="sect4"> <h5 id="_to_restore">To Restore</h5> <div class="listingblock"> <div class="title">Retrieve a single test</div> <div class="content monospaced"> <pre>megatest -target ubuntu/nfs/none -runname ww28.1a -archive restore -testpatt diskperf/%</pre> </div></div> <div class="paragraph"><p>Hint: You can browse the archive using bup commands directly.</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>bup -d /path/to/bup/archive ftp</pre> </div></div> </div> </div> </div> <div class="sect2"> <h3 id="_submit_jobs_to_host_types_based_on_test_name">Submit jobs to Host Types based on Test Name</h3> <div class="listingblock"> <div class="title">In megatest.config</div> <div class="content monospaced"> |
︙ | ︙ | |||
1025 1026 1027 1028 1029 1030 1031 | # if defined and not "no" flexi-launcher will bypass launcher unless there is no # match. flexi-launcher yes</pre> </div></div> </div> </div> </div> | > | > | | < > | 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | # if defined and not "no" flexi-launcher will bypass launcher unless there is no # match. flexi-launcher yes</pre> </div></div> </div> </div> </div> <div class="sect1"> <h2 id="_tricks">Tricks</h2> <div class="sectionbody"> <div class="paragraph"><p>This section is a compendium of a various useful tricks for debugging, configuring and generally getting the most out of Megatest.</p></div> <div class="sect2"> <h3 id="_limiting_your_running_jobs">Limiting your running jobs</h3> <div class="paragraph"><p>The following example will limit a test in the jobgroup "group1" to no more than 10 tests simultaneously.</p></div> <div class="paragraph"><p>In your testconfig:</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>[test_meta] jobgroup group1</pre> </div></div> <div class="paragraph"><p>In your megatest.config:</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>[jobgroups] group1 10 custdes 4</pre> </div></div> </div> </div> </div> <div class="sect1"> <h2 id="_debugging_tricks">Debugging Tricks</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_examining_the_environment">Examining The Environment</h3> |
︙ | ︙ | |||
1127 1128 1129 1130 1131 1132 1133 | <pre>sudo lsof -i sudo netstat -lptu sudo netstat -tulpn</pre> </div></div> </div> </div> </div> | > | | > | | < | | | | | | | | | | | < | | > | | > > | | | 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 | <pre>sudo lsof -i sudo netstat -lptu sudo netstat -tulpn</pre> </div></div> </div> </div> </div> <div class="sect1"> <h2 id="_reference">Reference</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_megatest_config_file_settings">Megatest Config File Settings</h3> <div class="sect3"> <h4 id="_disk_space_checks">Disk Space Checks</h4> <div class="paragraph"><p>Some parameters you can put in the [setup] section of megatest.config:</p></div> <div class="listingblock"> <div class="content monospaced"> <pre># minimum space required in a run disk minspace 10000000 # minimum space required in dbdir: dbdir-space-required 100000 # script that takes path as parameter and returns number of bytes available: free-space-script check-space.sh</pre> </div></div> </div> <div class="sect3"> <h4 id="_trim_trailing_spaces">Trim trailing spaces</h4> <div class="listingblock"> <div class="content monospaced"> <pre>[configf:settings trim-trailing-spaces yes]</pre> </div></div> </div> <div class="sect3"> <h4 id="_job_submission_control">Job Submission Control</h4> <div class="sect4"> <h5 id="_submit_jobs_to_host_types_based_on_test_name_2">Submit jobs to Host Types based on Test Name</h5> <div class="listingblock"> <div class="title">In megatest.config</div> <div class="content monospaced"> <pre>[host-types] general nbfake remote bsub [launchers] runfirst/sum% remote % general [jobtools] launcher bsub # if defined and not "no" flexi-launcher will bypass launcher unless # there is no host-type match. flexi-launcher yes</pre> </div></div> </div> <div class="sect4"> <h5 id="_host_types">host-types</h5> <div class="paragraph"><p>List of host types and the commandline to run a job on that host type.</p></div> <div class="listingblock"> <div class="title">host-type ⇒ launch command</div> <div class="content monospaced"> <pre>general nbfake</pre> </div></div> </div> <div class="sect4"> <h5 id="_launchers">launchers</h5> <div class="listingblock"> <div class="title">test/itempath ⇒ host-type</div> <div class="content monospaced"> <pre>runfirst/sum% remote</pre> </div></div> </div> <div class="sect4"> <h5 id="_miscellaneous_setup_items">Miscellaneous Setup Items</h5> <div class="paragraph"><p>Attempt to rerun tests in "STUCK/DEAD", "n/a", "ZERO_ITEMS" states.</p></div> <div class="listingblock"> <div class="title">In megatest.config</div> <div class="content monospaced"> <pre>[setup] reruns 5</pre> </div></div> </div> <div class="sect4"> <h5 id="_run_time_limit">Run time limit</h5> <div class="listingblock"> <div class="content monospaced"> <pre>[setup] # this will automatically kill the test if it runs for more than 1h 2m and 3s runtimelim 1h 2m 3s</pre> </div></div> </div> </div> </div> <div class="sect2"> <h3 id="_tests_browser_view">Tests browser view</h3> <div class="paragraph"><p>The tests browser (see the Run Control tab on the dashboard) has two views for displaying the tests.</p></div> <div class="olist arabic"><ol class="arabic"> <li> <p> Dot (graphviz) based tree </p> </li> |
︙ | ︙ | |||
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 | well in that mode then use "nodot" to turn it off.</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>[setup] nodot</pre> </div></div> </div> </div> <div class="sect2"> <h3 id="_database_settings">Database settings</h3> <table class="tableblock frame-topbot grid-all" style=" width:70%; "> | > > > > > > > > > > | | 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | well in that mode then use "nodot" to turn it off.</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>[setup] nodot</pre> </div></div> </div> <div class="sect2"> <h3 id="_dashboard_settings">Dashboard settings</h3> <div class="listingblock"> <div class="title">Runs tab buttons, font and size</div> <div class="content monospaced"> <pre>[dashboard] btn-height x14 btn-fontsz 10 cell-width 60</pre> </div></div> </div> <div class="sect2"> <h3 id="_database_settings">Database settings</h3> <table class="tableblock frame-topbot grid-all" style=" width:70%; "> <caption class="title">Table 2. Database config settings in [setup] section of megatest.config</caption> <col style="width:14%;"> <col style="width:28%;"> <col style="width:28%;"> <col style="width:28%;"> <thead> <tr> <th class="tableblock halign-center valign-top" >Var </th> |
︙ | ︙ | |||
1617 1618 1619 1620 1621 1622 1623 | <div class="content monospaced"> <pre>[triggers] COMPLETED/ xterm -e bash -s --</pre> </div></div> <div class="admonitionblock"> <table><tr> <td class="icon"> | | | 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | <div class="content monospaced"> <pre>[triggers] COMPLETED/ xterm -e bash -s --</pre> </div></div> <div class="admonitionblock"> <table><tr> <td class="icon"> <img src="/nfs/pdx/disks/ice.disk.002/icfadm/pkgs/asciidoc/8.6.7/images/icons/note.png" alt="Note"> </td> <td class="content">There is a trailing space after the --</td> </tr></table> </div> </div> <div class="sect2"> <h3 id="_override_the_toplevel_html_file">Override the Toplevel HTML File</h3> |
︙ | ︙ | |||
1710 1711 1712 1713 1714 1715 1716 | <h2 id="_programming_api">Programming API</h2> <div class="sectionbody"> <div class="paragraph"><p>These routines can be called from the megatest repl.</p></div> <table class="tableblock frame-topbot grid-all" style=" width:70%; "> | | | 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 | <h2 id="_programming_api">Programming API</h2> <div class="sectionbody"> <div class="paragraph"><p>These routines can be called from the megatest repl.</p></div> <table class="tableblock frame-topbot grid-all" style=" width:70%; "> <caption class="title">Table 3. API Keys Related Calls</caption> <col style="width:14%;"> <col style="width:28%;"> <col style="width:28%;"> <col style="width:28%;"> <thead> <tr> <th class="tableblock halign-center valign-top" >API Call </th> |
︙ | ︙ | |||
1740 1741 1742 1743 1744 1745 1746 | <td class="tableblock halign-center valign-top" ><p class="tableblock">(rmt:get-keys run-id)</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced">( key1 key2 … )</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td> </tr> </tbody> </table> | < < < < < < < < | < | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < | < | 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 | <td class="tableblock halign-center valign-top" ><p class="tableblock">(rmt:get-keys run-id)</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced">( key1 key2 … )</p></td> <td class="tableblock halign-left valign-top" ><p class="tableblock monospaced"></p></td> </tr> </tbody> </table> </div> </div> <div class="sect1"> <h2 id="_megatest_internals">Megatest Internals</h2> <div class="sectionbody"> <div class="imageblock graphviz"> <div class="content"> <img src="server.png" alt="server.png"> </div> </div> </div> </div> <div class="sect1"> <h2 id="_example_index">Example Index</h2> <div class="sectionbody"> </div> </div> </div> <div id="footnotes"><hr></div> <div id="footer"> <div id="footer-text"> Version 1.0<br> Last updated 2016-10-19 10:23:07 PDT </div> </div> </body> </html> |
Modified docs/manual/megatest_manual.txt from [49b99544b8] to [c82fa9e963].
1 2 3 4 5 6 7 8 9 | The Megatest Users Manual ========================= Matt Welland <matt@kiatoa.com> v1.0, April 2012 :doctype: book [preface] Preface | > | < > < > | 1 2 3 4 5 6 7 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 | The Megatest Users Manual ========================= Matt Welland <matt@kiatoa.com> v1.0, April 2012 :doctype: book [preface] Preface ------- This book is organised as three sub-books; getting started, writing tests and reference. Why Megatest? ------------- The Megatest project was started for two reasons, the first was an immediate and pressing need for a generalized tool to manage a suite of regression tests and the second was the fact that the author had written or maintained several such tools at different companies over the years and it seemed a good thing to have a single open source tool, flexible enough to meet the needs of any team doing continuous integrating and or running a complex suite of tests for release qualification. Megatest Design Philosophy -------------------------- Megatest is intended to provide the minimum needed resources to make writing a suite of tests and tasks for implementing continuous build for software, design engineering or process control (via owlfs for example) without being specialized for any specific problem space. Megatest in of itself does not know what constitutes a PASS or FAIL of a test or task. In most cases megatest is best used in |
︙ | ︙ | |||
49 50 51 52 53 54 55 | * Encapsulated - the tests run in self-contained directories and all inputs and outputs to the process can be found in the run areas. * Deployable - anyone on the team, at any site, at any time can run the flow Megatest Architecture | < > > > > > > > > > > < > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < > | 50 51 52 53 54 55 56 57 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 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 | * Encapsulated - the tests run in self-contained directories and all inputs and outputs to the process can be found in the run areas. * Deployable - anyone on the team, at any site, at any time can run the flow Megatest Architecture --------------------- All data to specify the tests and configure the system is stored in plain text files. All system state is stored in an sqlite3 database. Tests are launched using the launching system available for the distributed compute platform in use. A template script is provided which can launch jobs on local and remote Linux hosts. Currently megatest uses the network filesystem to call home to your master sqlite3 database. include::../plan.txt[] // to allow the getting_started.txt to be a stand-alone document use level shifting, note that the preceding blank line is needed. // :leveloffset: 2 include::installation.txt[] include::getting_started.txt[] :leveloffset: 0 include::writing_tests.txt[] include::howto.txt[] include::reference.txt[] Megatest Internals ------------------ ["graphviz", "server.png"] ---------------------------------------------------------------------- include::server.dot[] ---------------------------------------------------------------------- // [appendix] // Example Appendix // ================ // One or more optional appendixes go here at section level zero. // // Appendix Sub-section // ~~~~~~~~~~~~~~~~~~~ // NOTE: Preface and appendix subsections start out of sequence at level // 2 (level 1 is skipped). This only applies to multi-part book // documents. // // // // [bibliography] // Example Bibliography // ==================== // The bibliography list is a style of AsciiDoc bulleted list. // // [bibliography] // - [[[taoup]]] Eric Steven Raymond. 'The Art of Unix // Programming'. Addison-Wesley. ISBN 0-13-142901-9. // - [[[walsh-muellner]]] Norman Walsh & Leonard Muellner. // 'DocBook - The Definitive Guide'. O'Reilly & Associates. 1999. // ISBN 1-56592-580-7. // // // [glossary] // Example Glossary // ================ // Glossaries are optional. Glossaries entries are an example of a style // of AsciiDoc labeled lists. // // [glossary] // A glossary term:: // The corresponding (indented) definition. // // A second glossary term:: // The corresponding (indented) definition. // // // [colophon] // Example Colophon // ================ // Text at the end of a book describing facts about its production. [index] Example Index ------------- //////////////////////////////////////////////////////////////// The index is normally left completely empty, it's contents are generated automatically by the DocBook toolchain. //////////////////////////////////////////////////////////////// |
Modified docs/manual/reference.txt from [262af5e4f5] to [206fb51b8f].
1 2 | Reference | < > < > < > < > < > < > < > > | < > < > < > > > > > > > > > > > > | 1 2 3 4 5 6 7 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 69 70 71 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 | Reference --------- Megatest Config File Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Disk Space Checks ^^^^^^^^^^^^^^^^^ Some parameters you can put in the [setup] section of megatest.config: ------------------- # minimum space required in a run disk minspace 10000000 # minimum space required in dbdir: dbdir-space-required 100000 # script that takes path as parameter and returns number of bytes available: free-space-script check-space.sh ------------------- Trim trailing spaces ^^^^^^^^^^^^^^^^^^^^ ------------------ [configf:settings trim-trailing-spaces yes] ------------------ Job Submission Control ^^^^^^^^^^^^^^^^^^^^^^ Submit jobs to Host Types based on Test Name ++++++++++++++++++++++++++++++++++++++++++++ .In megatest.config ------------------------ [host-types] general nbfake remote bsub [launchers] runfirst/sum% remote % general [jobtools] launcher bsub # if defined and not "no" flexi-launcher will bypass launcher unless # there is no host-type match. flexi-launcher yes ------------------------ host-types ++++++++++ List of host types and the commandline to run a job on that host type. .host-type => launch command ------------ general nbfake ------------ launchers +++++++++ .test/itempath => host-type ------------ runfirst/sum% remote ------------ Miscellaneous Setup Items +++++++++++++++++++++++++ Attempt to rerun tests in "STUCK/DEAD", "n/a", "ZERO_ITEMS" states. .In megatest.config ------------------ [setup] reruns 5 ------------------ Run time limit ++++++++++++++ ----------------- [setup] # this will automatically kill the test if it runs for more than 1h 2m and 3s runtimelim 1h 2m 3s ----------------- Tests browser view ~~~~~~~~~~~~~~~~~~ The tests browser (see the Run Control tab on the dashboard) has two views for displaying the tests. . Dot (graphviz) based tree . No dot, plain listing The default is the graphviz based tree but if your tests don't view well in that mode then use "nodot" to turn it off. ----------------- [setup] nodot ----------------- Dashboard settings ~~~~~~~~~~~~~~~~~~ .Runs tab buttons, font and size ------------------ [dashboard] btn-height x14 btn-fontsz 10 cell-width 60 ------------------ Database settings ~~~~~~~~~~~~~~~~~ .Database config settings in [setup] section of megatest.config [width="70%",cols="^,2m,2m,2m",frame="topbot",options="header"] |====================== |
︙ | ︙ |
Modified docs/manual/server.png from [267af6c507] to [ae7d7ee58e].
cannot compute difference between binary files
Modified docs/manual/writing_tests.txt from [3f710469e5] to [c1e61ad2b4].
1 2 3 | Writing Tests ------------- | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Writing Tests ------------- Creating a new Test ~~~~~~~~~~~~~~~~~~~ The following steps will add a test "yourtestname" to your testsuite. This assumes starting from a directory where you already have a megatest.config and runconfigs.config. . Create a directory tests/yourtestname . Create a file tests/yourtestname/testconfig |
︙ | ︙ |
Modified docs/plan.txt from [37ebd56f39] to [92bba79ce7].
1 | Road Map | > | > > > | > > > > > > > > > > | > > > > > > > > > > > > > > < > < > | 1 2 3 4 5 6 7 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 | Road Map -------- Note 1: This road-map is still evolving and subject to change without notice. Architecture Refactor ~~~~~~~~~~~~~~~~~~~~~ Goals ^^^^^ . Reduce load on the file system. Sqlite3 files on network filesystem can be a burden. . Reduce number of servers and frequency of start/stop. This is mostly an issue of clutter but also a reduction in "moving parts". . Coalesce activities to a single home host where possible. Give the user feedback that they have started the dashboard on a host other than the home host. . Reduce number of processes involved in managing running tests. Changes Needed ^^^^^^^^^^^^^^ . ACID compliant db will be on /tmp and synced to megatest.db with a five second max delay. . Read/writes to db for processes on homehost will go direct to /tmp megatest.db file. . Read/wites fron non-homehost processes will go through one server. Bulk reads (e.g. for dashboard or list-runs) will be cached on the current host in /tmp and synced from the home megatest.db in the testsuite area. . Db syncs rely on the target db file timestame minus some margin. . Since bulk reads do not use the server we can switch to simple RPC for the network transport. . Test running manager process extended to manage multiple running tests. Current Items ~~~~~~~~~~~~~ ww05 - migrate to inmem-db ^^^^^^^^^^^^^^^^^^^^^^^^^^ . Switch to inmem db with fast sync to on disk db's [DONE] . Server polls tasks table for next action .. Task table used for tracking runner process [DONE] .. Task table used for jobs to run .. Task table used for queueing runner actions (remove runs, cleanRunExecute, etc) |
︙ | ︙ |
Modified example/megatest.config from [1023424f91] to [ce9f9de360].
1 2 3 4 5 6 7 8 9 | [fields] CFG_TYPE This is the refdb to use. RUN_TYPE Can be: full or quick [setup] # Adjust max_concurrent_jobs to limit parallel jobs max_concurrent_jobs 50 # This is your link path, best to set it and then not change it | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | [fields] CFG_TYPE This is the refdb to use. RUN_TYPE Can be: full or quick [setup] # Adjust max_concurrent_jobs to limit parallel jobs max_concurrent_jobs 50 # This is your link path, best to set it and then not change it linktree #{getenv MT_RUN_AREA_HOME}/linktree # Job tools control how your jobs are launched [jobtools] launcher nbfake # As you run more tests you may need to add additional disks # the names are arbitrary but must be unique [disks] disk0 #{getenv MT_RUN_AREA_HOME}/runs [include local.megatest.config] |
Modified genexample.scm from [bd1757f906] to [fa6512266d].
︙ | ︙ | |||
11 12 13 14 15 16 17 | (declare (unit genexample)) (use posix regex) (define genexample:example-logpro #<<EOF ;; You should have at least one expect:required. This ensures that your process ran | > > > | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | (declare (unit genexample)) (use posix regex) (define genexample:example-logpro #<<EOF ;; You should have at least one expect:required. This ensures that your process ran ;; comment out the line below and replace "put pattern here" with a pattern that will ;; always be seen in your log file if the step runs successfully. ;; ;; (expect:required in "LogFileBody" > 0 "Put description here" #/put pattern here/) ;; ;; You may need ignores to suppress false error or warning hits from the later expects ;; NOTE: Order is important here! (expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) (expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors EOF |
︙ | ︙ |
Modified megatest-version.scm from [d9a48f0712] to [a1be7ed10e].
1 2 3 4 5 | ;; Always use two or four digit decimal ;; 1.01, 1.02...1.10,1.11,1.1101 ... 1.99,2.00.. (declare (unit megatest-version)) | | | 1 2 3 4 5 6 7 | ;; Always use two or four digit decimal ;; 1.01, 1.02...1.10,1.11,1.1101 ... 1.99,2.00.. (declare (unit megatest-version)) (define megatest-version 1.6205) |
Modified runs.scm from [fb07c27494] to [9f66bcb951].
︙ | ︙ | |||
1542 1543 1544 1545 1546 1547 1548 | ((and skip-check (configf:lookup test-conf "skip" "rundelay")) ;; run-ids = #f means *all* runs (let* ((numseconds (common:hms-string->seconds (configf:lookup test-conf "skip" "rundelay"))) (running-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("RUNNING" "REMOTEHOSTSTART" "LAUNCHED") '() #f)) (completed-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("COMPLETED" "INCOMPLETE") '("PASS" "FAIL" "ABORT") #f)) ;; ironically INCOMPLETE is same as COMPLETED in this contex (last-run-times (map db:mintest-get-event_time completed-tests)) | | | 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 | ((and skip-check (configf:lookup test-conf "skip" "rundelay")) ;; run-ids = #f means *all* runs (let* ((numseconds (common:hms-string->seconds (configf:lookup test-conf "skip" "rundelay"))) (running-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("RUNNING" "REMOTEHOSTSTART" "LAUNCHED") '() #f)) (completed-tests (rmt:get-tests-for-runs-mindata #f full-test-name '("COMPLETED" "INCOMPLETE") '("PASS" "FAIL" "ABORT") #f)) ;; ironically INCOMPLETE is same as COMPLETED in this contex (last-run-times (map db:mintest-get-event_time completed-tests)) (time-since-last (- (current-seconds) (if (null? last-run-times) 0 (common:max last-run-times))))) (if (or (not (null? running-tests)) ;; have to skip if test is running (> numseconds time-since-last)) (set! skip-test (conc "Skipping due to previous test run less than " (configf:lookup test-conf "skip" "rundelay") " ago")))))) (if skip-test (begin (mt:test-set-state-status-by-id run-id test-id "COMPLETED" "SKIP" skip-test) |
︙ | ︙ |
Modified utils/viewscreen from [5576984d64] to [dee289c6f4].
1 2 3 4 5 6 7 8 9 10 | #!/bin/bash if ! type screen &> /dev/null;then xterm -geometry 180x20 -e "$*;echo Press any key to continue;bash -c 'read -n 1 -s'" & exit fi if [[ $(screen -list | egrep 'Attached|Detached'|awk '{print $1}') == "" ]];then # echo "No screen found for displaying to. Run \"screen\" in an xterm" # exit 1 | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #!/bin/bash if ! type screen &> /dev/null;then xterm -geometry 180x20 -e "$*;echo Press any key to continue;bash -c 'read -n 1 -s'" & exit fi if [[ $(screen -list | egrep 'Attached|Detached'|awk '{print $1}') == "" ]];then # echo "No screen found for displaying to. Run \"screen\" in an xterm" # exit 1 xterm -e screen -e^ff & sleep 1 screen -X hardstatus off screen -X hardstatus alwayslastline screen -X hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]' fi cmd="cd $PWD;$*" screen -X screen bash -c "$cmd;echo \"Press any key to continue, ctrl-f <space> to see other windows\";bash -c 'read -n 1 -s'" |