Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -3,11 +3,11 @@ CSCOPTS= INSTALL=install SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ - process.scm runs.scm tasks.scm tests.scm + process.scm runs.scm tasks.scm tests.scm genexample.scm GUISRCF = dashboard.scm dashboard-tests.scm dashboard-guimonitor.scm dashboard-main.scm OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) Index: genexample.scm ================================================================== --- genexample.scm +++ genexample.scm @@ -8,23 +8,56 @@ ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== (declare (unit genexample)) +(use posix) + +(define genexample:example-logpro +#< 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 +) + +(define genexample:example-script +#< 2 + "-gen-megatest-test" "-override-timeout" ) (list "-h" "-force" "-xterm" @@ -177,10 +182,11 @@ "-remove-runs" "-usequeue" "-rebuild-db" "-rollup" "-update-meta" + "-gen-megatest-area" "-v" ;; verbose 2, more than normal (normal is 1) "-q" ;; quiet 0, errors/warnings only ) args:arg-hash @@ -753,10 +759,20 @@ (if (args:get-arg "-gui") (begin (debug:print 0 "Look at the dashboard for now") ;; (megatest-gui) (set! *didsomething* #t))) + +(if (args:get-arg "-gen-megatest-area") + (begin + (genexample:mk-megatest.config) + (set! *didsomething* #t))) + +(if (args:get-arg "-gen-megatest-test") + (let ((testname (args:get-arg "-gen-megatest-test"))) + (genexample:mk-megatest-test testname) + (set! *didsomething* #t))) ;;====================================================================== ;; Update the database schema on request ;;====================================================================== Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -76,11 +76,11 @@ (if (null? results) #f (car results)))))))))) ;; get the previous records for when these tests were run where all keys match but runname ;; NB// Merge this with test:get-previous-test-run-records? This one looks for all matching tests -;; can use wildcards. +;; can use wildcards. Also can likely be factored in with get test paths? (define (test:get-matching-previous-test-run-records db run-id test-name item-path) (let* ((keys (db:get-keys db)) (selstr (string-intersperse (map (lambda (x)(vector-ref x 0)) keys) ",")) (qrystr (string-intersperse (map (lambda (x)(conc (vector-ref x 0) "=?")) keys) " AND ")) (keyvals #f) ADDED tests/simplerun/megatest.config Index: tests/simplerun/megatest.config ================================================================== --- /dev/null +++ tests/simplerun/megatest.config @@ -0,0 +1,23 @@ +[fields] +SYSTEM TEXT +RELEASE TEXT + +[setup] +# Adjust max_concurrent_jobs to limit how much you load your machines +max_concurrent_jobs 50 + +# This is your link path, you can move it but it is generally better to keep it stable +linktree ../simplelinks + +# Job tools are more advanced ways to control how your jobs are launched +[jobtools] +useshell yes +launcher nbfind + +# You can override environment variables for all your tests here +[env-override] +EXAMPLE_VAR example value + +# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique +[disks] +disk0 ../simpleruns ADDED tests/simplerun/runconfigs.config Index: tests/simplerun/runconfigs.config ================================================================== --- /dev/null +++ tests/simplerun/runconfigs.config @@ -0,0 +1,5 @@ +[default] +ALLTESTS see this variable +# Your variables here are grouped by targets [SYSTEM/RELEASE] +[SYSTEM_val/RELEASE_val] +ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val ADDED tests/simplerun/tests/test1/testconfig Index: tests/simplerun/tests/test1/testconfig ================================================================== --- /dev/null +++ tests/simplerun/tests/test1/testconfig @@ -0,0 +1,21 @@ +# Add additional steps here. Format is "stepname script" +[ezsteps] +step1 step1.sh +step2 step2.sh + +# Test requirements are specified here +[requirements] +waiton setup +priority 0 + +# Iteration for your tests are controlled by the items section +[items] +PARTOFDAY morning noon afternoon evening night + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description An example test +tags tagone,tagtwo +reviewed never ADDED tests/simplerun/tests/test2/step1.logpro Index: tests/simplerun/tests/test2/step1.logpro ================================================================== --- /dev/null +++ tests/simplerun/tests/test2/step1.logpro @@ -0,0 +1,8 @@ +;; You should have at least one expect:required. This ensures that your process ran +(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 ADDED tests/simplerun/tests/test2/step1.sh.sh Index: tests/simplerun/tests/test2/step1.sh.sh ================================================================== --- /dev/null +++ tests/simplerun/tests/test2/step1.sh.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +# Run your step here ADDED tests/simplerun/tests/test2/step2.logpro Index: tests/simplerun/tests/test2/step2.logpro ================================================================== --- /dev/null +++ tests/simplerun/tests/test2/step2.logpro @@ -0,0 +1,8 @@ +;; You should have at least one expect:required. This ensures that your process ran +(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 ADDED tests/simplerun/tests/test2/step2.sh.sh Index: tests/simplerun/tests/test2/step2.sh.sh ================================================================== --- /dev/null +++ tests/simplerun/tests/test2/step2.sh.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +# Run your step here ADDED tests/simplerun/tests/test2/testconfig Index: tests/simplerun/tests/test2/testconfig ================================================================== --- /dev/null +++ tests/simplerun/tests/test2/testconfig @@ -0,0 +1,21 @@ +# Add additional steps here. Format is "stepname script" +[ezsteps] +step1 step1.sh +step2 step2.sh + +# Test requirements are specified here +[requirements] +waiton test1 +priority 0 + +# Iteration for your tests are controlled by the items section +[items] +LANDTYPE desert plains forest jungle beach + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description Yet another example test +tags tagone,tagtwo +reviewed never