1 | ===================== |
---|
2 | Stress Tests for Kofa |
---|
3 | ===================== |
---|
4 | |
---|
5 | Stress- and performance tests in here are based on the Python package |
---|
6 | `multi-mechanize`. See the homepage |
---|
7 | http://testutils.org/multi-mechanize/ for details. |
---|
8 | |
---|
9 | Installation |
---|
10 | ------------ |
---|
11 | |
---|
12 | The stuff in here is basically buildout-based. But as two of the |
---|
13 | required packages (namely `matplotlib`) seem not to cope very well |
---|
14 | with `setuptools`, we have to install them locally before running |
---|
15 | 'bootstrap.py'. |
---|
16 | |
---|
17 | To make it work, you need a Python with the packages |
---|
18 | `multi-mechanize`, `numpy`, and `matplotlib` installed. |
---|
19 | |
---|
20 | I'm used to install such packages in a virtual environment like this:: |
---|
21 | |
---|
22 | $ virtualenv --no-site-packages mysandbox |
---|
23 | $ source mysandbox/bin/activate |
---|
24 | |
---|
25 | Afterwards the required packages can be installed into this sandbox:: |
---|
26 | |
---|
27 | (mysandbox) $ pip install numpy |
---|
28 | (mysandbox) $ pip install matplotlib |
---|
29 | (mysandbox) $ pip install multi-mechanize |
---|
30 | |
---|
31 | Especially `matplotlib` is very demanding regarding already installed |
---|
32 | (C and C++) libraries. On my Ubuntu I had to install at least:: |
---|
33 | |
---|
34 | $ sudo apt-get install libfreetype6-dev |
---|
35 | $ sudo apt-get install libpng12-dev |
---|
36 | |
---|
37 | to make it compile and install. |
---|
38 | |
---|
39 | Afterwards we can run buildout:: |
---|
40 | |
---|
41 | (mysandbox) $ python bootstrap.py |
---|
42 | |
---|
43 | which will generate the local buildout script. We use it:: |
---|
44 | |
---|
45 | (mysandbox) $ ./bin/buildout |
---|
46 | |
---|
47 | will take a long time. It installs local Kofa instances in the |
---|
48 | 'instances/' dir and generates some scripts we will need. |
---|
49 | |
---|
50 | Before we can really do stress tests, we need the local instances to |
---|
51 | be bootstrapped/buildouted once:: |
---|
52 | |
---|
53 | (mysandbox) $ ./bin/bootstrap_instances |
---|
54 | |
---|
55 | takes care for that. It runs bootstrap.py and buildout for each |
---|
56 | instance in 'instances/'. |
---|
57 | |
---|
58 | Finally, the stress tests can be run. |
---|
59 | |
---|
60 | Running Stresstests |
---|
61 | ------------------- |
---|
62 | |
---|
63 | The different stress tests are put into different multi-mechanize |
---|
64 | 'projects'. Each project runs a certain stress test for which you have |
---|
65 | to setup certain things to make it work. |
---|
66 | |
---|
67 | Basically, you run a stresstest like this:: |
---|
68 | |
---|
69 | (mysandbox) $ ./bin/multimech-run <PROJECT> |
---|
70 | |
---|
71 | where ``<PROJECT>`` is one of the directories in here like 'kofa01'. |
---|
72 | |
---|
73 | So,:: |
---|
74 | |
---|
75 | (mysandbox) $ ./bin/multimech-run kofa01 |
---|
76 | |
---|
77 | should give some results. |
---|
78 | |
---|
79 | The projects in here are the subdirectories, each one representing a |
---|
80 | different 'project' or kind of stresstest. Please see the respective |
---|
81 | README files in this folder to learn what conditions must be met to |
---|
82 | run each test. |
---|
83 | |
---|
84 | Please keep in mind, that these tests normally require some local or |
---|
85 | remote setup, for instance a running Kofa instance with certain |
---|
86 | reachable URLs. Again, you can lookup the specific READMEs in this |
---|
87 | directory to learn what setup is required to run a certain test. |
---|