49
49
Installing the randgen
50
50
=======================
52
The code may be branched from launchpad: bzr branch lp:randgen
54
it also may be downloaded from here http://launchpad.net/randgen/+download
52
Kewpie includes a branch of the randgen so it is not necessary to install it directly, but thecode may be branched from:
54
launchpad: bzr branch lp:randgen
56
it also may be downloaded from:
58
http://launchpad.net/randgen/+download
56
60
That is all there is : )
61
These tests are simple .cnf files that can define a few basic variables
62
that are needed to execute tests. The most interesting section is test_servers. It is a simple list of python lists
63
Each sub-list contains a string of server options that are needed. Each sub-list represents a server that will be started.
64
Using an empty sub-list will create a server with the default options::
67
comment = does NOT actually test the master-slave replication yet, but it will.
70
command = ./gentest.pl --gendata=conf/drizzle/drizzle.zz --grammar=conf/drizzle/optimizer_subquery_drizzle.yy --queries=10 --threads=1
73
servers = [[--innodb.replication-log],[--plugin-add=slave --slave.config-file=$MASTER_SERVER_SLAVE_CONFIG]]
62
Randgen / kewpie testcases
63
============================
65
These tests use kewpie's native mode and are essentially unittest modules. Currently, the suites are designed so that each individual modules executes a single randgen command line and validates results accordingly. An example::
67
class basicTest(mysqlBaseTestCase):
69
def test_OptimizerSubquery1(self):
70
self.servers = servers
71
test_cmd = ("./gentest.pl "
72
"--gendata=conf/percona/outer_join_percona.zz "
73
"--grammar=conf/percona/outer_join_percona.yy "
77
retcode, output = self.execute_randgen(test_cmd, test_executor, servers)
78
self.assertEqual(retcode, 0, output) ``
76
81
=========================
78
There are several different ways to run tests using :doc:`dbqp` 's randgen mode.
83
There are several different ways to run the provided randgen tests.
80
It should be noted that unless :option:`--force` is used, the program will
81
stop execution upon encountering the first failing test.
82
:option:`--force` is recommended if you are running several tests - it will
83
allow you to view all successes and failures in one run.
85
It should be noted that unless :option:`kewpie.py --force` is used, the program
86
will stop execution upon encountering the first failing test.
87
:option:`kewpie.py --force` is recommended if you are running several tests
88
- it will allow you to view all successes and failures in one run.
85
90
Running individual tests
86
91
------------------------
87
92
If one only wants to run a few, specific tests, they may do so this way::
89
./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] test1 [test2 ... testN]
94
./kewpie --suite=randgen_basic [OPTIONS] test1 [test2 ... testN]
91
96
Running all tests within a suite
92
97
--------------------------------
98
103
To run the tests in a specific suite::
100
./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITENAME
105
./kewpie [OPTIONS] --suite=SUITENAME
102
107
Running specific tests within a suite
103
108
--------------------------------------
104
109
To run a specific set of tests within a suite::
106
./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITENAME TEST1 [TEST2..TESTN]
111
./kewpie --suite=SUITENAME TEST1 [TEST2..TESTN]
108
Calling tests using <suitename>.<testname> currently does not work.
109
One must specify the test suite via the :option:`--suite` option.
113
Calling tests using <suitename>.<testname> currently does not work. One must
114
specify the test suite via the :option:`kewpie.py --suite` option.
112
117
Running all available tests
113
118
---------------------------
114
119
One would currently have to name all suites, but the majority of the working tests live in the main suite
115
120
Other suites utilize more exotic server combinations and we are currently tweaking them to better integrate with the
116
dbqp system. The slave-plugin suite does currently have a good config file for setting up simple replication setups for testing.
121
kewpie system. The slave-plugin suite does currently have a good config file for setting up simple replication setups for testing.
117
122
To execute several suites' worth of tests::
119
./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITE1, SUITE2, ...SUITEN
124
./kewpie --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITE1, SUITE2, ...SUITEN
121
126
Interpreting test results
122
127
=========================
160
165
Starting a server for manual testing and (optionally) populating it
161
166
--------------------------------------------------------------------
163
:doc:`dbqp` 's randgen mode allows a user to get a Drizzle server up and running quickly. This can be useful for fast ad-hoc testing.
168
:doc:`kewpie` 's randgen mode allows a user to get a Drizzle server up and running quickly. This can be useful for fast ad-hoc testing.
167
./dbqp --mode=randgen --randgen-path=/path/to/randgen --start-and-exit [*OPTIONS*]
172
./kewpie --suite=randgen_basic --start-and-exit [*OPTIONS*]
169
174
This will start a Drizzle server that you can connect to and query
171
176
With the addition of the --gendata option, a user may utilize the randgen's gendata (table creation and population) tool
172
177
to populate a test server. In the following example, the test server is now populated by the 8 tables listed below::
174
./dbqp --mode=randgen --randgen-path=/randgen --start-and-exit --gendata=/randgen/conf/drizzle/drizzle.zz
179
./kewpie --start-and-exit --gendata=conf/drizzle/drizzle.zz
176
181
24 Feb 2011 17:48:48 INFO: NAME: server0
177
182
24 Feb 2011 17:48:48 INFO: MASTER_PORT: 9306
179
184
24 Feb 2011 17:48:48 INFO: MC_PORT: 9308
180
185
24 Feb 2011 17:48:48 INFO: PBMS_PORT: 9309
181
186
24 Feb 2011 17:48:48 INFO: RABBITMQ_NODE_PORT: 9310
182
24 Feb 2011 17:48:48 INFO: VARDIR: /home/pcrews/bzr/work/dbqp_randgen_updates/tests/workdir/testbot0/server0/var
187
24 Feb 2011 17:48:48 INFO: VARDIR: /kewpie/tests/workdir/testbot0/server0/var
183
188
24 Feb 2011 17:48:48 INFO: STATUS: 1
184
189
# 2011-02-24T17:48:48 Default schema: test
185
190
# 2011-02-24T17:48:48 Executor initialized, id GenTest::Executor::Drizzle 2011.02.2198 ()