@@ -2,17 +2,16 @@ - + Megatest
-

Megatest

5/5/2011 @@ -19,54 +18,51 @@

Matt Welland

-

Abstract -

Megatest is a minimalistic tool to help automate and manage the running of a suite of regression tests or other processes and to roll up the results for display on a web page or dashboard. +

+Megatest is a minimalistic tool to help automate and manage the running of a suite of regression tests or other processes and to roll up the results for display on a web page or dashboard.
-
-
- +
+ - +
+
Section 0.3: Reference -
- -
-Subsection 0.3.1: Environment variables -
-
-Subsection 0.3.2: Configuration files -
- - -
- -
-Subsection 0.3.3: Writing tests -
- -
-
- - - - + +
+
+Subsection 0.3.1: Configuration files +
+
+ + + + + +
+
+Subsection 0.3.2: Environment variables +
+
+Subsection 0.3.3: Configuration files +
+
+ + +
+
+Subsection 0.3.4: Writing tests +
+
+ +
+
+Subsection 0.3.5: Command line +
+
+ + +

0.1 About Megatest

@@ -283,126 +302,186 @@

0.3 Reference

-0.3.1 Environment variables +0.3.1 Configuration files +

+

+0.3.1.1 Sections +

+
+[section name] +
+
+This creates a section named “section name” +
+

+0.3.1.2 Variables +

+
+VARX has this value +
+
+The variable “VARX” will have the value “has this value” +
+

+0.3.1.3 Includes +

+
+[include filename] +
+
+The file named “filename” will be included as if part of the calling file. NOTE: This means no section can be named “include “ (with the whitespace). +
+

+0.3.1.4 Setting a variable by running a command +

+
+VARNAME [system ls /tmp] +
+
+The variable “VARNAME” will get a value created by the Unix command “ls /tmp”. All lines of output from the command will be joined with a space. +
+

+0.3.1.5 Notes +

+ +

+0.3.2 Environment variables

- - - + - + - + - + - + - + - + + + + + + + + +
Variable Purpose Default value/Comment
MT_CMDINFO Conveys test variables to the megatest test runner. Not for use by the end user
MT_TEST_RUN_DIR Directory assigned by megatest for the test to run. Tests can consider this their “home” directory
MT_TEST_NAME Name of the test, corrosponds to the directory name under tests.
MT_ITEM_INFO Iterated tests will set this to a sequence of key/values ((KEY val) ...)
MT_RUN_AREA_HOME Directory where megatest was launched from and where the tests code can be found
MT_RUNNAME Name of this run as set by the :runname parameter
+MT_MEGATEST + +Path/Filename to megatest executable. Found either from called path or but using the “exectuable” keyword in the [setup] section. + +
<field1> .... The field values as set on the megatest -runall command line (e.g. :field1 abc) Planning ahead your field names is important so as to avoid collisions with other environment variables
+

-0.3.2 Configuration files +0.3.3 Configuration files

-0.3.2.1 megatest.config +0.3.3.1 megatest.config

- - - + - + - + - + - + - + - + - + - + +
section variable @@ -414,13 +493,13 @@ required comment
[setup] max_concurrent_jobs @@ -432,13 +511,13 @@ no
executable @@ -450,13 +529,13 @@ no Use only if necessary, megatest will extract the location from where it used to launch and add append that to the PATH for test runs.
runsdir @@ -468,13 +547,13 @@ no Because your runs may be spread out over several disk partitions a central link tree is created to make finding all the runs easy.
[fields] string of letters, numbers and underscore @@ -486,13 +565,13 @@ at least one
[jobtools] launcher @@ -504,13 +583,13 @@ no
workhosts @@ -522,13 +601,13 @@ n/a
[env-override] string of letters, numbers and underscore @@ -540,13 +619,13 @@ no These are set on the test launching machine, not the test running machine. Typical usage is to control the host or run queue for launching tests. These values will not be seen by the test when it runs.
[disks] string of letters, numbers and underscore @@ -558,22 +637,22 @@ yes The disk usage balancing algorithm is to choose the disk with the least space for each test run.
+

-0.3.2.2 runconfigs.config file +0.3.3.2 runconfigs.config file

- - - + - + - + +
section variable @@ -585,13 +664,13 @@ required? comment
[default] string of letters, numbers and underscore @@ -603,13 +682,13 @@ no variables set in this section will be available for all runs, defining the same variable in another section will override the value from the default section
[field1value/field2value...] string of letters, numbers and underscore @@ -621,12 +700,15 @@ no the values in this section will be set for any run where field1 is field1value, field2 is field2value and fieldN is fieldNvalue.
+
Example: a test suite that checks that a piece of software works correctly for different customer configurations and locations each of which is done as a separate release regression run. The fields, CUSTOMER and LOCATION were chosen. The following runconfigs.config file would set some variables specific to runs for megacorp in India and femtocorp in the Cook Islands and New Zealand:
@@ -635,65 +717,74 @@
[default]
ENCRYTION true +
+
+#
[megacorp/india]
TESTPATH /nfs/testing/megacorp_runs +
+
+#
[femtocorp/cook_islands]
ENCRYTION false
TESTPATH /afs/kiatoa/testing/cook_islands +
+
+#
[femtocorp/new_zealand]
TESTPATH /afs/kiatao/testing/new_zealand +
+
+#
[megacorp/new_zealand]
TESTPATH /nfs/testing/megacorp_runs
-Running megatest like this: +Running megatest like this:
megatest :CUSTOMER megacorp :LOCATION new_zealand :runname week12_2011_run1 -runall
-Would set: +Would set:
ENCRYPTION true
TESTPATH /nfs/testing/megacorp_runs

-0.3.3 Writing tests +0.3.4 Writing tests

-0.3.3.1 testconfig file +0.3.4.1 testconfig file

- - - + - + - + - + + + +
section variable @@ -705,13 +796,13 @@ required? comments
[setup] runscript @@ -723,13 +814,13 @@ yes The script must be executable and either provide the full path or put a copy at the top of your test directory
[requirements] waiton @@ -741,13 +832,13 @@ no This test will not run until the named tests are state completed and status PASS
[items] any valid @@ -759,14 +850,358 @@ no The test will be repeated once for each item with the variable name set to the value. If there is more than one variable then the test will be run against all unique combinations of the values
+ +
+

+0.3.5 Command line +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+switch or param + +parameter + +purpose + +comments +
+-h + + + +brief help + + +
+-runall + + + +run all tests + + +
+-runtests + +test1,test2,... + +run one or more tests + + +
+-step + +stepname + +record a step + +requires :state and :status +
+-test-status + + + +record the test status + +requires :state and :status +
+-setlog + +logfilename + +set the logfile name for a test + +path is assumed to be relative to the test run directory +
+-set-toplog + +logfilename + +set the logfile name for the top test in an iterated test run + +each sub test can have its own logfile set +
+-m + +“comment” + +sets a comment for the step, test or run + + +
+:runname + + + + + + +
+:state + + + + + + +
+:status + + + + + + +
+-list-runs + + + + + + +
+-testpatt + + + + + + +
+-itempatt + + + + + + +
+-showkeys + + + + + + +
+-force + + + + + + +
+-xterm + + + + + + +
+-remove-runs + + + + + + +
+Test helpers + + + + + + +
+-runstep + + + + + + +
+-logpro + + + + + + +
+
-
-

Copyright (C) 2011 Matt Welland

+ +