risto.py

A tool for plotting graphs about test execution history based on statistics read from Robot output files.

Synopsis

risto.py options input files
risto.py options1 --- options2 --- optionsN --- input files
risto.py --argumentfile path

Options

-C, --nocritical
 Does not plot graphs for critical tests.
-A, --noall Does not plot graphs for all tests.
-T, --nototals Does not plot total graphs.
-P, --nopassed Does not plot passed graphs.
-F, --nofailed Does not plot failed graphs.
-t, --tag <name>
 Adds graphs for these tags. The name can contain "*" and "?" as wildcards. "AND" in the tag name is converted to " & ", to make it easier to plot combined tags.
-o, --output <path>
 The path to the image file to create. If not given, the image is opened into Matplotlib viewer.
-i, --title <title>
 The title of the graph. Underscores in the given title are converted to spaces. By default, there is no title.
-w, --width <inches>
 The width of the image. The default is 800.
-h, --height <inches>
 The height of the image. The default is 400.
-f, --font <size>
 The font size used for legends and labels. The default is 8.
-m, --marker <size>
 The size of the marker used with tag graphs. The default is 5.
-x, --xticks <num>
 The maximum number of ticks on the x-axis. The default is 15.
-n, --namemeta <name>
 The name of the metadata of the top-level test suite where to get the name of the test round. By default, names are got from the paths to input files.
--argumentfile <path>
 Reads arguments from the specified file.
--verbose The verbose output.
--help Prints this help.
--version Prints the version information.

Additionally, --- can be used to group options when creating multiple images at once.

Description

risto.py plots graphs about test execution history, based on statistics read from Robot output files. By default, it draws total, passed and failed graphs for critical tests and all tests, but it is possible to omit some of these graphs and also to add graphs by tags. The actual drawing is handled by the Matplotlib tool that must be installed separately. More information on Matplotlib, including the installation instructions, can be found from http://matplotlib.sourceforge.net.

Names of test rounds that are shown on the x-axis are, by default, obtained from the paths to input files. Alternatively, names can be obtained from the metadata of the top-level test suite (for more information, see Robot Framework's --metadata option).

Graphs are saved to a file specified with the --output option, and the output format is determined by the file extension. The supported formats depend on the installed Matplotlib back-ends, but at least PNG ought to be always available. If the output file is omitted, the graph is opened into Matplotlib's image viewer (which requires Matplotlib to be installed with some graphical front end).

It is possible to draw several graphs with different options at once. This is done by separating different option groups with three or more hyphens (---). Note that in this case, also paths to input files need to be separated from the options similarly.

Instead of giving all options from the command line, it is possible to read them from a file specified with the --argument option. In an argument file, options and their possible arguments are listed one per line, and option groups are separated with lines of three or more hyphens. Empty lines and lines starting with a hash mark (#) are ignored.

Examples:

risto.py --output history.png output1.xml output2.xml output3.xml
        risto.py --title My_Report --noall --namemeta Date --output out.png \*.xml
risto.py --nopassed --tag smoke --tag iter-* results/\*/output.xml
risto.py -CAP -t tag1 --- -CAP -t tag2 --- -CAP -t tag3 --- outputs/*.xml
risto.py --argumentfile arguments.txt

 ====[arguments.txt]===================
--title Overview
--output overview.png
----------------------
--nocritical
--noall
--nopassed
--tag smoke1
--title Smoke Tests
--output smoke.png
----------------------
path/to/*.xml
======================================

Installation

Here you can find the instructions for the installation of risto.py.

Preconditions

risto.py requires Python. It has been tested both on releases 2.4 and 2.5, and it should work also in 2.3. Also some Robot Framwork modules are needed, and thus some Robot Framework version 1.8 needs to be installed.

The Matplotlib tool is used for plotting graphs, and it needs to be installed separately. Matplotlib has its own preconditions, and at least NumPy needs to be installed. The default Matplotlib installation should always support at least PNG, but if more output formats are needed, some extra back ends may need to be installed. Additionally, you may need to install graphical front ends to be able to use Matplotlib's own viewer for opening graphs without saving them to a file.

risto.py reads statistics from output files using the ElementTree module. Python 2.5 has this module in its standard library, but for older versions, it needs to be installed separately.

Links to the needed software:

Screenshots

Here you can find some screenshots of risto.py.

Default settings

The screenshot below uses some very simple example outputs, thus the lines are mainly straight. The default settings have been used otherwise, but the output has been saved into a file with the --output default.png option.

risto_default.png

Simple example output

Various settings

The example outputs used in this screenshot are the same as in the previous one, but now the following options have been specified:

--nopassed --noall --tag f1 --title Another_Example --width 600 --height 250 --font 6 --marker 3 --output another.png
risto_another.png

Another example output

Using Matplotlib's Viewer

This time there are more input files and the image has been opened in Matplotlib's viewer (that is, the --output option has not been used). The options used to create this example are the ones below:

-CAP -t d1_AND_d2 -t t1 -t sub3 -i Yet_Another_Example -x 20 -w 1000 -n Name
risto_yetanother.png

More complex example output

More Realistic Examples

These examples are generated from actual test outputs using the following argument file:

--title Overview
--output overview.png
-----------------
--title DRT Tests
--nocritical
--noall
--tag phase-drt
-nofailed
--output drt.png
------------------
path/\*/output.xml
risto_overview.png

Example overview

risto_drt.png

Example DRT tests