Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -1324,10 +1324,18 @@ # This builtin rule is applied if a <waivername>.logpro file exists # logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html +
+

Ezsteps

+

To transfer the environment to the next step you can do the following:

+
+
+
$MT_MEGATEST -env2file .ezsteps/${stepname}
+
+

Appendix A: Example Appendix

@@ -1407,10 +1415,10 @@

Index: docs/manual/reference.txt ================================================================== --- docs/manual/reference.txt +++ docs/manual/reference.txt @@ -138,8 +138,16 @@ # This builtin rule is applied if a .logpro file exists # logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html ----------------- +Ezsteps +~~~~~~~ + +To transfer the environment to the next step you can do the following: + +---------------------------- +$MT_MEGATEST -env2file .ezsteps/${stepname} +---------------------------- :numbered!: Index: ezsteps.scm ================================================================== --- ezsteps.scm +++ ezsteps.scm @@ -32,11 +32,18 @@ (rollup-status 0) (exit-info (vector #t #t #t)) (test-id (db:test-get-id testdat)) (test-name (db:test-get-testname testdat)) (kill-job #f)) ;; for future use (on re-factoring with launch.scm code - (push-directory test-run-dir) + (let loop ((count 5)) + (if (file-exists? test-run-dir) + (push-directory test-run-dir) + (if (> count 0) + (begin + (debug:print 0 "WARNING: ezsteps attempting to run but test run directory " test-run-dir " is not there. Waiting and trying again " count " more times") + (sleep 3) + (loop (- count 1)))))) (debug:print-info 0 "Running in directory " test-run-dir) (if (not (file-exists? ".ezsteps"))(create-directory ".ezsteps")) ;; if ezsteps was defined then we are sure to have at least one step but check anyway (if (not (> (length ezstepslst) 0)) (message-window "ERROR: You can only re-run steps defined via ezsteps") Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -811,11 +811,15 @@ (debug:print-info 4 "test-id=" test-id ", run-id=" run-id ", test-name=" test-name ", item-path=\"" item-path "\"") (set! testdat (cdb:get-test-info-by-id *runremote* test-id)))) (if (not testdat) ;; should NOT happen (debug:print 0 "ERROR: failed to get test record for test-id " test-id)) (set! test-id (db:test-get-id testdat)) - (change-directory test-path) + (if (file-exists? test-path) + (change-directory test-path) + (begin + (debug:print "ERROR: test run path not created before attempting to run the test. Perhaps you are running -remove-runs at the same time?") + (change-directory *toppath*))) (case (if force ;; (args:get-arg "-force") 'NOT_STARTED (if testdat (string->symbol (test:get-state testdat)) 'failed-to-insert)) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -226,55 +226,60 @@ (prev-rundir (db:test-get-rundir prev-testdat)) (waivers (configf:section-vars testconfig "waivers")) (waiver-rx (regexp "^(\\S+)\\s+(.*)$")) (diff-rule "diff %file1% %file2%") (logpro-rule "diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html")) - (push-directory test-rundir) - (let ((result (if (null? waivers) - #f - (let loop ((hed (car waivers)) - (tal (cdr waivers))) - (debug:print 0 "INFO: Applying waiver rule \"" hed "\"") - (let* ((waiver (configf:lookup testconfig "waivers" hed)) - (wparts (if waiver (string-match waiver-rx waiver) #f)) - (waiver-rule (if wparts (cadr wparts) #f)) - (waiver-glob (if wparts (caddr wparts) #f)) - (logpro-file (if waiver - (let ((fname (conc hed ".logpro"))) - (if (file-exists? fname) - fname - (begin - (debug:print 0 "INFO: No logpro file " fname " falling back to diff") - #f))) - #f)) - ;; if rule by name of waiver-rule is found in testconfig - use it - ;; else if waivername.logpro exists use logpro-rule - ;; else default to diff-rule - (rule-string (let ((rule (configf:lookup testconfig "waiver_rules" waiver-rule))) - (if rule - rule - (if logpro-file - logpro-rule - (begin - (debug:print 0 "INFO: No logpro file " logpro-file " found, using diff rule") - diff-rule))))) - ;; (string-substitute "%file1%" "foofoo.txt" "This is %file1% and so is this %file1%." #t) - (processed-cmd (string-substitute - "%file1%" (conc test-rundir "/" waiver-glob) - (string-substitute - "%file2%" (conc prev-rundir "/" waiver-glob) - (string-substitute - "%waivername%" hed rule-string #t) #t) #t)) - (res #f)) - (debug:print 0 "INFO: waiver command is \"" processed-cmd "\"") - (if (eq? (system processed-cmd) 0) - (if (null? tal) - #t - (loop (car tal)(cdr tal))) - #f)))))) - (pop-directory) - result))) + (if (not (file-exists? test-rundir)) + (begin + (debug:print 0 "ERROR: test run directory is gone, cannot propagate waiver") + #f) + (begin + (push-directory test-rundir) + (let ((result (if (null? waivers) + #f + (let loop ((hed (car waivers)) + (tal (cdr waivers))) + (debug:print 0 "INFO: Applying waiver rule \"" hed "\"") + (let* ((waiver (configf:lookup testconfig "waivers" hed)) + (wparts (if waiver (string-match waiver-rx waiver) #f)) + (waiver-rule (if wparts (cadr wparts) #f)) + (waiver-glob (if wparts (caddr wparts) #f)) + (logpro-file (if waiver + (let ((fname (conc hed ".logpro"))) + (if (file-exists? fname) + fname + (begin + (debug:print 0 "INFO: No logpro file " fname " falling back to diff") + #f))) + #f)) + ;; if rule by name of waiver-rule is found in testconfig - use it + ;; else if waivername.logpro exists use logpro-rule + ;; else default to diff-rule + (rule-string (let ((rule (configf:lookup testconfig "waiver_rules" waiver-rule))) + (if rule + rule + (if logpro-file + logpro-rule + (begin + (debug:print 0 "INFO: No logpro file " logpro-file " found, using diff rule") + diff-rule))))) + ;; (string-substitute "%file1%" "foofoo.txt" "This is %file1% and so is this %file1%." #t) + (processed-cmd (string-substitute + "%file1%" (conc test-rundir "/" waiver-glob) + (string-substitute + "%file2%" (conc prev-rundir "/" waiver-glob) + (string-substitute + "%waivername%" hed rule-string #t) #t) #t)) + (res #f)) + (debug:print 0 "INFO: waiver command is \"" processed-cmd "\"") + (if (eq? (system processed-cmd) 0) + (if (null? tal) + #t + (loop (car tal)(cdr tal))) + #f)))))) + (pop-directory) + result))))) ;; Do not rpc this one, do the underlying calls!!! (define (tests:test-set-status! test-id state status comment dat #!key (work-area #f)) (debug:print-info 4 "tests:test-set-status! test-id=" test-id ", state=" state ", status=" status ", dat=" dat) Index: tests/installall/runconfigs.config ================================================================== --- tests/installall/runconfigs.config +++ tests/installall/runconfigs.config @@ -11,11 +11,13 @@ PLATFORM linux LOGPRO_VERSION v1.05 BUILDSQLITE yes SQLITE3_VERSION 3071401 ZEROMQ_VERSION 2.2.0 -LOGPRO_VERSION v1.08 +logpro_VERSION v1.08 +stml_VERSION v0.901 +megatest_VERSION v1.5511 [include configs/hicken-#{getenv CHICKEN_VERSION}.config] # Currently must have at least one variable in a section [4.8.0/trunk/bin/std] DELETED tests/installall/tests/logpro/clone.logpro Index: tests/installall/tests/logpro/clone.logpro ================================================================== --- tests/installall/tests/logpro/clone.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Output from fossil" #/^repository:\s+/) - -;; 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/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/logpro/clone.sh Index: tests/installall/tests/logpro/clone.sh ================================================================== --- tests/installall/tests/logpro/clone.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh - -fossil clone http://www.kiatoa.com/fossils/logpro logpro.fossil - -mkdir src -cd src -fossil open ../logpro.fossil --nested -fossil co $LOGPRO_VERSION DELETED tests/installall/tests/logpro/install.logpro Index: tests/installall/tests/logpro/install.logpro ================================================================== --- tests/installall/tests/logpro/install.logpro +++ /dev/null @@ -1,9 +0,0 @@ -;; You should have at least one expect:required. This ensures that your process ran -(expect:required in "LogFileBody" > 0 "Always get a chmod at the end of install" #/chmod.*logpro.setup-info/) - -;; 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:ignore in "LogFileBody" < 99 "Ignore the word error in setup-error-handling" #/setup-error-handling/) -(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) -(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors DELETED tests/installall/tests/logpro/install.sh Index: tests/installall/tests/logpro/install.sh ================================================================== --- tests/installall/tests/logpro/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Run your step here -source $PREFIX/buildsetup.sh -cd src -chicken-install DELETED tests/installall/tests/logpro/testconfig Index: tests/installall/tests/logpro/testconfig ================================================================== --- tests/installall/tests/logpro/testconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Add additional steps here. Format is "stepname script" -[ezsteps] -clone clone.sh -install install.sh - -# Test requirements are specified here -[requirements] -waiton eggs setup - -# Iteration for your tests are controlled by the items section -[items] - -# test_meta is a section for storing additional data on your test -[test_meta] -author matt -owner matt -description Install the logpro tool -tags tagone,tagtwo -reviewed never ADDED tests/installall/tests/mmisc/clone.logpro Index: tests/installall/tests/mmisc/clone.logpro ================================================================== --- /dev/null +++ tests/installall/tests/mmisc/clone.logpro @@ -0,0 +1,8 @@ +;; You should have at least one expect:required. This ensures that your process ran +(expect:required in "LogFileBody" > 0 "Output from fossil" #/^repository:\s+/) + +;; 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/i) +(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors ADDED tests/installall/tests/mmisc/clone.sh Index: tests/installall/tests/mmisc/clone.sh ================================================================== --- /dev/null +++ tests/installall/tests/mmisc/clone.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Run your step here +source $PREFIX/buildsetup.sh + +fossil clone http://www.kiatoa.com/fossils/$FSLPKG $FSLPKG.fossil + +mkdir src +cd src +fossil open ../$FSLPKG.fossil --nested +fossil co ${$FSLPKG}_VERSION} ADDED tests/installall/tests/mmisc/install.logpro Index: tests/installall/tests/mmisc/install.logpro ================================================================== --- /dev/null +++ tests/installall/tests/mmisc/install.logpro @@ -0,0 +1,9 @@ +;; You should have at least one expect:required. This ensures that your process ran +(expect:required in "LogFileBody" > 0 "Always get a chmod at the end of install" #/chmod.*logpro.setup-info/) + +;; 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:ignore in "LogFileBody" < 99 "Ignore the word error in setup-error-handling" #/setup-error-handling/) +(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/i) +(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/i)) ;; but disallow any other errors ADDED tests/installall/tests/mmisc/install.sh Index: tests/installall/tests/mmisc/install.sh ================================================================== --- /dev/null +++ tests/installall/tests/mmisc/install.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Run your step here +source $PREFIX/buildsetup.sh +cd src +if [ $FSLPKG == "logpro" ];then + chicken-install +elif [ $FSLPKG == "stml" ];then + cp install.cfg.template install.cfg + cp requirements.scm.template requirements.scm + make + make install +else + make + make install PREFIX=$PREFIX +fi ADDED tests/installall/tests/mmisc/testconfig Index: tests/installall/tests/mmisc/testconfig ================================================================== --- /dev/null +++ tests/installall/tests/mmisc/testconfig @@ -0,0 +1,21 @@ +# Add additional steps here. Format is "stepname script" +[ezsteps] +clone clone.sh +install install.sh + +# Test requirements are specified here +[requirements] +waiton eggs setup + +# Iteration for your tests are controlled by the items section +[items] +FSLPKG logpro stml megatest + + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description Install the logpro tool +tags tagone,tagtwo +reviewed never Index: utils/mt_ezstep ================================================================== --- utils/mt_ezstep +++ utils/mt_ezstep @@ -72,7 +72,7 @@ exitstatus=1 else exitstatus=0 fi -$MT_MEGATEST -env2file .ezsteps/${stepname} +# $MT_MEGATEST -env2file .ezsteps/${stepname} exit $exitstatus