Skip to content

UnobtrusiveAutomation

Tapper team edited this page Mar 30, 2016 · 19 revisions

Overview

This is a follow-up to HelloWorld. Prepare that first and then come back here.

Install scheduler

cpanm Task::Tapper::Hello::World::Automation

Run Tapper automation

Start Tapper daemons

You need two automation daemons running, e.g. in several terminals/screen/tmux.

  • Automation - Master control program
tapper-mcp
  • Automation - event queue
tapper-mcp-messagereceiver

Create some queues

(There is also always a default 'AdHoc' queue.)

tapper queue-new --name x86 --priority=100 --active
tapper queue-new --name arm --priority=100 --active

Create some hosts

tapper host-new --active --queue x86 --name einstein
tapper host-new --active --queue x86 --name hawking
tapper host-new --active --queue x86 --name newton

tapper host-new --active --queue arm --name ali
tapper host-new --active --queue arm --name hug
tapper host-new --active --queue arm --name dekkers

We should now have a small pool organized in 2 queues:

tapper host-list -v
   ID |     Name | Features   |      Active | Testrun ID | Comment | Queues
===========================================================================
    4 |      ali |            |      active |       free |         | arm
    6 |  dekkers |            |      active |       free |         | arm
    1 | einstein |            |      active |       free |         | x86
    2 |  hawking |            |      active |       free |         | x86
    5 |      hug |            |      active |       free |         | arm
    3 |   newton |            |      active |       free |         | x86

Create a testplan

Testplans are usually a complex but targeted config over multiple machines and tests.

  • View self documentation of a testplan:
tapper testplan-new --file ~/.tapper/testplans/topic/helloworld/example01 -g
  • Enqueue the testplan:
tapper testplan-new --file ~/.tapper/testplans/topic/helloworld/example01
  • Enqueue another testplan
tapper testplan-new --file ~/.tapper/testplans/topic/helloworld/example02

View currently scheduled testruns:

The above test plans fan out into multiple test runs potentially running on different machines, different programs, etc. What single test runs are now scheduled, or running or finished can be viewed with:

tapper testrun-list --schedule --verbose
tapper testrun-list --running --verbose
tapper testrun-list --finished --verbose

or at http://localhost:3000/tapper/testruns

Start single testrun

To queue in a single test run with a program on some queue or host, you can use testrun-new:

tapper testrun-new --topic HelloWorld --queue x86 --requested_host einstein --macroprecond ~/.tapper/hello-world/macropreconditions/run-hello-world-tests.mpc

Note that it's a macro precondition, allowing you to write dynamic precondition templates parameterized with -Dkey=value very similar to the test plans above. The difference is that test runs are the actual scheduling unit running on one particular host and usually running a single test program. A testplan is an organizational structure to wrap multiple tests into a common, well, plan.

Continuous testruns

Test runs can be used for continuous execution, just append --auto_rerun:

tapper testrun-new --topic HelloWorld --queue x86 --requested_host einstein --macroprecond ~/.tapper/hello-world/macropreconditions/run-hello-world-tests.mpc --auto_rerun

This means that when this test run actually gets started (state switches from "schedule" into "running"), a copy of the original testrun preconditions is put into the same queue on top again (again with the auto_rerun flag). When that copy testrun is scheduled depends on the other testruns in that queue, other queues, host availability, etc.

Please note, that the macro expansion has already happened during creation of the first such testrun, so the rerun preconditions will be the very same as the first testrun. If you need dynamic preconditions evaluated when the test gets scheduled you need "precondition producers", as described in the Tapper manual section 6.17 "Precondition Producers", pg 46ff.

View results and testruns

at

Done.

That was an easy introduction to the automation. Here we started our testruns locally.

Tapper can also set up machines from scratch by letting them boot via NFS and TFTP, let them self-install, reboot and execute its tests. Tapper provides several approaches: a built-in image-based installer, autoyast/kickstart/debinstall integration, and via Cobbler. However, this requires some configuration on your network infrastructure.

To deploy such a full heavy weight automation to run a server pool for Linux kernel and virtualization, you should discuss your use-case at IRC irc.freenode.net/#tapper and have a look at Deployment.

Switching to MySQL

Before you start filling the database with serious data, remember to early switch to MySQL.

Quick Links

About

Release changelogs

  • 5.0 2016-03 "Max Headroom"
  • 4.1 2012-10 "Cagney&Lacey"
  • 4.0 2012-05 "Columbo"
  • 3.0 2011-03 - public release
  • 2.0 2008-12 "Lastwagenkrieg"
  • 1.0 2007-12 - internal prototype

Development

Clone this wiki locally