~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/test_mgmt/test_management.py

  • Committer: patrick crews
  • Date: 2011-02-23 17:17:25 UTC
  • mto: (2195.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2196.
  • Revision ID: gleebix@gmail.com-20110223171725-4tgewemxhsw1m7q8
Integrated randgen with dbqp.  We now have mode=randgen and a set of randgen test suites (very basic now).  Output = same as dtr : )  We also have mode=cleanup to kill any servers we have started.  Docs updates too.  Gendata utility allows us to populate test servers 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# along with this program; if not, write to the Free Software
19
19
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
20
 
21
 
""" dtr_test_management:
 
21
""" test_management:
22
22
    code related to the gathering / analysis / management of 
23
23
    the test cases
24
24
    ie - collecting the list of tests in each suite, then
33
33
import sys
34
34
import thread
35
35
          
36
 
class testManager:
 
36
class testManager(object):
37
37
    """Deals with scanning test directories, gathering test cases, and 
38
38
       collecting per-test information (opt files, etc) for use by the
39
39
       test-runner
42
42
 
43
43
    def __init__( self, verbose, debug, default_engine, dotest, skiptest
44
44
                , reorder, suitelist, suitepaths, system_manager
45
 
                , test_cases):
 
45
                , test_cases, mode):
46
46
 
47
47
        self.system_manager = system_manager
48
48
        self.time_manager = system_manager.time_manager
68
68
        self.skiptest = skiptest
69
69
        self.reorder = reorder
70
70
        self.suitelist = suitelist
 
71
        self.mode = mode
71
72
        
72
73
        self.code_tree = self.system_manager.code_tree
73
74
        self.suitepaths = suitepaths + self.code_tree.suite_paths
87
88
        self.logging.info("Processing test suites...")
88
89
        # BEGIN terrible hack to accomodate the fact that
89
90
        # our 'main' suite is also our testdir : /
90
 
        if self.suitelist is None:
 
91
        if self.suitelist is None and self.mode=='dtr':
91
92
            self.suitepaths = [self.testdir]
92
93
            self.suitelist = ['main']
93
94
        # END horrible hack
137
138
 
138
139
        """
139
140
        # BEGIN horrible hack to accomodate bad location of main suite
140
 
        if self.suitepaths == [self.testdir] or suitename == 'main':
141
 
            # We treat this as the 'main' suite
142
 
            return self.testdir
 
141
        if self.mode == 'dtr':
 
142
            if self.suitepaths == [self.testdir] or suitename == 'main':
 
143
                # We treat this as the 'main' suite
 
144
                return self.testdir
143
145
        # END horrible hack
144
146
        for suitepath in self.suitepaths:
145
147
            suite_path = self.system_manager.find_path([ os.path.join(suitepath,suitename,'tests'),
216
218
        # This is probably hacky, but I'll think of a better
217
219
        # location later.  When we are ready to see our
218
220
        # statistical report, we know to stop the total time timer
219
 
        total_exec_time = self.time_manager.stop('total_time')
220
 
        self.logging.write_thick_line()
221
 
        self.logging.info("Test execution complete in %d seconds" %(total_exec_time))
 
221
        if not self.first_test:
 
222
            total_exec_time = self.time_manager.stop('total_time')
 
223
            self.logging.write_thick_line()
 
224
            self.logging.info("Test execution complete in %d seconds" %(total_exec_time))
222
225
        self.logging.info("Summary report:")
223
226
        self.report_executed_tests()
224
227
        self.report_test_statuses()
225
 
        self.time_manager.summary_report()
 
228
        if not self.first_test:
 
229
            self.time_manager.summary_report()
226
230
 
227
231
    def report_test_statuses(self):
228
232
        """ Method to report out various test statuses we