Megatest

Check-in [70391eee14]
Login
Overview
Comment:updated to work with keep-records and updated manual
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 1.65-subrun-ancilliary-usecases
Files: files | file ages | folders
SHA1: 70391eee14574b70d75f91f6a7ba24fd0ffd93df
User & Date: bjbarcla on 2017-12-27 19:01:13
Other Links: branch diff | manifest | tags
Context
2017-12-28
11:20
enabled remove-run to propagate to subruns check-in: 2e121e3655 user: bjbarcla tags: v1.65
2017-12-27
19:02
pulling updated manual check-in: 77f56b4d9a user: bjbarcla tags: trunk
19:01
updated to work with keep-records and updated manual Leaf check-in: 70391eee14 user: bjbarcla tags: 1.65-subrun-ancilliary-usecases
18:12
parallelized removal of subruns check-in: a035fad97b user: bjbarcla tags: 1.65-subrun-ancilliary-usecases
Changes

Modified docs/api.html from [145585f8de] to [46ae1e4b26].

1013
1014
1015
1016
1017
1018
1019
1020

1021
1022
1023
1024
1013
1014
1015
1016
1017
1018
1019

1020
1021
1022
1023
1024







-
+




</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2016-12-12 13:03:08 PST
Last updated 2017-12-14 13:23:12 PST
</div>
</div>
</body>
</html>

Modified docs/manual/megatest_manual.html from [f626019b32] to [33b26ee1fb].

2197
2198
2199
2200
2201
2202
2203
2204

2205
2206
2207

2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225

2226
2227
2228

2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239

2240
2241
2242
2243
2244
2245
2246
2197
2198
2199
2200
2201
2202
2203

2204
2205
2206

2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224

2225
2226
2227

2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238

2239
2240
2241
2242
2243
2244
2245
2246







-
+


-
+

















-
+


-
+










-
+







<div class="paragraph"><p>In the testconfig:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>[subrun]

# Required: wait for the run or just launch it
#           if no then the run will be an automatic PASS irrespective of the actual result
runwait yes|no
run-wait yes|no

# Optional: where to execute the run. Default is the current runarea
runarea /some/path/to/megatest/area
run-area /some/path/to/megatest/area

# Optional: method to use to determine pass/fail status of the run
#   auto (default) - roll up the net state/status of the sub-run
#   logpro         - use the provided logpro rules, happens automatically if there is a logpro section
# passfail auto|logpro
# Example of logpro:
passfail logpro

