Decorators
**********







A decorator is used to add some data on information found in the database of
execution results. It's important to note that decoration is runned before the
any reports, and once for all in a *runreports* execution. So every reports will
get the same decorated data, there is no way for the moment to specify different
decorators for different reports without creating them by reexecuting
runreports.

APyCot comes with the following decorators. If you don't find the feature
you're  looking for, you may still write your own decorator, and contribute
it ;). The best way to do so for the moment is to look at the existant ones...
Some decorators depends on a third-party program (usually a Python package or
an external command), so they may be not available according to your system
setup. 


activity
````````
:description:
  This decorator add a dummy check to each test, with a status sets to *active* or
  to *sleep* according to the activity detection result. Activity detection is
  done by extracting log messages from the source repositories for days until the
  plan execution date (see option below). Log messages extracted are added in the
  check. 
:options:
  +-------------+-----+--------------------------------------------------------+
  |    name     | req |   description                                          |
  +=============+=====+========================================================+
  | time        | no  | number of time interval (day or hourly according to    |
  |             |     | the mode to consider (default to 1)                    |
  +-------------+-----+--------------------------------------------------------+


contest
```````
:description:
  This decorator add a dummy check to each test, with a status sets to a number
  representing the rank of the test in the contest. Rank is evaluated by a
  customizable set of raw values to compare (the highest is the best). Used values
  are added to the check.
:options:
  +-------------+-----+--------------------------------------------------------+
  |    name     | req |   description                                          |
  +=============+=====+========================================================+
  | fields      | yes | list of raw fields to consider                         |
  +-------------+-----+--------------------------------------------------------+
  | expression  | yes | a python expression calculating the contest rating for |
  |             |     | a test (selected fields are available as variables)    |
  +-------------+-----+--------------------------------------------------------+
