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. In most cases megatest is best used in conjunction with logpro or a similar tool to parse, analyze and decide on the test outcome.

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.

Road Map

Note: This road-map is tentative and subject to change without notice.

ww32

  1. Rerun step and or subsequent steps from gui

  2. Refresh test area files from gui

  3. Clean and re-run button

  4. Clean up STATE and STATUS handling.

    1. Dashboard and Test control panel are reverse order - choose and fix

    2. Move seldom used states and status to drop down selector

  5. Access test control panel when clicking on Run Summary tests

  6. Feature: -generate-index-tree

  7. Change specifing of state and status to use STATE1/STATUS1,STATE2/STATUS2

ww33

  1. http api available for use with Perl, Ruby etc. scripts

  2. megatest.config setup entries for:

    1. run launching (e.g. /bin/sh %CMD% > /dev/null)

    2. browser "konqueror %FNAME%

ww34

  1. Mark dependent tests for clean/rerun -rerun-downstream

  2. On run start check for defunct tests in RUNNING, LAUNCHED or REMOTEHOSTSTART and correct or notify

  3. Fix: refresh of gui sometimes fails on last item (race condition?)

ww35

  1. refdb: Add export of csv, json and sexp

  2. Convert to using call-with-environment-variables where possible. Should allow handling of parallel runs in same process.

  3. Re-work text interface wizards. Several bugs on record. Possibly convert to gui based.

  4. Add to testconfig requirements section; launchlimiter scriptname, calls scriptname to check if ok to launch test

  5. Refactor Run Summary view, currently very clumsy

  6. Add option to show steps in Run Summary view

ww36

  1. Refactor guis for resizeablity

  2. Add filters to Run Summary view and Run Control view

  3. Add to megatest.config or testconfig; rerunok STATE/STATUS,STATE/STATUS…

  4. Launch gates for diskspace; /path/one>1G,/path/two>200M,/tmp>5G,#{scheme toppath}>1G

Bin List

  1. Quality improvements

    1. Server stutters occasionally

    2. Large number of items or tests still has some issues.

    3. Code refactoring

    4. Replace remote process with true API using json (supports Web app also)

  2. Streamline the gui

    1. Everything resizable

    2. Less clutter

    3. Tool tips

    4. Filters on Run Summary, Summary and Run Control panel

    5. Built in log viewer (partially implemented)

    6. Refactor the test control panel

  3. Help and documentation

    1. Complete the user manual (I’ve been working on this lately).

    2. Online help in the gui

  4. Streamlined install

    1. Deployed version (download a location independent ready to run binary bundle)

    2. Install Makefile (in progress, needed for Mike to install on VMs)

    3. Added option to compile IUP (needed for VMs)

  5. Server side run launching

  6. Support for re-running, cleaning etc. of individual steps (ezsteps makes this very easy to implement).

  7. Launch process needs built in daemonizing (easy to do, just need to test it thoroughly).

  8. Wizards for creating tests, regression areas (current ones are text only and limited).

  9. Fully functional built in web service (currently you can browse runs but it is very simplistic).

  10. Wildcards in runconfigs: e.g. [p1271/9/%/%]

  11. Gui panels for editing megatest.config and runconfigs.config

  12. Fully isolated tests (no use of NFS to see regression area files)

  13. Windows version

Getting Started

Getting started with Megatest

How to install Megatest and set it up for running your regressions and continuous integration process.

Installation

Dependencies

Chicken scheme and a number of "eggs" are required for building Megatest. See the script installall.sch in the utils directory of the distribution for a mostly automated way to install everything needed for building Megatest on Linux.


[An example footnote.]

And now for something completely different: monkeys, lions and tigers (Bengal and Siberian) using the alternative syntax index entries. Note that multi-entry terms generate separate index entries.

Here are a couple of image examples: an images/smallnew.png example inline image followed by an example block image:

Tiger image
Figure 1. Tiger block image

Followed by an example table:

