summaryrefslogtreecommitdiff
path: root/yarns/300-running.yarn
blob: c1962805c3dc246c41f27bce5b222ff5aefcd4c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Running obbench

To run obbench we need to set up a benchmark specification. The
examples below use the [yarn][] syntax, as they also form an automated
test suite for obbench.

[yarn]: http://liw.fi/cmdtest/

    SCENARIO running obbench

For this example, we use a very simple benchmark specification. Note
that due to yarn syntax limitations, we use the JSON variant of YAML.

    GIVEN a benchmark specification file simple.yaml containing
    ... {
    ...     git: "/home/liw/code/obnam/obnam",
    ...     description: "Sample benchmark description.\n\n**There you go.**",
    ...     benchmarks: [
    ...         {
    ...             name: silly,
    ...             description: "It's a silly benchmark",
    ...             steps: [
    ...                 {
    ...                     live: "genbackupdata --create=1k .",
    ...                     obnam: backup
    ...                 },
    ...                 {
    ...                     obnam: restore,
    ...                 }
    ...             ]
    ...         },
    ...         {
    ...             name: moresilly,
    ...             description: "It's **another** silly benchmark!",
    ...             steps: [
    ...                 {
    ...                     live: "genbackupdata --create=1k .",
    ...                     obnam: backup
    ...                 },
    ...                 {
    ...                     obnam: backup
    ...                 },
    ...             ]
    ...         }
    ...     ]
    ... }

We also create a local configuration, also using YAML's JSON syntax:

    GIVEN an obbench configuration file local.yaml containing
    ... {
    ...     config: {
    ...         state: "statedir"
    ...     }
    ... }

We then run obbench for the first time, for several commits. We run it
twice for the tip of master, so that we know obbench handles running
it twice for the same commit (e.g., because of environmental changes).

    WHEN I run obbench --config local.yaml simple.yaml 
    ... master~1 master master

We now have some results.

    THEN directory statedir exists
    AND directory statedir/git/.git exists
    AND files matching statedir/results/*.yaml exist
    AND file statedir/html/index.html exists
    AND file statedir/html/obbench.css exists