~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to docs/testing/randgen.rst

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
The primary documentation is here: http://forge.mysql.com/wiki/RandomQueryGenerator
16
16
 
17
17
This document is intended to help the user set up their environment so that the tool
18
 
may be used in conjunction with the dbqp.py test-runner.  The forge documentation
 
18
may be used in conjunction with the kewpie.py test-runner.  The forge documentation
19
19
contains more information on the particulars of the tool itself.
20
20
 
21
21
Requirements
49
49
Installing the randgen
50
50
=======================
51
51
 
52
 
The code may be branched from launchpad: bzr branch lp:randgen
53
 
 
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:
 
53
 
 
54
    launchpad: bzr branch lp:randgen
 
55
 
 
56
it also may be downloaded from: 
 
57
 
 
58
    http://launchpad.net/randgen/+download
55
59
 
56
60
That is all there is : )
57
61
 
58
 
Randgen / dbqp tests
59
 
====================
60
 
 
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::
65
 
 
66
 
    [test_info]
67
 
    comment = does NOT actually test the master-slave replication yet, but it will.
68
 
 
69
 
    [test_command]
70
 
    command = ./gentest.pl --gendata=conf/drizzle/drizzle.zz --grammar=conf/drizzle/optimizer_subquery_drizzle.yy --queries=10 --threads=1
71
 
 
72
 
    [test_servers]
73
 
    servers = [[--innodb.replication-log],[--plugin-add=slave --slave.config-file=$MASTER_SERVER_SLAVE_CONFIG]]
 
62
Randgen / kewpie testcases
 
63
============================
 
64
 
 
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::
 
66
 
 
67
    class basicTest(mysqlBaseTestCase):
 
68
 
 
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 "
 
74
                        "--queries=500 "
 
75
                        "--threads=5"
 
76
                       )
 
77
      retcode, output = self.execute_randgen(test_cmd, test_executor, servers)
 
78
      self.assertEqual(retcode, 0, output) ``
74
79
 
75
80
Running tests
76
81
=========================
77
82
 
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.
79
84
 
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.
84
89
 
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::
88
93
 
89
 
    ./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] test1 [test2 ... testN]
 
94
    ./kewpie --suite=randgen_basic [OPTIONS] test1 [test2 ... testN]
90
95
 
91
96
Running all tests within a suite
92
97
--------------------------------
97
102
 
98
103
To run the tests in a specific suite::
99
104
 
100
 
    ./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITENAME
 
105
    ./kewpie [OPTIONS] --suite=SUITENAME
101
106
 
102
107
Running specific tests within a suite
103
108
--------------------------------------
104
109
To run a specific set of tests within a suite::
105
110
 
106
 
    ./dbqp --mode=randgen --randgen-path=/path/to/randgen [OPTIONS] --suite=SUITENAME TEST1 [TEST2..TESTN]
 
111
    ./kewpie --suite=SUITENAME TEST1 [TEST2..TESTN]
107
112
 
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.
110
115
 
111
116
 
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::
118
123
 
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
120
125
 
121
126
Interpreting test results
122
127
=========================
160
165
Starting a server for manual testing and (optionally) populating it
161
166
--------------------------------------------------------------------
162
167
 
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.
164
169
 
165
170
To do so call::
166
171
 
167
 
    ./dbqp --mode=randgen --randgen-path=/path/to/randgen --start-and-exit [*OPTIONS*]
 
172
    ./kewpie --suite=randgen_basic --start-and-exit [*OPTIONS*]
168
173
 
169
174
This will start a Drizzle server that you can connect to and query
170
175
 
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::
173
178
 
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
175
180
    <snip>
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 ()
191
196
    # 2011-02-24T17:48:48 # Creating Drizzle table: test.BB; engine: ; rows: 10 .
192
197
    # 2011-02-24T17:48:48 # Creating Drizzle table: test.CC; engine: ; rows: 100 .
193
198
    # 2011-02-24T17:48:49 # Creating Drizzle table: test.DD; engine: ; rows: 100 .
194
 
    24 Feb 2011 17:48:49 INFO: User specified --start-and-exit.  dbqp.py exiting and leaving servers running...
 
199
    24 Feb 2011 17:48:49 INFO: User specified --start-and-exit.  kewpie.py exiting and leaving servers running...
195
200
 
196
201
 
197
202