Skip to content
renormalist edited this page Nov 20, 2012 · 36 revisions

Overview

Overview

  1. Build a Tapper from CPAN only

  2. Initialize a ~/.tapper/ with user-config, SQLite databases and examples

  3. Run the central daemons for collecting test reports and the query api

  4. Run the web gui to view reports

Essentially it's the test result database without automation.

Install

Install your own Perl

$ curl -kL http://install.perlbrew.pl | bash
$ source ~/perl5/perlbrew/etc/bashrc
  # (and also add this line to your ~/.bashrc)
$ perlbrew install perl-5.16.2
$ perlbrew switch perl-5.16.2
$ curl -L http://cpanmin.us | perl - App::cpanminus

Install libraries

sudo apt-get install libsqlite3-dev
sudo apt-get install libexpat1-dev
sudo apt-get install libxml2-dev
sudo apt-get install libz-dev

Install Tapper

Some workarounds, until we know better:

cpanm --force Template::Plugin::Autoformat

Now we go on normally:

$ cpanm Task::Tapper::Hello::World

And another workaround:

$ cpanm TAPPER/Tapper-Cmd-4.1.1.tar.gz
$ cpanm TAPPER/Tapper-CLI-4.1.1.tar.gz

Initialize Tapper

$ tapper init --default

Try Tapper

Start Tapper daemons

You need several daemons running, e.g. in several terminals.

  • Web interface to browse reports:
  $ tapper_reports_web_server.pl
  • Reports receiver:
  $ tapper-reports-receiver
  • Reports query API
  $ tapper-reports-api

Execute tests

Set your environment

Several env vars are used to specify where the central server is, here it's about where to send test results. For this hello-world we point them to our localhost:

  $ cd $HOME/.tapper/hello-world/00-set-environment
  $ source local-tapper-env.inc

Run example tests and report results

  $ cd $HOME/.tapper/hello-world/01-executing-tests/

You can execute the scripts with prove (already available in your Linux distro) which executes the tests but does not report results to the server:

$ prove     t/basic/example-01-basic.t
$ prove -v  t/basic/example-01-basic.t
$ prove -r  t/                           # recursive
$ prove -rv t/                           # verbose
$ prove -r  t/basic                      # subset only
$ prove -r  t/complex                    # subset only

For running the tests inclusive reporting their results to the Tapper server (defined by $TAPPER_REPORT_SERVER) you execute them directly:

$ t/basic/
$ for t in $(find t/ -name "*.t") ; do $t ; done

More info

The utility libraries should be accessible, here we made tapper-autoreport directly available. See http://github.com/tapper/Tapper-autoreport for more.

Evaluate tests

The query API works by sending templates to the server which are evaluated and sent back. Inside the templates you use a query language to fetch values from the test results db.

Simple results

  $ cd $HOME/.tapper/hello-world/02-query-api/
  $ cat hello.tt | netcat localhost 7358
    Planned tests:
       5
       5
       5
       5

Benchmarks

The mechanism is the same, just the templates are more complex, e.g. to select values that are deeper embedded in the test results:

  $ cat benchmarks.tt | netcat localhost 7358
    Benchmarks:
       1995.10
       1995.10
       1995.10
       1995.10

Now let's generate a gnuplot file with those data:

  $ cat benchmarks-gnuplot.tt | netcat localhost 7358
    #! /usr/bin/env gnuplot
    TITLE = "Example bogomips"
    set title TITLE offset char 0, char -1
    set style data linespoints
    set xtics rotate by 45
    set xtics out offset 0,-2.0
    set term png size 1200, 800
    set output "example-03-benchmarks.png"
    
    plot '-' using 1:2 with linespoints lt 3 lw 1 title "ratio"
    
           19 1995.10
           25 1995.10
           31 1995.10
           32 1995.10

You can also directly pipe such a result into gnuplot:

  $ cat benchmarks-gnuplot.tt | netcat localhost 7358 | gnuplot
  $ eog example-03-benchmarks.png

See http://template-toolkit.org for more information about the template language.

Done.

That was the easy part - everything without automation.

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

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