Merge lp:~patrick-crews/drizzle/test-run-docs into lp:drizzle/7.0
- test-run-docs
- Merge into 7.0
Proposed by
Patrick Crews
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Brian Aker | ||||
Approved revision: | 1893 | ||||
Merged at revision: | 1901 | ||||
Proposed branch: | lp:~patrick-crews/drizzle/test-run-docs | ||||
Merge into: | lp:drizzle/7.0 | ||||
Diff against target: |
509 lines (+481/-1) 3 files modified
docs/include.am (+2/-1) docs/index.rst (+7/-0) docs/testing/test-run.rst (+472/-0) |
||||
To merge this branch: | bzr merge lp:~patrick-crews/drizzle/test-run-docs | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+39803@code.launchpad.net |
Commit message
Description of the change
Added sphinx documents for test-run.pl
Includes options + some basic usage examples.
To post a comment you must log in.
- 1894. By Patrick Crews
-
Minor improvements / edits to the test-run documentation
- 1895. By Patrick Crews
-
Additional minor edits to test-run docs
- 1896. By Patrick Crews
-
Additional minor edits to test-run docs
- 1897. By Patrick Crews
-
Added url for reporting bugs in the test-run docs
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'docs/include.am' |
2 | --- docs/include.am 2010-10-19 00:32:30 +0000 |
3 | +++ docs/include.am 2010-11-02 18:07:49 +0000 |
4 | @@ -10,7 +10,8 @@ |
5 | docs/drizzled_header.html \ |
6 | ${top_srcdir}/docs/*.rst \ |
7 | ${top_srcdir}/docs/clients/*.rst \ |
8 | - ${top_srcdir}/docs/libdrizzle/*.rst |
9 | + ${top_srcdir}/docs/libdrizzle/*.rst \ |
10 | + ${top_srcdir}/docs/testing/*.rst |
11 | |
12 | # Makefile for Sphinx documentation |
13 | # |
14 | |
15 | === modified file 'docs/index.rst' |
16 | --- docs/index.rst 2010-10-28 19:50:55 +0000 |
17 | +++ docs/index.rst 2010-11-02 18:07:49 +0000 |
18 | @@ -82,6 +82,13 @@ |
19 | libdrizzle/api.rst |
20 | libdrizzle/developer.rst |
21 | |
22 | +Testing: |
23 | + |
24 | +.. toctree:: |
25 | + :maxdepth: 2 |
26 | + |
27 | + testing/test-run.rst |
28 | + |
29 | Indices and tables |
30 | ================== |
31 | |
32 | |
33 | === added directory 'docs/testing' |
34 | === added file 'docs/testing/test-run.rst' |
35 | --- docs/testing/test-run.rst 1970-01-01 00:00:00 +0000 |
36 | +++ docs/testing/test-run.rst 2010-11-02 18:07:49 +0000 |
37 | @@ -0,0 +1,472 @@ |
38 | +********************************** |
39 | +test-run.pl - Drizzle testing tool |
40 | +********************************** |
41 | + |
42 | +Synopsis |
43 | +======== |
44 | + |
45 | +**./test-run** [ *OPTIONS* ] [ TESTCASE ] |
46 | + |
47 | +Description |
48 | +=========== |
49 | + |
50 | +:program:`test-run.pl` (aka test-run, dtr, mtr) is used to execute tests |
51 | +from the Drizzle test suite. These tests are included with Drizzle |
52 | +distributions and provide a way for users to verify that the system will |
53 | +operate according to expectations. |
54 | + |
55 | +The tests use a diff-based paradigm, meaning that the test runner executes |
56 | +a test and then compares the results received with pre-recorded expected |
57 | +results. In the event of a test failure, the program will provide output |
58 | +highlighting the differences found between expected and actual results; this |
59 | +can be useful for troubleshooting and in bug reports. |
60 | + |
61 | +While most users are concerned with ensuring general functionality, the |
62 | +program also allows a user to quickly spin up a server for ad-hoc testing |
63 | +and to run the test-suite against an already running Drizzle server. |
64 | + |
65 | +Running tests |
66 | +========================= |
67 | + |
68 | +There are several different ways to run tests using :program:`test-run.pl`. |
69 | + |
70 | +It should be noted that unless :option:`--force` is used, the program will |
71 | +stop execution upon encountering the first failing test. |
72 | +:option:`--force` is recommended if you are running several tests - it will |
73 | +allow you to view all successes and failures in one run. |
74 | + |
75 | +Running individual tests |
76 | +------------------------ |
77 | +If one only wants to run a few, specific tests, they may do so this way:: |
78 | + |
79 | + ./test-run [OPTIONS] test1 [test2 ... testN] |
80 | + |
81 | +Running all tests within a suite |
82 | +-------------------------------- |
83 | +Many of the tests supplied with Drizzle are organized into suites. |
84 | + |
85 | +The tests within drizzle/tests/t are considered the 'main' suite. |
86 | +Other suites are located in either drizzle/tests/suite or within the various |
87 | +directories in drizzle/plugin. Tests for a specific plugin should live in |
88 | +the plugin's directory - drizzle/plugin/example_plugin/tests |
89 | + |
90 | +To run the tests in a specific suite:: |
91 | + |
92 | + ./test-run [OPTIONS] --suite=SUITENAME |
93 | + |
94 | +Running specific tests within a suite |
95 | +-------------------------------------- |
96 | +To run a specific set of tests within a suite:: |
97 | + |
98 | + ./test-run [OPTIONS] --suite=SUITENAME TEST1 [TEST2..TESTN] |
99 | + |
100 | +Calling tests using <suitename>.<testname> currently does not work. |
101 | +One must specify the test suite via the :option:`--suite` option. |
102 | + |
103 | + |
104 | +Running all available tests |
105 | +--------------------------- |
106 | +Currently, the quickest way to execute all tests in all suites is |
107 | +to use 'make test' from the drizzle root. |
108 | + |
109 | +Otherwise, one should simply name all suites:: |
110 | + |
111 | + ./test-run [OPTIONS] --suite=SUITE1, SUITE2, ...SUITEN |
112 | + |
113 | +Interpreting test results |
114 | +========================= |
115 | +The output of the test runner is quite simple. Every test should pass. |
116 | +In the event of a test failure, please take the time to file a bug here: |
117 | +*https://bugs.launchpad.net/drizzle* |
118 | + |
119 | +During a run, the program will provide the user with: |
120 | + * test name (suite + name) |
121 | + * test status (pass/fail/skipped) |
122 | + * time spent executing each test |
123 | + |
124 | +At the end of a run, the program will provide the user with a listing of: |
125 | + * how many tests were run |
126 | + * how many tests failed |
127 | + * percentage of passing tests |
128 | + * a listing of failing tests |
129 | + * total time spent executing the tests |
130 | + |
131 | +Example output:: |
132 | + |
133 | + <snip> |
134 | + main.snowman [ pass ] 9 |
135 | + main.statement_boundaries [ pass ] 17 |
136 | + main.status [ pass ] 12 |
137 | + main.strict [ pass ] 50 |
138 | + main.subselect [ pass ] 6778 |
139 | + main.subselect2 [ pass ] 51 |
140 | + main.subselect3 [ fail ] |
141 | + drizzletest: At line 621: query 'select a, (select max(b) from t1) into outfile |
142 | + <snip> |
143 | + -------------------------------------------------------------------------------- |
144 | + Stopping All Servers |
145 | + Failed 10/231 tests, 95.67% were successful. |
146 | + |
147 | + The log files in var/log may give you some hint |
148 | + of what went wrong. |
149 | + If you want to report this error, go to: |
150 | + http://bugs.launchpad.net/drizzle |
151 | + The servers were restarted 16 times |
152 | + Spent 64.364 of 115 seconds executing testcases |
153 | + |
154 | + drizzle-test-run in default mode: *** Failing the test(s): main.exp1 |
155 | + main.func_str main.loaddata main.null main.outfile main.subselect3 |
156 | + main.warnings jp.like_utf8 jp.select_utf8 jp.where_utf8 |
157 | + |
158 | +Additional uses |
159 | +=============== |
160 | +Starting a server for manual testing |
161 | +------------------------------------ |
162 | + |
163 | +:program:`test-run.pl` allows a user to get a Drizzle server up and running |
164 | +quickly. This can be useful for fast ad-hoc testing. |
165 | + |
166 | +To do so call:: |
167 | + |
168 | + ./test-run --start-and-exit [*OPTIONS*] |
169 | + |
170 | +This will start a Drizzle server that you can connect to and query |
171 | + |
172 | +Starting a server against a pre-populated DATADIR |
173 | +-------------------------------------------------- |
174 | + |
175 | +Using :option:`--start-dirty` prevents :program:`test-run.pl` from attempting |
176 | +to initialize (clean) the datadir. This can be useful if you want to use |
177 | +an already-populated datadir for testing. |
178 | + |
179 | +Program architecture |
180 | +==================== |
181 | + |
182 | +:program:`test-run.pl` uses a simple diff-based mechanism for testing. |
183 | +It will execute the statements contained in a test and compare the results |
184 | +to pre-recorded expected results. In the event of a test failure, you |
185 | +will be presented with a diff:: |
186 | + |
187 | + main.exp1 [ fail ] |
188 | + --- drizzle/tests/r/exp1.result 2010-11-02 02:10:25.107013998 +0300 |
189 | + +++ drizzle/tests/r/exp1.reject 2010-11-02 02:10:32.017013999 +0300 |
190 | + @@ -5,4 +5,5 @@ |
191 | + a |
192 | + 1 |
193 | + 2 |
194 | + +3 |
195 | + DROP TABLE t1; |
196 | + |
197 | +A test case consists of a .test and a .result file. The .test file includes |
198 | +the various statements to be executed for a test. The .result file lists |
199 | +the expected results for a given test file. These files live in tests/t |
200 | +and tests/r, respectively. This structure is the same for all test suites. |
201 | + |
202 | +test-run.pl options |
203 | +=================== |
204 | + |
205 | +The :program:`test-run.pl` tool has several available options: |
206 | + |
207 | +./test-run [ OPTIONS ] [ TESTCASE ] |
208 | + |
209 | +Options to control what engine/variation to run |
210 | +----------------------------------------------- |
211 | + |
212 | +.. option:: --compress |
213 | + |
214 | + Use the compressed protocol between client and server |
215 | + |
216 | +.. option:: --bench |
217 | + |
218 | + Run the benchmark suite |
219 | + |
220 | +.. option:: --small-bench |
221 | + |
222 | + Run the benchmarks with --small-tests --small-tables |
223 | + |
224 | +Options to control directories to use |
225 | +------------------------------------- |
226 | + |
227 | +.. option:: --benchdir=DIR |
228 | + |
229 | + The directory where the benchmark suite is stored |
230 | + (default: ../../mysql-bench) |
231 | + |
232 | +.. option:: --tmpdir=DIR |
233 | + |
234 | + The directory where temporary files are stored |
235 | + (default: ./var/tmp). |
236 | + |
237 | +.. option:: --vardir=DIR |
238 | + |
239 | + The directory where files generated from the test run |
240 | + is stored (default: ./var). Specifying a ramdisk or |
241 | + tmpfs will speed up tests. |
242 | + |
243 | +.. option:: --mem |
244 | + |
245 | + Run testsuite in "memory" using tmpfs or ramdisk |
246 | + Attempts to find a suitable location |
247 | + using a builtin list of standard locations |
248 | + for tmpfs (/dev/shm) |
249 | + The option can also be set using environment |
250 | + variable DTR_MEM=[DIR] |
251 | + |
252 | +Options to control what test suites or cases to run |
253 | +--------------------------------------------------- |
254 | + |
255 | +.. option:: --force |
256 | + |
257 | + Continue to run the suite after failure |
258 | + |
259 | +.. option:: --do-test=PREFIX or REGEX |
260 | + |
261 | + Run test cases which name are prefixed with PREFIX |
262 | + or fulfills REGEX |
263 | + |
264 | +.. option:: --skip-test=PREFIX or REGEX |
265 | + |
266 | + Skip test cases which name are prefixed with PREFIX |
267 | + or fulfills REGEX |
268 | + |
269 | +.. option:: --start-from=PREFIX |
270 | + |
271 | + Run test cases starting from test prefixed with PREFIX |
272 | + suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated |
273 | + list of suite names. |
274 | + The default is: "main,jp" |
275 | + |
276 | +.. option:: --skip-rpl |
277 | + |
278 | + Skip the replication test cases. |
279 | + combination="ARG1 .. ARG2" Specify a set of "drizzled" arguments for one |
280 | + combination. |
281 | + |
282 | +.. option:: --skip-combination |
283 | + |
284 | + Skip any combination options and combinations files |
285 | + |
286 | +.. option:: --repeat-test=n |
287 | + |
288 | + How many times to repeat each test (default: 1) |
289 | + |
290 | +Options that specify ports |
291 | +-------------------------- |
292 | + |
293 | +.. option:: --master_port=PORT |
294 | + |
295 | + Specify the port number used by the first master |
296 | + |
297 | +.. option:: --slave_port=PORT |
298 | + |
299 | + Specify the port number used by the first slave |
300 | + |
301 | +.. option:: --dtr-build-thread=# |
302 | + |
303 | + Specify unique collection of ports. Can also be set by |
304 | + setting the environment variable DTR_BUILD_THREAD. |
305 | + |
306 | +Options for test case authoring |
307 | +------------------------------- |
308 | + |
309 | +.. option:: --record TESTNAME |
310 | + |
311 | + (Re)genereate the result file for TESTNAME |
312 | + |
313 | +.. option:: --check-testcases |
314 | + |
315 | + Check testcases for sideeffects |
316 | + |
317 | +.. option:: --mark-progress |
318 | + |
319 | + Log line number and elapsed time to <testname>.progress |
320 | + |
321 | +Options that pass on options |
322 | +---------------------------- |
323 | + |
324 | +.. option:: --drizzled=ARGS |
325 | + |
326 | + Specify additional arguments to "drizzled" |
327 | + |
328 | +Options to run test on running server |
329 | +------------------------------------- |
330 | + |
331 | +.. option:: --extern |
332 | + |
333 | + Use running server for tests |
334 | + |
335 | +.. option:: --user=USER |
336 | + |
337 | + User for connection to extern server |
338 | + |
339 | +Options for debugging the product |
340 | +--------------------------------- |
341 | + |
342 | +.. option:: --client-ddd |
343 | + |
344 | + Start drizzletest client in ddd |
345 | + |
346 | +.. option:: --client-debugger=NAME |
347 | + |
348 | + Start drizzletest in the selected debugger |
349 | + |
350 | +.. option:: --client-gdb |
351 | + |
352 | + Start drizzletest client in gdb |
353 | + |
354 | +.. option:: --ddd |
355 | + |
356 | + Start drizzled in ddd |
357 | + |
358 | +.. option:: --debug |
359 | + |
360 | + Dump trace output for all servers and client programs |
361 | + |
362 | +.. option:: --debugger=NAME |
363 | + |
364 | + Start drizzled in the selected debugger |
365 | + |
366 | +.. option:: --gdb |
367 | + |
368 | + Start the drizzled(s) in gdb |
369 | + |
370 | +.. option:: --manual-debug |
371 | + |
372 | + Let user manually start drizzled in debugger, before running test(s) |
373 | + |
374 | +.. option:: --manual-gdb |
375 | + |
376 | + Let user manually start drizzled in gdb, before running test(s) |
377 | + |
378 | +.. option:: --manual-ddd |
379 | + |
380 | + Let user manually start drizzled in ddd, before running test(s) |
381 | + |
382 | +.. option:: --master-binary=PATH |
383 | + |
384 | + Specify the master "drizzled" to use |
385 | + |
386 | +.. option:: --slave-binary=PATH |
387 | + |
388 | + Specify the slave "drizzled" to use |
389 | + |
390 | +.. option:: --strace-client |
391 | + |
392 | + Create strace output for drizzletest client |
393 | + |
394 | +.. option:: --max-save-core |
395 | + |
396 | + Limit the number of core files saved (to avoid filling up disks for |
397 | + heavily crashing server). Defaults to 5, set to 0 for no limit. |
398 | + |
399 | +Options for coverage, profiling etc |
400 | +----------------------------------- |
401 | + |
402 | +.. option:: --gcov |
403 | + |
404 | + FIXME |
405 | + |
406 | +.. option:: --gprof |
407 | + |
408 | + See online documentation on how to use it. |
409 | + |
410 | +.. option:: --valgrind |
411 | + |
412 | + Run the *drizzletest* and *drizzled* executables using valgrind with |
413 | + default options |
414 | + |
415 | +.. option:: --valgrind-all |
416 | + |
417 | + Synonym for :option:`--valgrind` |
418 | + |
419 | +.. option:: --valgrind-drizzleslap |
420 | + |
421 | + Run "drizzleslap" with valgrind. |
422 | + |
423 | +.. option:: --valgrind-drizzletest |
424 | + |
425 | + Run the *drizzletest* and *drizzle_client_test* executable with valgrind |
426 | + |
427 | +.. option:: --valgrind-drizzled |
428 | + |
429 | + Run the "drizzled" executable with valgrind |
430 | + |
431 | +.. option:: --valgrind-options=ARGS |
432 | + |
433 | + Deprecated, use :option:`--valgrind-option` |
434 | + |
435 | +.. option:: --valgrind-option=ARGS |
436 | + |
437 | + Option to give valgrind, replaces default option(s), |
438 | + can be specified more then once |
439 | + |
440 | +.. option:: --valgrind-path=[EXE] |
441 | + |
442 | + Path to the valgrind executable |
443 | + |
444 | +.. option:: --callgrind |
445 | + |
446 | + Instruct valgrind to use callgrind |
447 | + |
448 | +.. option:: --massif |
449 | + |
450 | + Instruct valgrind to use massif |
451 | + |
452 | +Misc options |
453 | +------------ |
454 | + |
455 | +.. option:: --comment=STR |
456 | + |
457 | + Write STR to the output |
458 | + |
459 | +.. option:: --notimer |
460 | + |
461 | + Don't show test case execution time |
462 | + |
463 | +.. option:: --script-debug |
464 | + |
465 | + Debug this script itself |
466 | + |
467 | +.. option:: --verbose |
468 | + |
469 | + More verbose output |
470 | + |
471 | +.. option:: --start-and-exit |
472 | + |
473 | + Only initialize and start the servers, using the |
474 | + startup settings for the specified test case (if any) |
475 | + |
476 | +.. option:: --start-dirty |
477 | + |
478 | + Only start the servers (without initialization) for |
479 | + the specified test case (if any) |
480 | + |
481 | +.. option:: --fast |
482 | + |
483 | + Don't try to clean up from earlier runs |
484 | + |
485 | +.. option:: --reorder |
486 | + |
487 | + Reorder tests to get fewer server restarts |
488 | + |
489 | +.. option:: --help |
490 | + |
491 | + Get this help text |
492 | + |
493 | +.. option:: --testcase-timeout=MINUTES |
494 | + |
495 | + Max test case run time (default 15) |
496 | + |
497 | +.. option:: --suite-timeout=MINUTES |
498 | + |
499 | + Max test suite run time (default 180) |
500 | + |
501 | +.. option:: --warnings | log-warnings |
502 | + |
503 | + Pass --log-warnings to drizzled |
504 | + |
505 | +.. option:: --sleep=SECONDS |
506 | + |
507 | + Passed to drizzletest, will be used as fixed sleep time |
508 | + |
509 | + |