~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/testing/dbqp.rst

  • Committer: patrick crews
  • Date: 2011-02-23 17:17:25 UTC
  • mto: (2195.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2196.
  • Revision ID: gleebix@gmail.com-20110223171725-4tgewemxhsw1m7q8
Integrated randgen with dbqp.  We now have mode=randgen and a set of randgen test suites (very basic now).  Output = same as dtr : )  We also have mode=cleanup to kill any servers we have started.  Docs updates too.  Gendata utility allows us to populate test servers 

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
:program:`dbqp.py` is BETA software.  It is intended to provide a standardized
14
14
platform to facilitate Drizzle testing.  
15
15
 
16
 
Currently, it only serves as a partial substitute for test-run.pl.
17
 
One can execute the test suite, record test cases, and use certain other options.
18
 
Other test-run.pl option such as gdb and valgrind are still in-development.
19
 
 
20
 
The current mode is 'dtr' and is used to execute tests from the Drizzle 
 
16
The default mode is 'dtr' and is used to execute tests from the Drizzle 
21
17
test suite.  These tests are included with Drizzle distributions and 
22
18
provide a way for users to verify that the system will operate according
23
19
to expectations.
28
24
highlighting the differences found between expected and actual results; this
29
25
can be useful for troubleshooting and in bug reports.
30
26
 
 
27
The program is also integrated with the random query generator testing tool
 
28
and a 'rangden' mode is available - it will execute randgen tests when
 
29
provided a path to a randgen installation.  Tests are organized similar to dtr
 
30
tests, but are .cnf file based.
 
31
 
 
32
A 'cleanup' mode is also available as a convenience - it will simply shutdown
 
33
any servers that may have been started via start-and-exit.
 
34
 
31
35
While most users are concerned with ensuring general functionality, the 
32
36
program also allows a user to quickly spin up a server for ad-hoc testing
33
37
and to run the test-suite against an already running Drizzle server.
150
154
 
151
155
NOTE: This feature is still being tested, use caution with your data!!!
152
156
 
 
157
Randgen mode / Executing randgen tests
 
158
---------------------------------------
 
159
 
 
160
Using :option:`--mode` =randgen and :option:`--randgen-path` =/path/to/randgen
 
161
will cause the randgen tests to execute.  This are simple .cnf file-based
 
162
tests that define various randgen command lines that are useful in testing
 
163
the server.  Test organization is similar to the dtr tests.  Tests live in 
 
164
suites, the default suite is 'main' and they all live in
 
165
drizzle/tests/randgen_tests::
 
166
 
 
167
        ./dbqp.py --mode=randgen --randgen-path=/path/to/randgen
 
168
 
 
169
A user may specify suites and individual tests to run, just as with dtr-based
 
170
testing.  Test output is the same as well::
 
171
 
 
172
    ./dbqp --mode=randgen --randgen-path=/home/username/repos/randgen
 
173
    Setting --no-secure-file-priv=True for randgen mode...
 
174
    <snip>
 
175
    23 Feb 2011 11:42:43 INFO: Using testing mode: randgen
 
176
    <snip>
 
177
    23 Feb 2011 11:44:58 : ================================================================================
 
178
    23 Feb 2011 11:44:58 : TEST NAME                                               [ RESULT ]    TIME (ms)
 
179
    23 Feb 2011 11:44:58 : ================================================================================
 
180
    23 Feb 2011 11:44:58 : main.optimizer_subquery                                 [ pass ]       134153
 
181
    23 Feb 2011 11:45:03 : main.outer_join                                         [ pass ]         5136
 
182
    23 Feb 2011 11:45:06 : main.simple                                             [ pass ]         2246
 
183
    23 Feb 2011 11:45:06 : ================================================================================
 
184
    23 Feb 2011 11:45:06 INFO: Test execution complete in 142 seconds
 
185
    23 Feb 2011 11:45:06 INFO: Summary report:
 
186
    23 Feb 2011 11:45:06 INFO: Executed 3/3 test cases, 100.00 percent
 
187
    23 Feb 2011 11:45:06 INFO: STATUS: PASS, 3/3 test cases, 100.00 percent executed
 
188
    23 Feb 2011 11:45:06 INFO: Spent 141 / 142 seconds on: TEST(s)
 
