~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/dbqp.py

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
 
# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
# -*- mode: python; indent-tabs-mode: nil; -*-
3
3
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
4
#
5
5
# Copyright (C) 2010 Patrick Crews
51
51
execution_manager = None
52
52
 
53
53
try:
54
 
    # Some system-level work is constant regardless
55
 
    # of the test to be run
56
 
    system_manager = systemManager(variables)
57
 
 
58
 
    # Create our server_manager
59
 
    server_manager = serverManager(system_manager, variables)
60
 
 
61
 
    # Get our mode-specific test_manager and test_executor
62
 
    (test_manager,test_executor) = handle_mode(variables, system_manager)
63
 
 
64
 
    # Gather our tests for execution
65
 
    test_manager.gather_tests()
66
 
 
67
 
    # Initialize test execution manager
68
 
    execution_manager = executionManager(server_manager, system_manager
69
 
                                    , test_manager, test_executor
70
 
                                    , variables)
71
 
 
72
 
    # Execute our tests!
73
 
    execution_manager.execute_tests()
74
 
 
75
 
except Exception, e:
76
 
   print Exception, e
77
 
 
78
 
except KeyboardInterrupt:
79
 
  print "\n\nDetected <Ctrl>+c, shutting down and cleaning up..."
 
54
    # We do this nested try to accomodate red hat
 
55
    # running python 2.4...seriously?  2.4?
 
56
    try:
 
57
        # Some system-level work is constant regardless
 
58
        # of the test to be run
 
59
        system_manager = systemManager(variables)
 
60
 
 
61
        # Create our server_manager
 
62
        server_manager = serverManager(system_manager, variables)
 
63
 
 
64
        # Get our mode-specific test_manager and test_executor
 
65
        (test_manager,test_executor) = handle_mode(variables, system_manager)
 
66
 
 
67
        # Gather our tests for execution
 
68
        test_manager.gather_tests()
 
69
 
 
70
        # Initialize test execution manager
 
71
        execution_manager = executionManager(server_manager, system_manager
 
72
                                        , test_manager, test_executor
 
73
                                        , variables)
 
74
 
 
75
        # Execute our tests!
 
76
        execution_manager.execute_tests()
 
77
    
 
78
    except Exception, e:
 
79
       print Exception, e
 
80
 
 
81
    except KeyboardInterrupt:
 
82
      print "\n\nDetected <Ctrl>+c, shutting down and cleaning up..."
80
83
 
81
84
finally:
82
85
# TODO - make a more robust cleanup
83
86
# At the moment, runaway servers are our biggest concern
84
87
    if server_manager and not variables['startandexit']:
85
 
        server_manager.cleanup()
86
 
 
 
88
        if variables['gdb']:
 
89
            server_manager.cleanup_all_servers()
 
90
        else:
 
91
            server_manager.cleanup()
87
92
    if not variables['startandexit']:
88
93
        if test_manager:
89
94
            fail_count = test_manager.has_failing_tests()