13
13
:program:`dbqp.py` is BETA software. It is intended to provide a standardized
14
14
platform to facilitate Drizzle testing.
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.
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
28
24
highlighting the differences found between expected and actual results; this
29
25
can be useful for troubleshooting and in bug reports.
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.
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.
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.
151
155
NOTE: This feature is still being tested, use caution with your data!!!
157
Randgen mode / Executing randgen tests
158
---------------------------------------
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::
167
./dbqp.py --mode=randgen --randgen-path=/path/to/randgen
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::
172
./dbqp --mode=randgen --randgen-path=/home/username/repos/randgen
173
Setting --no-secure-file-priv=True for randgen mode...
175
23 Feb 2011 11:42:43 INFO: Using testing mode: randgen
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...
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`::
198
./dbqp.py --mode=cleanup
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...
153
215
Program architecture
154
216
====================
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::