Table 1. An example table
Option Description

-a USER GROUP

Add USER to GROUP.

-R GROUP

Disables access to GROUP.

Example 1. An example example

Lorum ipum…

Sub-section with Anchor

Sub-section at level 2.

Chapter Sub-section

Sub-section at level 3.

Chapter Sub-section

Sub-section at level 4.

This is the maximum sub-section depth supported by the distributed AsciiDoc configuration.
[A second example footnote.]

The Second Chapter

An example link to anchor at start of the first sub-section.

An example link to a bibliography entry [taoup].

Writing Tests

The First Chapter of the Second Part

Chapters grouped into book parts are at level 1 and can contain sub-sections.

How To Do Things

Tricks

This section is a compendium of a various useful tricks for debugging, configuring and generally getting the most out of Megatest.

Debugging Tricks

Examining The Environment

During Config File Processing

Organising Your Tests and Tasks

/nfs/ch/disks/ch_unienv_disk005/qa_mrwellan/interim/src/megatest/tests/fdktestqa/testqa

[tests-paths]
1 #{get misc parent}/simplerun/tests
[setup]

The runscript method is a brute force way to run scripts where the user is responsible for setting STATE and STATUS

runscript main.csh

ww30.2 cellname/LVS/cellname.LAYOUT_ERRORS

Error: text open

ww31.3 cellname/LVS/cellname.LAYOUT_ERRORS

Error: text open Reference

Chapters grouped into book parts are at level 1 and can contain sub-sections.

[setup]

The runscript method is a brute force way to run scripts where the user is responsible for setting STATE and STATUS

runscript main.csh
[requirements]
# A normal waiton waits for the prior tests to be COMPLETED
# and PASS, CHECK or WAIVED
waiton test1 test2

The default (i.e. if mode is not specified) is normal. All pre-dependent tests must be COMPLETED and PASS, CHECK or WAIVED before the test will start

mode   normal

The toplevel mode requires only that the prior tests are COMPLETED.

mode toplevel

A item based waiton will start items in a test when the same-named item is COMPLETED and PASS, CHECK or WAIVED in the prior test

mode itemmatch
# With a toplevel test you may wish to generate your list
# of tests to run dynamically
#
# waiton #{shell get-valid-tests-to-run.sh}
runtimelim 1h 2m 3s  # this will automatically kill the test if it runs for more than 1h 2m and 3s
[skip]
# NB// If the prevrunning line exists with *any* value the test will
# automatically SKIP if the same-named test is currently RUNNING

prevrunning x
fileexists /path/to/a/file # skip if /path/to/a/file exists

If test is FAIL and previous test in run with same MT_TARGET is WAIVED then apply the following rules from the testconfig: If a waiver check is specified in the testconfig apply the check and if it passes then set this FAIL to WAIVED

Waiver check has two parts, 1) a list of waiver, rulename, filepatterns and 2) the rulename script spec (note that "diff" and "logpro" are predefined)

###### EXAMPLE FROM testconfig #########
# matching file(s) will be diff'd with previous run and logpro applied
# if PASS or WARN result from logpro then WAIVER state is set
#
[waivers]
# logpro_file    rulename      input_glob
waiver_1         logpro        lookittmp.log

[waiver_rules]

# This builtin rule is the default if there is no <waivername>.logpro file
# diff   diff %file1% %file2%

# This builtin rule is applied if a <waivername>.logpro file exists
# logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html

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

$MT_MEGATEST -env2file .ezsteps/${stepname}

One or more optional appendixes go here at section level zero.

Note
Preface and appendix subsections start out of sequence at level 2 (level 1 is skipped). This only applies to multi-part book documents.

The bibliography list is a style of AsciiDoc bulleted list.

  • [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.

Glossaries are optional. Glossaries entries are an example of a style of AsciiDoc labeled lists.

A glossary term

The corresponding (indented) definition.

A second glossary term

The corresponding (indented) definition.

Text at the end of a book describing facts about its production.