-
Notifications
You must be signed in to change notification settings - Fork 2
HelloWorld
-
Build a Tapper from CPAN only
-
Initialize a ~/.tapper/ with user-config, SQLite databases and examples
-
Run the central daemons for collecting test reports and the query api
-
Run the web gui to view reports
Essentially it's the test result database without automation.
$ 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::cpanminussudo apt-get install libsqlite3-dev
sudo apt-get install libexpat1-dev
sudo apt-get install libxml2-dev
sudo apt-get install libz-devSome workarounds, until we know better:
cpanm --force Template::Plugin::AutoformatNow we go on normally:
$ cpanm Task::Tapper::Hello::WorldAnd another workaround:
$ cpanm TAPPER/Tapper-Cmd-4.1.1.tar.gz
$ cpanm TAPPER/Tapper-CLI-4.1.1.tar.gz$ tapper init --defaultYou 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-apiSeveral 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 $ 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
The utility libraries should be accessible, here we made
tapper-autoreport directly available. See
http://github.com/tapper/Tapper-autoreport for more.
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.
$ cd $HOME/.tapper/hello-world/02-query-api/
$ cat hello.tt | netcat localhost 7358
Planned tests:
5
5
5
5The 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.10Now 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.10You can also directly pipe such a result into gnuplot:
$ cat benchmarks-gnuplot.tt | netcat localhost 7358 | gnuplot
$ eog example-03-benchmarks.pngSee http://template-toolkit.org for more information about the template language.
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.
- About
- Deployment
- Hello World - easiest start