Merge lp:~patrick-crews/drizzle/dbqp_add_reorder into lp:drizzle/7.0
- dbqp_add_reorder
- Merge into 7.0
Proposed by
Patrick Crews
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Lee Bieber | ||||
Approved revision: | 2126 | ||||
Merged at revision: | 2124 | ||||
Proposed branch: | lp:~patrick-crews/drizzle/dbqp_add_reorder | ||||
Merge into: | lp:drizzle/7.0 | ||||
Diff against target: |
572 lines (+304/-11) 15 files modified
tests/dbqp.py (+14/-0) tests/lib/drizzle_test_run/dtr_test_execution.py (+15/-0) tests/lib/drizzle_test_run/dtr_test_management.py (+42/-0) tests/lib/server_mgmt/drizzled.py (+14/-0) tests/lib/server_mgmt/server_management.py (+14/-0) tests/lib/sys_mgmt/codeTree.py (+14/-0) tests/lib/sys_mgmt/logging_management.py (+20/-1) tests/lib/sys_mgmt/port_management.py (+24/-1) tests/lib/sys_mgmt/system_management.py (+18/-1) tests/lib/sys_mgmt/time_management.py (+15/-0) tests/lib/test_mgmt/execution_management.py (+14/-0) tests/lib/test_mgmt/test_execution.py (+14/-0) tests/lib/test_mgmt/test_management.py (+29/-1) tests/lib/test_mode.py (+17/-5) tests/lib/test_run_options.py (+40/-2) |
||||
To merge this branch: | bzr merge lp:~patrick-crews/drizzle/dbqp_add_reorder | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+47753@code.launchpad.net |
Commit message
Description of the change
This branch adds --reorder and a placeholder --fast option.
We also quell unneeded libtool message when it isn't applicable.
I also merged in my other changes just to test them in conjunction with these changes. (just a warning in case merging presents any messages about this or whatever)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/dbqp.py' |
2 | --- tests/dbqp.py 2011-01-25 01:19:49 +0000 |
3 | +++ tests/dbqp.py 2011-01-27 23:36:53 +0000 |
4 | @@ -4,6 +4,20 @@ |
5 | # |
6 | # Copyright (C) 2010 Patrick Crews |
7 | # |
8 | +# This program is free software; you can redistribute it and/or modify |
9 | +# it under the terms of the GNU General Public License as published by |
10 | +# the Free Software Foundation; either version 2 of the License, or |
11 | +# (at your option) any later version. |
12 | +# |
13 | +# This program is distributed in the hope that it will be useful, |
14 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | +# GNU General Public License for more details. |
17 | +# |
18 | +# You should have received a copy of the GNU General Public License |
19 | +# along with this program; if not, write to the Free Software |
20 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
21 | + |
22 | |
23 | """ dbqp.py |
24 | |
25 | |
26 | === modified file 'tests/lib/drizzle_test_run/dtr_test_execution.py' |
27 | --- tests/lib/drizzle_test_run/dtr_test_execution.py 2011-01-26 01:13:20 +0000 |
28 | +++ tests/lib/drizzle_test_run/dtr_test_execution.py 2011-01-27 23:36:53 +0000 |
29 | @@ -4,6 +4,21 @@ |
30 | # |
31 | # Copyright (C) 2010 Patrick Crews |
32 | # |
33 | +# |
34 | +# This program is free software; you can redistribute it and/or modify |
35 | +# it under the terms of the GNU General Public License as published by |
36 | +# the Free Software Foundation; either version 2 of the License, or |
37 | +# (at your option) any later version. |
38 | +# |
39 | +# This program is distributed in the hope that it will be useful, |
40 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
41 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
42 | +# GNU General Public License for more details. |
43 | +# |
44 | +# You should have received a copy of the GNU General Public License |
45 | +# along with this program; if not, write to the Free Software |
46 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
47 | + |
48 | """ dtr_test_execution: |
49 | code related to the execution of dtr test cases |
50 | |
51 | |
52 | === modified file 'tests/lib/drizzle_test_run/dtr_test_management.py' |
53 | --- tests/lib/drizzle_test_run/dtr_test_management.py 2011-01-22 16:51:51 +0000 |
54 | +++ tests/lib/drizzle_test_run/dtr_test_management.py 2011-01-27 23:36:53 +0000 |
55 | @@ -4,6 +4,20 @@ |
56 | # |
57 | # Copyright (C) 2010 Patrick Crews |
58 | # |
59 | +## This program is free software; you can redistribute it and/or modify |
60 | +# it under the terms of the GNU General Public License as published by |
61 | +# the Free Software Foundation; either version 2 of the License, or |
62 | +# (at your option) any later version. |
63 | +# |
64 | +# This program is distributed in the hope that it will be useful, |
65 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
66 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
67 | +# GNU General Public License for more details. |
68 | +# |
69 | +# You should have received a copy of the GNU General Public License |
70 | +# along with this program; if not, write to the Free Software |
71 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
72 | + |
73 | """ dtr_test_management: |
74 | code related to the gathering / analysis / management of |
75 | the test cases |
76 | @@ -391,3 +405,31 @@ |
77 | self.system_manager.logging.debug("%s says - I'm disabled" %(test_name)) |
78 | return (1, disabled_tests[test_name]) |
79 | return (0,None) |
80 | + |
81 | + def sort_testcases(self): |
82 | + """ We sort our testcases according to the server_options they have |
83 | + For each testcase, we sort the list of options, so if a test has |
84 | + --plugin-add=csv --abracadabra, we would get |
85 | + --abracadabra --plugin-add=csv |
86 | + |
87 | + This results in tests that have similar options being run in order |
88 | + this minimizes server restarts which can be costly |
89 | + |
90 | + """ |
91 | + test_management.testManager.sort_testcases(self) |
92 | + organizer = {} |
93 | + ordered_list = [] |
94 | + for testcase in self.test_list: |
95 | + key = " ".join(sorted(testcase.server_options)) |
96 | + if key in organizer: |
97 | + organizer[key].append(testcase) |
98 | + else: |
99 | + organizer[key] = [testcase] |
100 | + for key in organizer.keys(): |
101 | + print key, len(organizer[key]) |
102 | + for value_list in organizer.values(): |
103 | + ordered_list = ordered_list + value_list |
104 | + self.test_list = ordered_list |
105 | + |
106 | + |
107 | + |
108 | |
109 | === modified file 'tests/lib/server_mgmt/drizzled.py' |
110 | --- tests/lib/server_mgmt/drizzled.py 2011-01-26 01:13:20 +0000 |
111 | +++ tests/lib/server_mgmt/drizzled.py 2011-01-27 23:36:53 +0000 |
112 | @@ -4,6 +4,20 @@ |
113 | # |
114 | # Copyright (C) 2010 Patrick Crews |
115 | # |
116 | +# This program is free software; you can redistribute it and/or modify |
117 | +# it under the terms of the GNU General Public License as published by |
118 | +# the Free Software Foundation; either version 2 of the License, or |
119 | +# (at your option) any later version. |
120 | +# |
121 | +# This program is distributed in the hope that it will be useful, |
122 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
123 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
124 | +# GNU General Public License for more details. |
125 | +# |
126 | +# You should have received a copy of the GNU General Public License |
127 | +# along with this program; if not, write to the Free Software |
128 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
129 | + |
130 | |
131 | """ drizzled.py: code to allow a serverManager |
132 | to provision and start up a drizzled server object |
133 | |
134 | === modified file 'tests/lib/server_mgmt/server_management.py' |
135 | --- tests/lib/server_mgmt/server_management.py 2011-01-25 17:47:18 +0000 |
136 | +++ tests/lib/server_mgmt/server_management.py 2011-01-27 23:36:53 +0000 |
137 | @@ -4,6 +4,20 @@ |
138 | # |
139 | # Copyright (C) 2010 Patrick Crews |
140 | # |
141 | +# This program is free software; you can redistribute it and/or modify |
142 | +# it under the terms of the GNU General Public License as published by |
143 | +# the Free Software Foundation; either version 2 of the License, or |
144 | +# (at your option) any later version. |
145 | +# |
146 | +# This program is distributed in the hope that it will be useful, |
147 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
148 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
149 | +# GNU General Public License for more details. |
150 | +# |
151 | +# You should have received a copy of the GNU General Public License |
152 | +# along with this program; if not, write to the Free Software |
153 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
154 | + |
155 | """server_management.py |
156 | code for dealing with apportioning servers |
157 | to suit the needs of the tests and executors |
158 | |
159 | === modified file 'tests/lib/sys_mgmt/codeTree.py' |
160 | --- tests/lib/sys_mgmt/codeTree.py 2011-01-25 17:47:18 +0000 |
161 | +++ tests/lib/sys_mgmt/codeTree.py 2011-01-27 23:36:53 +0000 |
162 | @@ -4,6 +4,20 @@ |
163 | # |
164 | # Copyright (C) 2010 Patrick Crews |
165 | # |
166 | +# This program is free software; you can redistribute it and/or modify |
167 | +# it under the terms of the GNU General Public License as published by |
168 | +# the Free Software Foundation; either version 2 of the License, or |
169 | +# (at your option) any later version. |
170 | +# |
171 | +# This program is distributed in the hope that it will be useful, |
172 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
173 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
174 | +# GNU General Public License for more details. |
175 | +# |
176 | +# You should have received a copy of the GNU General Public License |
177 | +# along with this program; if not, write to the Free Software |
178 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
179 | + |
180 | """codeTree |
181 | |
182 | definition of what a code tree should look like |
183 | |
184 | === modified file 'tests/lib/sys_mgmt/logging_management.py' |
185 | --- tests/lib/sys_mgmt/logging_management.py 2011-01-25 17:14:51 +0000 |
186 | +++ tests/lib/sys_mgmt/logging_management.py 2011-01-27 23:36:53 +0000 |
187 | @@ -3,12 +3,31 @@ |
188 | # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
189 | # |
190 | # Copyright (C) 2009 Sun Microsystems |
191 | +# Copyright (C) 2011 Patrick Crews |
192 | # |
193 | # Authors: |
194 | # |
195 | # Jay Pipes <joinfu@sun.com> |
196 | # Monty Taylor <mordred@sun.com> |
197 | -# |
198 | +# Patrick Crews |
199 | +# |
200 | +# This program is free software; you can redistribute it and/or modify |
201 | +# it under the terms of the GNU General Public License as published by |
202 | +# the Free Software Foundation; either version 2 of the License, or |
203 | +# (at your option) any later version. |
204 | +# |
205 | +# This program is distributed in the hope that it will be useful, |
206 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
207 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
208 | +# GNU General Public License for more details. |
209 | +# |
210 | +# You should have received a copy of the GNU General Public License |
211 | +# along with this program; if not, write to the Free Software |
212 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
213 | +# |
214 | +# |
215 | +# This code is modified from the logging module used in the |
216 | +# drizzle-automation project - https://launchpad.net/drizzle-automation |
217 | |
218 | |
219 | """ Simple replacement for python logging module that doesn't suck """ |
220 | |
221 | === modified file 'tests/lib/sys_mgmt/port_management.py' |
222 | --- tests/lib/sys_mgmt/port_management.py 2011-01-21 18:47:56 +0000 |
223 | +++ tests/lib/sys_mgmt/port_management.py 2011-01-27 23:36:53 +0000 |
224 | @@ -4,6 +4,20 @@ |
225 | # |
226 | # Copyright (C) 2010 Patrick Crews |
227 | # |
228 | +# This program is free software; you can redistribute it and/or modify |
229 | +# it under the terms of the GNU General Public License as published by |
230 | +# the Free Software Foundation; either version 2 of the License, or |
231 | +# (at your option) any later version. |
232 | +# |
233 | +# This program is distributed in the hope that it will be useful, |
234 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
235 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
236 | +# GNU General Public License for more details. |
237 | +# |
238 | +# You should have received a copy of the GNU General Public License |
239 | +# along with this program; if not, write to the Free Software |
240 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
241 | + |
242 | """port_management.py |
243 | code for dealing with the various tasks |
244 | around handing out and managing server ports |
245 | @@ -107,7 +121,16 @@ |
246 | if entry.startswith('Proto'): |
247 | good_data = 1 |
248 | elif good_data: |
249 | - used_port = int(entry.split()[3].split(':')[-1].strip()) |
250 | + # We try to catch additional output |
251 | + # like we see with freebsd |
252 | + if entry.startswith('Active'): |
253 | + good_data = 0 |
254 | + pass |
255 | + else: |
256 | + if self.system_manager.cur_os == 'FreeBSD': |
257 | + used_port = int(entry.split()[3].split('.')[-1].strip()) |
258 | + else: |
259 | + used_port = int(entry.split()[3].split(':')[-1].strip()) |
260 | if port == used_port: |
261 | if entry.split()[-1] != "TIME_WAIT": |
262 | return 1 |
263 | |
264 | === modified file 'tests/lib/sys_mgmt/system_management.py' |
265 | --- tests/lib/sys_mgmt/system_management.py 2011-01-26 01:13:20 +0000 |
266 | +++ tests/lib/sys_mgmt/system_management.py 2011-01-27 23:36:53 +0000 |
267 | @@ -4,6 +4,20 @@ |
268 | # |
269 | # Copyright (C) 2010 Patrick Crews |
270 | # |
271 | +# This program is free software; you can redistribute it and/or modify |
272 | +# it under the terms of the GNU General Public License as published by |
273 | +# the Free Software Foundation; either version 2 of the License, or |
274 | +# (at your option) any later version. |
275 | +# |
276 | +# This program is distributed in the hope that it will be useful, |
277 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
278 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
279 | +# GNU General Public License for more details. |
280 | +# |
281 | +# You should have received a copy of the GNU General Public License |
282 | +# along with this program; if not, write to the Free Software |
283 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
284 | + |
285 | """system_management.py |
286 | code for dealing with system-level 'stuff'. |
287 | This includes setting environment variables, looking for clients, |
288 | @@ -49,10 +63,12 @@ |
289 | self.env_var_delimiter = ':' |
290 | self.no_shm = variables['noshm'] |
291 | self.shm_path = self.find_path(["/dev/shm", "/tmp"], required=0) |
292 | + self.cur_os = os.uname()[0] |
293 | self.symlink_name = 'dtr_work_sym' |
294 | self.workdir = variables['workdir'] |
295 | self.start_dirty = variables['startdirty'] |
296 | self.valgrind = variables['valgrind'] |
297 | + self.gdb = variables['gdb'] |
298 | |
299 | # we use this to preface commands in order to run valgrind and such |
300 | self.cmd_prefix = '' |
301 | @@ -385,7 +401,8 @@ |
302 | libtool_path = '../libtool' |
303 | if os.path.exists(libtool_path) and os.access( libtool_path |
304 | , os.X_OK): |
305 | - self.logging.info("Using libtool when running valgrind or debugger") |
306 | + if self.valgrind or self.gdb: |
307 | + self.logging.info("Using libtool when running valgrind or debugger") |
308 | return libtool_path |
309 | else: |
310 | return None |
311 | |
312 | === modified file 'tests/lib/sys_mgmt/time_management.py' |
313 | --- tests/lib/sys_mgmt/time_management.py 2011-01-25 17:10:19 +0000 |
314 | +++ tests/lib/sys_mgmt/time_management.py 2011-01-27 23:36:53 +0000 |
315 | @@ -4,6 +4,21 @@ |
316 | # |
317 | # Copyright (C) 2010 Patrick Crews |
318 | # |
319 | +# |
320 | +# This program is free software; you can redistribute it and/or modify |
321 | +# it under the terms of the GNU General Public License as published by |
322 | +# the Free Software Foundation; either version 2 of the License, or |
323 | +# (at your option) any later version. |
324 | +# |
325 | +# This program is distributed in the hope that it will be useful, |
326 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
327 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
328 | +# GNU General Public License for more details. |
329 | +# |
330 | +# You should have received a copy of the GNU General Public License |
331 | +# along with this program; if not, write to the Free Software |
332 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
333 | + |
334 | """time_management.py |
335 | code for dealing with timing, mostly |
336 | we want to keep track of how long certain things |
337 | |
338 | === modified file 'tests/lib/test_mgmt/execution_management.py' |
339 | --- tests/lib/test_mgmt/execution_management.py 2011-01-15 21:27:41 +0000 |
340 | +++ tests/lib/test_mgmt/execution_management.py 2011-01-27 23:36:53 +0000 |
341 | @@ -4,6 +4,20 @@ |
342 | # |
343 | # Copyright (C) 2010 Patrick Crews |
344 | # |
345 | +# This program is free software; you can redistribute it and/or modify |
346 | +# it under the terms of the GNU General Public License as published by |
347 | +# the Free Software Foundation; either version 2 of the License, or |
348 | +# (at your option) any later version. |
349 | +# |
350 | +# This program is distributed in the hope that it will be useful, |
351 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
352 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
353 | +# GNU General Public License for more details. |
354 | +# |
355 | +# You should have received a copy of the GNU General Public License |
356 | +# along with this program; if not, write to the Free Software |
357 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
358 | + |
359 | """execution_management.py |
360 | code for dealing with test execution. |
361 | The actual nuts and bolts of executing a test lies with the |
362 | |
363 | === modified file 'tests/lib/test_mgmt/test_execution.py' |
364 | --- tests/lib/test_mgmt/test_execution.py 2011-01-26 01:13:20 +0000 |
365 | +++ tests/lib/test_mgmt/test_execution.py 2011-01-27 23:36:53 +0000 |
366 | @@ -4,6 +4,20 @@ |
367 | # |
368 | # Copyright (C) 2010 Patrick Crews |
369 | # |
370 | +# This program is free software; you can redistribute it and/or modify |
371 | +# it under the terms of the GNU General Public License as published by |
372 | +# the Free Software Foundation; either version 2 of the License, or |
373 | +# (at your option) any later version. |
374 | +# |
375 | +# This program is distributed in the hope that it will be useful, |
376 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
377 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
378 | +# GNU General Public License for more details. |
379 | +# |
380 | +# You should have received a copy of the GNU General Public License |
381 | +# along with this program; if not, write to the Free Software |
382 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
383 | + |
384 | """ test_execution: |
385 | code related to the execution of est cases |
386 | |
387 | |
388 | === modified file 'tests/lib/test_mgmt/test_management.py' |
389 | --- tests/lib/test_mgmt/test_management.py 2011-01-25 01:19:49 +0000 |
390 | +++ tests/lib/test_mgmt/test_management.py 2011-01-27 23:36:53 +0000 |
391 | @@ -4,6 +4,20 @@ |
392 | # |
393 | # Copyright (C) 2010 Patrick Crews |
394 | # |
395 | +# This program is free software; you can redistribute it and/or modify |
396 | +# it under the terms of the GNU General Public License as published by |
397 | +# the Free Software Foundation; either version 2 of the License, or |
398 | +# (at your option) any later version. |
399 | +# |
400 | +# This program is distributed in the hope that it will be useful, |
401 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
402 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
403 | +# GNU General Public License for more details. |
404 | +# |
405 | +# You should have received a copy of the GNU General Public License |
406 | +# along with this program; if not, write to the Free Software |
407 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
408 | + |
409 | """ dtr_test_management: |
410 | code related to the gathering / analysis / management of |
411 | the test cases |
412 | @@ -27,7 +41,8 @@ |
413 | """ |
414 | |
415 | def __init__( self, verbose, debug, engine, dotest, skiptest |
416 | - , suitelist, suitepaths, system_manager, test_cases): |
417 | + , reorder, suitelist, suitepaths, system_manager |
418 | + , test_cases): |
419 | |
420 | self.system_manager = system_manager |
421 | self.time_manager = system_manager.time_manager |
422 | @@ -51,6 +66,7 @@ |
423 | self.engine = engine |
424 | self.dotest = dotest |
425 | self.skiptest = skiptest |
426 | + self.reorder = reorder |
427 | self.suitelist = suitelist |
428 | |
429 | self.code_tree = self.system_manager.code_tree |
430 | @@ -90,6 +106,10 @@ |
431 | |
432 | """ |
433 | |
434 | + # See if we need to reorder our test cases |
435 | + if self.reorder: |
436 | + self.sort_testcases() |
437 | + |
438 | if self.desired_tests and not self.test_list: |
439 | # We wanted tests, but found none |
440 | # Probably need to make this smarter at some point |
441 | @@ -262,3 +282,11 @@ |
442 | else: |
443 | return 0 |
444 | |
445 | + def sort_testcases(self): |
446 | + """ Sort testcases to optimize test execution. |
447 | + This can be very mode-specific |
448 | + |
449 | + """ |
450 | + |
451 | + self.logging.verbose("Reordering testcases to optimize test execution...") |
452 | + |
453 | |
454 | === modified file 'tests/lib/test_mode.py' |
455 | --- tests/lib/test_mode.py 2011-01-15 21:27:41 +0000 |
456 | +++ tests/lib/test_mode.py 2011-01-27 23:36:53 +0000 |
457 | @@ -2,8 +2,20 @@ |
458 | # -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- |
459 | # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
460 | # |
461 | -# Copyright (C) 2010 Patrick Crews |
462 | -# |
463 | +# This program is free software; you can redistribute it and/or modify |
464 | +# it under the terms of the GNU General Public License as published by |
465 | +# the Free Software Foundation; either version 2 of the License, or |
466 | +# (at your option) any later version. |
467 | +# |
468 | +# This program is distributed in the hope that it will be useful, |
469 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
470 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
471 | +# GNU General Public License for more details. |
472 | +# |
473 | +# You should have received a copy of the GNU General Public License |
474 | +# along with this program; if not, write to the Free Software |
475 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
476 | + |
477 | """test_mode.py |
478 | code for dealing with testing modes |
479 | A given mode should have a systemInitializer, testManager, and testExecutor |
480 | @@ -31,9 +43,9 @@ |
481 | from drizzle_test_run.dtr_test_management import testManager |
482 | test_manager = testManager( variables['verbose'], variables['debug'] |
483 | , variables['engine'], variables['dotest'] |
484 | - , variables['skiptest'], variables['suitelist'] |
485 | - , variables['suitepaths'], system_manager |
486 | - , variables['test_cases']) |
487 | + , variables['skiptest'], variables['reorder'] |
488 | + , variables['suitelist'], variables['suitepaths'] |
489 | + , system_manager, variables['test_cases']) |
490 | |
491 | # get our mode-specific testExecutor |
492 | from drizzle_test_run.dtr_test_execution import dtrTestExecutor |
493 | |
494 | === modified file 'tests/lib/test_run_options.py' |
495 | --- tests/lib/test_run_options.py 2011-01-25 21:19:06 +0000 |
496 | +++ tests/lib/test_run_options.py 2011-01-27 23:36:53 +0000 |
497 | @@ -4,6 +4,20 @@ |
498 | # |
499 | # Copyright (C) 2010 Patrick Crews |
500 | # |
501 | +# This program is free software; you can redistribute it and/or modify |
502 | +# it under the terms of the GNU General Public License as published by |
503 | +# the Free Software Foundation; either version 2 of the License, or |
504 | +# (at your option) any later version. |
505 | +# |
506 | +# This program is distributed in the hope that it will be useful, |
507 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
508 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
509 | +# GNU General Public License for more details. |
510 | +# |
511 | +# You should have received a copy of the GNU General Public License |
512 | +# along with this program; if not, write to the Free Software |
513 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
514 | + |
515 | |
516 | |
517 | """Processes command line options for Drizzle test-runner""" |
518 | @@ -16,7 +30,12 @@ |
519 | # functions |
520 | def comma_list_split(option, opt, value, parser): |
521 | """Callback for splitting input expected in list form""" |
522 | - setattr(parser.values, option.dest, value.split(',')) |
523 | + cur_list = getattr(parser.values, option.dest,[]) |
524 | + if cur_list: |
525 | + value_list = cur_list + value.split(',') |
526 | + else: |
527 | + value_list = value.split(',') |
528 | + setattr(parser.values, option.dest, value_list) |
529 | |
530 | def organize_options(args, test_cases): |
531 | """Put our arguments in a nice dictionary |
532 | @@ -91,6 +110,14 @@ |
533 | , help="Record a testcase result (if the testing mode supports it) [%default]" |
534 | ) |
535 | |
536 | +system_control_group.add_option( |
537 | + "--fast" |
538 | + , dest="fast" |
539 | + , action="store_true" |
540 | + , default=False |
541 | + , help="Don't try to cleanup from earlier runs (currently just a placeholder) [%default]" |
542 | + ) |
543 | + |
544 | parser.add_option_group(system_control_group) |
545 | |
546 | # end system_control_group |
547 | @@ -105,7 +132,8 @@ |
548 | "--suite" |
549 | , dest="suitelist" |
550 | , type='string' |
551 | - , action="append" |
552 | + , action="callback" |
553 | + , callback=comma_list_split |
554 | , help="The name of the suite containing tests we want. Use one --suite arg for each suite you want to use. [default=autosearch]" |
555 | ) |
556 | |
557 | @@ -133,6 +161,16 @@ |
558 | , help = "input can either be a prefix or a regex. Will exclude tests that match the provided pattern" |
559 | ) |
560 | |
561 | +test_control_group.add_option( |
562 | + "--reorder" |
563 | + , dest="reorder" |
564 | + , action="store_true" |
565 | + , default=False |
566 | + , help = "sort the testcases so that they are executed optimally for the given mode [%default]" |
567 | + ) |
568 | + |
569 | + |
570 | + |
571 | parser.add_option_group(test_control_group) |
572 | # end test_control_group |
573 |