1
**********************************
2
test-run.pl - Drizzle testing tool
3
**********************************
8
**./test-run** [ *OPTIONS* ] [ TESTCASE ]
13
:program:`test-run.pl` (aka test-run, dtr, mtr) is used to execute tests
14
from the Drizzle test suite. These tests are included with Drizzle
15
distributions and provide a way for users to verify that the system will
16
operate according to expectations.
18
The tests use a diff-based paradigm, meaning that the test runner executes
19
a test and then compares the results received with pre-recorded expected
20
results. In the event of a test failure, the program will provide output
21
highlighting the differences found between expected and actual results; this
22
can be useful for troubleshooting and in bug reports.
24
While most users are concerned with ensuring general functionality, the
25
program also allows a user to quickly spin up a server for ad-hoc testing
26
and to run the test-suite against an already running Drizzle server.
29
=========================
31
There are several different ways to run tests using :program:`test-run.pl`.
33
It should be noted that unless :option:`--force` is used, the program will
34
stop execution upon encountering the first failing test.
35
:option:`--force` is recommended if you are running several tests - it will
36
allow you to view all successes and failures in one run.
38
Running individual tests
39
------------------------
40
If one only wants to run a few, specific tests, they may do so this way::
42
./test-run [OPTIONS] test1 [test2 ... testN]
44
Running all tests within a suite
45
--------------------------------
46
Many of the tests supplied with Drizzle are organized into suites.
48
The tests within drizzle/tests/t are considered the 'main' suite.
49
Other suitesare located in either drizzle/tests/suite or within the various
50
directories in drizzle/plugin. Tests for a specific plugin should live in
51
the plugin's directory - drizzle/plugin/example_plugin/tests
53
To run the tests in a specific suite::
55
./test-run [OPTIONS] --suite=SUITENAME
57
Running all available tests
58
---------------------------
59
Currently, the quickest way to execute all tests in all suites is
60
to use 'make test' from the drizzle root.
62
Otherwise, one should simply name all suites::
64
./test-run [OPTIONS] --suite=SUITE1, SUITE2, ...SUITEN
66
Interpreting test results
67
=========================
68
The output of the test runner is quite simple. Every test should pass.
69
In the event of a test failure, please take the time to file a bug.
71
At the end of a run, the program will provide the user with a listing
73
* how many tests passed
74
* how many tests failed
75
* a listing of failing tests
76
* total time spent executing the tests
80
--------------------------------------------------------------------------------
82
Failed 10/231 tests, 95.67% were successful.
84
The log files in var/log may give you some hint
86
If you want to report this error, go to:
87
http://bugs.launchpad.net/drizzle
88
The servers were restarted 16 times
89
Spent 64.364 of 115 seconds executing testcases
91
drizzle-test-run in default mode: *** Failing the test(s): main.exp1
92
main.func_str main.loaddata main.null main.outfile main.subselect3
93
main.warnings jp.like_utf8 jp.select_utf8 jp.where_utf8
97
Starting a server for manual testing
98
------------------------------------
100
:program:`test-run.pl` allows a user to get a Drizzle server up and running
101
quickly. This can be useful for fast ad-hoc testing.
105
./test-run --start-and-exit [*OPTIONS*]
107
..This will start a Drizzle server that you can connect to and query
109
Starting a server against a pre-populated DATADIR
110
--------------------------------------------------
112
Using :option:`--start-dirty` prevents :program:`test-run.pl` from attempting
113
to initialize (clean) the datadir. This can be useful if you want to use
114
an already-populated datadir for testing.
119
:program:`test-run.pl` uses a simple diff-based mechanism for testing.
120
It will execute the statements contained in a test and compare the results
121
to pre-recorded expected results. In the event of a test failure, you
122
will be presented with a sample diff::
125
--- drizzle/tests/r/exp1.result 2010-11-02 02:10:25.107013998 +0300
126
+++ drizzle/tests/r/exp1.reject 2010-11-02 02:10:32.017013999 +0300
134
A test case consists of a .test and a .result file. The .test file includes
135
the various statements to be executed for a test. The .result file lists
136
the expected results for a given test file. These files live in tests/t
137
and tests/r, respectively. This structure is the same for all test suites.
142
The :program:`test-run.pl` tool has several available options:
144
./test-run [ OPTIONS ] [ TESTCASE ]
146
Options to control what engine/variation to run
147
-----------------------------------------------
149
.. option:: --compress
151
Use the compressed protocol between client and server
153
.. option:: ----bench
155
Run the benchmark suite
157
.. option:: --small-bench
159
Run the benchmarks with --small-tests --small-tables
161
Options to control directories to use
162
-------------------------------------
164
.. option:: --benchdir=DIR
166
The directory where the benchmark suite is stored
167
(default: ../../mysql-bench)
169
.. option:: --tmpdir=DIR
171
The directory where temporary files are stored
172
(default: ./var/tmp).
174
.. option:: --vardir=DIR
176
The directory where files generated from the test run
177
is stored (default: ./var). Specifying a ramdisk or
178
tmpfs will speed up tests.
182
Run testsuite in "memory" using tmpfs or ramdisk
183
Attempts to find a suitable location
184
using a builtin list of standard locations
186
The option can also be set using environment
187
variable DTR_MEM=[DIR]
189
Options to control what test suites or cases to run
190
---------------------------------------------------
194
Continue to run the suite after failure
196
.. option:: --do-test=PREFIX or REGEX
198
Run test cases which name are prefixed with PREFIX
201
.. option:: --skip-test=PREFIX or REGEX
203
Skip test cases which name are prefixed with PREFIX
206
.. option:: --start-from=PREFIX
208
Run test cases starting from test prefixed with PREFIX
209
suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
211
The default is: "main,jp"
213
.. option:: --skip-rpl
215
Skip the replication test cases.
216
combination="ARG1 .. ARG2" Specify a set of "drizzled" arguments for one
219
.. option:: --skip-combination
221
Skip any combination options and combinations files
223
.. option:: --repeat-test=n
225
How many times to repeat each test (default: 1)
227
Options that specify ports
228
--------------------------
230
.. option:: --master_port=PORT
232
Specify the port number used by the first master
234
.. option:: --slave_port=PORT
236
Specify the port number used by the first slave
238
.. option:: --dtr-build-thread=#
240
Specify unique collection of ports. Can also be set by
241
setting the environment variable DTR_BUILD_THREAD.
243
Options for test case authoring
244
-------------------------------
246
.. option:: --record TESTNAME
248
(Re)genereate the result file for TESTNAME
250
.. option:: --check-testcases
252
Check testcases for sideeffects
254
.. option:: --mark-progress
256
Log line number and elapsed time to <testname>.progress
258
Options that pass on options
259
----------------------------
261
.. option:: --drizzled=ARGS
263
Specify additional arguments to "drizzled"
265
Options to run test on running server
266
-------------------------------------
270
Use running server for tests
272
.. option:: --user=USER
274
User for connection to extern server
276
Options for debugging the product
277
---------------------------------
279
.. option:: --client-ddd
281
Start drizzletest client in ddd
283
.. option:: --client-debugger=NAME
285
Start drizzletest in the selected debugger
287
.. option:: --client-gdb
289
Start drizzletest client in gdb
293
Start drizzled in ddd
297
Dump trace output for all servers and client programs
299
.. option:: --debugger=NAME
301
Start drizzled in the selected debugger
305
Start the drizzled(s) in gdb
307
.. option:: --manual-debug
309
Let user manually start drizzled in debugger, before running test(s)
311
.. option:: --manual-gdb
313
Let user manually start drizzled in gdb, before running test(s)
315
.. option:: --manual-ddd
317
Let user manually start drizzled in ddd, before running test(s)
319
.. option:: --master-binary=PATH
321
Specify the master "drizzled" to use
323
.. option:: --slave-binary=PATH
325
Specify the slave "drizzled" to use
327
.. option:: --strace-client
329
Create strace output for drizzletest client
331
.. option:: --max-save-core
333
Limit the number of core files saved (to avoid filling up disks for
334
heavily crashing server). Defaults to 5, set to 0 for no limit.
336
Options for coverage, profiling etc
337
-----------------------------------
345
See online documentation on how to use it.
347
.. option:: --valgrind
349
Run the *drizzletest* and *drizzled* executables using valgrind with
352
.. option:: --valgrind-all
354
Synonym for :option:`--valgrind`
356
.. option:: --valgrind-drizzleslap
358
Run "drizzleslap" with valgrind.
360
.. option:: --valgrind-drizzletest
362
Run the *drizzletest* and *drizzle_client_test* executable with valgrind
364
.. option:: --valgrind-drizzled
366
Run the "drizzled" executable with valgrind
368
.. option:: --valgrind-options=ARGS
370
Deprecated, use :option:`--valgrind-option`
372
.. option:: --valgrind-option=ARGS
374
Option to give valgrind, replaces default option(s),
375
can be specified more then once
377
.. option:: --valgrind-path=[EXE]
379
Path to the valgrind executable
381
.. option:: --callgrind
383
Instruct valgrind to use callgrind
387
Instruct valgrind to use massif
392
.. option:: --comment=STR
394
Write STR to the output
396
.. option:: --notimer
398
Don't show test case execution time
400
.. option:: --script-debug
402
Debug this script itself
404
.. option:: --verbose
408
.. option:: --start-and-exit
410
Only initialize and start the servers, using the
411
startup settings for the specified test case (if any)
413
.. option:: --start-dirty
415
Only start the servers (without initialization) for
416
the specified test case (if any)
420
Don't try to clean up from earlier runs
422
.. option:: --reorder
424
Reorder tests to get fewer server restarts
430
.. option:: --testcase-timeout=MINUTES
432
Max test case run time (default 15)
434
.. option:: --suite-timeout=MINUTES
436
Max test suite run time (default 180)
438
.. option:: --warnings | log-warnings
440
Pass --log-warnings to drizzled
442
.. option:: --sleep=SECONDS
444
Passed to drizzletest, will be used as fixed sleep time