~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/drizzle_test_run/dtr_test_management.py

  • Committer: Mark Atwood
  • Date: 2011-05-15 01:16:29 UTC
  • mfrom: (2274.1.9 dbqp_server_setup)
  • Revision ID: me@mark.atwood.name-20110515011629-votxs0oxy9s3gnpl
Tags: 2011.05.18
mergeĀ lp:~patrick-crews/drizzle/dbqp_server_setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    """
46
46
    def __init__(self, system_manager, test_case=None, test_name=None, suite_name=None
47
47
                 , suite_path=None, test_server_options=[], test_path=None, result_path=None
48
 
                 , comment=None, master_sh=None
 
48
                 , comment=None, master_sh=None, cnf_path=None
49
49
                 , disable=0, innodb_test=1 
50
50
                 , need_debug=0, debug=0):
51
51
        self.system_manager = system_manager
75
75
            self.server_options= self.server_options[0][0]
76
76
        self.comment = comment
77
77
        self.master_sh = master_sh
 
78
        self.cnf_path = cnf_path
78
79
        self.disable = disable
79
80
        self.innodb_test  = innodb_test
80
81
        self.need_debug = need_debug
121
122
 
122
123
        # Get suite-level options
123
124
        suite_options = []
124
 
        suite_options = self.process_suite_options(suite_dir) 
 
125
        cnf_path, suite_options = self.process_suite_options(suite_dir) 
125
126
 
126
127
        # Get the 'name' of the suite.  This can require some processing
127
128
        # But the name is useful for reporting and whatnot
145
146
            disabled_tests = self.process_disabled_test_file(testdir)                        
146
147
            for test_case in testlist:
147
148
                self.add_test(self.process_test_file(suite_dir,
148
 
                                              suite_name, suite_options
 
149
                                              suite_name, cnf_path, suite_options
149
150
                                              , disabled_tests, testdir 
150
151
                                              , resultdir, test_case))
151
152
 
152
 
    def process_test_file(self, suite_dir, suite_name, suite_options 
 
153
    def process_test_file(self, suite_dir, suite_name, suite_cnf_path, suite_options 
153
154
                          , disabled_tests, testdir 
154
155
                          , resultdir, test_case):
155
156
        """ We generate / find / store all the relevant information per-test.
172
173
         , result_path
173
174
         , comment
174
175
         , master_sh
 
176
         , cnf_path
175
177
         , test_server_options
176
178
         , disable
177
179
         , innodb_test
178
180
         , need_debug) = self.gather_test_data(test_case, test_name,
179
181
                                 suite_name, test_server_options,testdir, 
180
 
                                 resultdir, disabled_tests)  
 
182
                                 resultdir, disabled_tests)
 
183
        if suite_cnf_path and not cnf_path:
 
184
            cnf_path=suite_cnf_path
181
185
        test_case = testCase(self.system_manager, test_case, test_name, suite_name, 
182
186
                             suite_dir, test_server_options,test_path, result_path,
183
 
                             master_sh=master_sh, debug=self.debug)      
 
187
                             master_sh=master_sh, cnf_path=cnf_path, debug=self.debug)      
184
188
        return test_case
185
189
 
186
190
 
209
213
            master_sh = None
210
214
        master_opt_path = test_path.replace('.test', '-master.opt')
211
215
        config_file_path = test_path.replace('.test', '.cnf')
 
216
        # NOTE:  this currently makes suite level server options additive 
 
217
        # to file-level .opt files...not sure if this is the best.
212
218
        test_server_options = test_server_options + self.process_opt_file(
213
219
                                                           master_opt_path)
 
220
        # deal with .cnf files (which supercede master.opt stuff)
 
221
        cnf_options = []
 
222
        cnf_flag, returned_options = self.process_cnf_file(config_file_path)
 
223
        cnf_options += returned_options
 
224
        if cnf_flag: # we found a proper file and need to override
 
225
            found_options = cnf_options
 
226
        else:
 
227
            config_file_path = None
214
228
        (disable, comment) = self.check_if_disabled(disabled_tests, test_name)
215
229
        innodb_test = 0
216
230
        need_debug = 0
217
 
        return (test_path, result_file_name, result_path, comment, master_sh,
218
 
                test_server_options, disable, innodb_test, need_debug)
 
231
        return (test_path, result_file_name, result_path, comment, master_sh, 
 
232
                config_file_path, test_server_options, disable, innodb_test, need_debug)
219
233
 
220
234
    def check_suite(self, suite_dir, testdir, resultdir):
221
235
        """Handle basic checks of the suite:
280
294
        # a master.opt file if we have a .cnf file.  There is no reason they
281
295
        # should ever be used in conjunction and I am biased towards .cnf ; )
282
296
        cnf_files = ['t/master.cnf']
 
297
        cnf_options = []
283
298
        for cnf_file in cnf_files:
284
 
            cnf_flag, returned_options = self.process_cnf_file(os.path.join(suite_dir,cnf_file))
285
 
            if cnf_flag: # we found a proper file and need to override
286
 
                found_options = returned_options
287
 
        return found_options
 
299
            config_file_path = os.path.join(suite_dir,cnf_file)
 
300
            cnf_flag, returned_options = self.process_cnf_file(config_file_path)
 
301
            cnf_options += returned_options
 
302
        if cnf_flag: # we found a proper file and need to override
 
303
            found_options = cnf_options
 
304
        else:
 
305
            config_file_path = None
 
306
        return config_file_path, found_options
288
307
 
289
308
    def process_disabled_test_file(self, testdir):
290
309
        """ Checks and processes the suite's disabled.def