189
    23 Feb 2011 11:45:06 INFO: Test execution complete
 
190
    23 Feb 2011 11:45:06 INFO: Stopping all running servers...
 
191
 
 
192
Cleanup mode
 
193
-------------
 
194
A cleanup mode is provided for user convenience.  This simply shuts down
 
195
any servers whose pid files are detected in the dbqp workdir.  It is mainly
 
196
intended as a quick cleanup for post-testing with :option:`--start-and-exit`::
 
197
 
 
198
        ./dbqp.py --mode=cleanup
 
199
 
 
200
    Setting --start-dirty=True for cleanup mode...
 
201
    23 Feb 2011 11:35:59 INFO: Using Drizzle source tree:
 
202
    23 Feb 2011 11:35:59 INFO: basedir: drizzle
 
203
    23 Feb 2011 11:35:59 INFO: clientbindir: drizzle/client
 
204
    23 Feb 2011 11:35:59 INFO: testdir: drizzle/tests
 
205
    23 Feb 2011 11:35:59 INFO: server_version: 2011.02.2188
 
206
    23 Feb 2011 11:35:59 INFO: server_compile_os: unknown-linux-gnu
 
207
    23 Feb 2011 11:35:59 INFO: server_platform: x86_64
 
208
    23 Feb 2011 11:35:59 INFO: server_comment: (Source distribution (dbqp_randgen))
 
209
    23 Feb 2011 11:35:59 INFO: Using --start-dirty, not attempting to touch directories
 
210
    23 Feb 2011 11:35:59 INFO: Using default-storage-engine: innodb
 
211
    23 Feb 2011 11:35:59 INFO: Using testing mode: cleanup
 
212
    23 Feb 2011 11:35:59 INFO: Killing pid 10484 from drizzle/tests/workdir/testbot0/server0/var/run/server0.pid
 
213
    23 Feb 2011 11:35:59 INFO: Stopping all running servers...
 
214
 
153
215
Program architecture
154
216
====================
155
217
 
156
 
:program:`dbqp.py` uses a simple diff-based mechanism for testing.  
 
218
:program:`dbqp.py`'s 'dtr' mode uses a simple diff-based mechanism for testing.
 
219
This is the default mode and where the majority of Drizzle testing occurs.  
157
220
It will execute the statements contained in a test and compare the results 
158
221
to pre-recorded expected results.  In the event of a test failure, you
159
222
will be presented with a diff::
225
288
   Don't try to cleanup from earlier runs 
226
289
   (currently just a placeholder) [False]
227
290
 
 
291
.. option:: --randgen-path=RANDGENPATH
 
292
 
 
293
    The path to a randgen installation that can be used to
 
294
    execute randgen-based tests
 
295
 
 
296
 
228
297
Options for controlling which tests are executed
229
298
------------------------------------------------
230
299
.. option:: --suite=SUITELIST
255
324
   for the given mode [False]
256
325
 
257
326
.. option:: --repeat=REPEAT     
 
327
 
258
328
    Run each test case the specified number of times.  For
259
329
    a given sequence, the first test will be run n times,
260
330
    then the second, etc [1]
329
399
 
330
400
 
331
401
Options for defining the tools we use for code analysis (valgrind, gprof, gcov, etc)
332
 
---------------------------------------------------------------------------------------
 
402
------------------------------------------------------------------------------------
333
403
.. option:: --valgrind          
334
404
 
335
405
   Run drizzletest and drizzled executables using
341
411
   valgrind options)
342
412
 
343
413
Options for controlling the use of debuggers with test execution
344
 
------------------------------------------------------------------
 
414
----------------------------------------------------------------
345
415
.. option:: --gdb
346
416
 
347
417
    Start the drizzled server(s) in gdb
351
421
    Allows you to start the drizzled server(s) in gdb
352
422
    manually (in another window, etc
353
423
 
 
424
Options to call additional utilities such as datagen
 
425
------------------------------------------------------
 
426
.. option:: --gendata=GENDATAFILE
 
427
            
 
428
    Call the randgen's gendata utility to use the
 
429
    specified configuration file.  This will populate the
 
430
    server prior to any test execution
 
431
 
 
432
 
354
433
    
355
434
 
356
435