# Optional:
logpro ;; if this section exists then logpro is used to determine pass/fail
  (expect:required in "LogFileBody" &gt;= 1 "At least one pass" #/PASS/)
  (expect:fail     in "LogFileBody"  = 0 "No FAILs allowed"  #/FAIL/)

# Optional: target translator, default is to use the parent target
target #{shell somescript.sh}

# Optional: runname translator/generator, default is to use the parent runname
runname #{somescript.sh}
run-name #{somescript.sh}

# Optional: testpatt spec, default is to first look for TESTPATT spec from runconfigs unless there is a contour spec
testpatt %/item1,test2
test-patt %/item1,test2

# Optional: contour spec, use the named contour from the megatest.config contour spec
contour contourname ### NOTE: Not implemented yet! Let us know if you need this feature.

# Optional: mode-patt, use this spec for testpatt from runconfigs
mode-patt TESTPATT

# Optional: tag-expr, use this tag-expr to select tests
tag-expr quick

# Optional: (not yet implemented), propagate these actions from the parent
# Optional: (not yet implemented, remove-runs is always propagated at this time), propagate these actions from the parent
#           test
#   Note// default is % for all
propagate remove-runs archive ...</pre>
</div></div>
</div>
</div>
<div class="sect1">
2299
2300
2301
2302
2303
2304
2305
2306

2307
2308
2309
2310
2299
2300
2301
2302
2303
2304
2305

2306
2307
2308
2309
2310







-
+




</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
Version 1.0<br>
Last updated 2017-07-17 14:05:11 PDT
Last updated 2017-12-14 13:23:12 PST
</div>
</div>
</body>
</html>

Modified docs/manual/reference.txt from [4bf5f81b24] to [1c3dbcfebc].

702
703
704
705
706
707
708
709

710
711
712

713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730

731
732
733

734
735
736
737
738
739
740
741
742
743
744

745
746
747
748
749
750
751
702
703
704
705
706
707
708

709
710
711

712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729

730
731
732

733
734
735
736
737
738
739
740
741
742
743

744
745
746
747
748
749
750
751







-
+


-
+

















-
+


-
+










-
+








In the testconfig:
---------------
[subrun]

# Required: wait for the run or just launch it
#           if no then the run will be an automatic PASS irrespective of the actual result
runwait yes|no
run-wait yes|no

# Optional: where to execute the run. Default is the current runarea
runarea /some/path/to/megatest/area
run-area /some/path/to/megatest/area

# Optional: method to use to determine pass/fail status of the run
#   auto (default) - roll up the net state/status of the sub-run
#   logpro         - use the provided logpro rules, happens automatically if there is a logpro section
# passfail auto|logpro
# Example of logpro:
passfail logpro

# Optional: 
logpro ;; if this section exists then logpro is used to determine pass/fail
  (expect:required in "LogFileBody" >= 1 "At least one pass" #/PASS/)
  (expect:fail     in "LogFileBody"  = 0 "No FAILs allowed"  #/FAIL/)

# Optional: target translator, default is to use the parent target
target #{shell somescript.sh}

# Optional: runname translator/generator, default is to use the parent runname
runname #{somescript.sh}
run-name #{somescript.sh}

# Optional: testpatt spec, default is to first look for TESTPATT spec from runconfigs unless there is a contour spec
testpatt %/item1,test2
test-patt %/item1,test2

# Optional: contour spec, use the named contour from the megatest.config contour spec
contour contourname ### NOTE: Not implemented yet! Let us know if you need this feature.

# Optional: mode-patt, use this spec for testpatt from runconfigs
mode-patt TESTPATT

# Optional: tag-expr, use this tag-expr to select tests
tag-expr quick

# Optional: (not yet implemented), propagate these actions from the parent
# Optional: (not yet implemented, remove-runs is always propagated at this time), propagate these actions from the parent
#           test
#   Note// default is % for all
propagate remove-runs archive ...

---------------

Programming API

Modified runs.scm from [b511145c8a] to [eb0858fc28].

2097
2098
2099
2100
2101
2102
2103
2104

2105
2106
2107
2108
2109
2110
2111
2097
2098
2099
2100
2101
2102
2103

2104
2105
2106
2107
2108
2109
2110
2111







-
+







                                      ((not-started)
                                       (debug:print 0 *default-log-port* "WARNING: postponing removal of " test-fulln " with run-id " run-id " as it has a subrun")
                                       (hash-table-set! backgrounded-remove-status test-fulln 'started)
                                       (hash-table-set! backgrounded-remove-last-visit test-fulln (current-seconds))
                                       (common:send-thunk-to-background-thread
                                        (lambda ()
                                          (let* ((subrun-remove-succeeded
                                                  (subrun:remove-subrun run-dir new-test-dat test-name item-path test-state test-fulln toplevel-with-children test)))
                                                  (subrun:remove-subrun run-dir keep-records)))
                                            (hash-table-set! backgrounded-remove-result test-fulln subrun-remove-succeeded)
                                            (hash-table-set! backgrounded-remove-status test-fulln 'done)))
                                        name: (conc "remove-subrun:"test-fulln))
                                       
                                       ;; send to back of line, loop
                                       (let ((newtal (append tal (list test))))
                                        (loop (car newtal)(cdr newtal)))
2125
2126
2127
2128
2129
2130
2131
2132


2133
2134
2135
2136
2137







2138
2139
2140
2141
2142
2143
2144
2125
2126
2127
2128
2129
2130
2131

2132
2133
2134
2135
2136


2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150







-
+
+



-
-
+
+
+
+
+
+
+







                                       (let ((subrun-remove-succeeded (hash-table-ref/default backgrounded-remove-result test-fulln 'exception)))
                                         (cond
                                          ((eq? subrun-remove-succeeded 'exception)
                                           (let* ((logfile (subrun:get-log-path run-dir "remove")))
                                             (debug:print 0 *default-log-port* "ERROR: removing subrun of of " test-fulln " with run-id " run-id " ; see logfile @ "logfile)))
                                          (subrun-remove-succeeded
                                           (debug:print 0 *default-log-port* "Now removing of " test-fulln " with run-id " run-id " since subrun was removed.")
                                           (runs:remove-test-directory new-test-dat mode))
                                           ;;(runs:remove-test-directory new-test-dat mode) ;; let normal case handle this. it will go thru loop again as non-subrun
                                           )
                                          (else
                                           (let* ((logfile (subrun:get-log-path run-dir "remove")))
                                             (debug:print 0 *default-log-port* "WARNING: removal of subrun failed.  Please check "logfile" for details."))))
                                         (if (not (null? tal))
                                             (loop (car tal)(cdr tal)))))
                                         ;;(if (not (null? tal))
                                         ;;    (loop (car tal)(cdr tal)))
                                         
                                         ;; send to back of line, loop (will not match has-subrun next time through)
                                       (let ((newtal (append tal (list test))))
                                        (loop (car newtal)(cdr newtal)))
                                         ))
                                      ) ; end case rem-status
                                    ) ; end let
                                  ); end cond has-subrun

                                 (else
                                  (debug:print-info 0 *default-log-port* "test: " test-name " itest-state: " test-state)
                                  (if (member test-state (list "RUNNING" "LAUNCHED" "REMOTEHOSTSTART" "KILLREQ"))

Modified subrun.scm from [3571b59cfa] to [1505459fab].

70
71
72
73
74
75
76
77

78
79
80
81
82
83




84
85


86
87
88
89
90
91
92
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







-
+






+
+
+
+
-
-
+
+







        (delete-file symlink-target))
    
    (create-symbolic-link ra symlink-target)

    (configf:write-alist testconfig "testconfig.subrun")))


(define (subrun:remove-subrun test-run-dir new-test-dat test-name item-path test-state test-fulln toplevel-with-children test)
(define (subrun:remove-subrun test-run-dir keep-records )
;; set state/status of test item
;; fork off megatest
;; set state/status of test item
;;
  ;;(BB> "Entered subrun:remove-subrun with "test-fulln)
  (if (and (not (subrun:subrun-removed? test-run-dir)) (subrun:subrun-test-initialized? test-run-dir))
      (let* ((action-switches-str
              (conc "-remove-runs"
                    (if keep-records "-keep-records " "")
                    ))
      (let* ((remove-result
              (subrun:exec-sub-megatest test-run-dir "-remove-runs" "remove")))
             (remove-result
              (subrun:exec-sub-megatest test-run-dir action-switches-str "remove")))
        (if remove-result
            (begin
              (subrun:set-subrun-removed test-run-dir)
              #t)
            #f))
      #t))