def start(self): if not self.super(): return False trac_env = self._trac_functional_test_environment trac_env.tester = trac_env.build_tester() trac_env.tester.url = trac_env.url return True def destroy(self): self.super() self._trac_functional_test_environment.destroy() def environment_information(self): first_env_info = self.super() second_env_info = self._trac_functional_test_environment.environment_information( ) return ' -- '.join([first_env_info, second_env_info]) def get_key(cls): return 'agilo_multi' get_key = classmethod(get_key) # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment( MultiEnvironmentFunctionalTestEnvironment.get_key(), MultiEnvironmentFunctionalTestEnvironment)
def stop_windmill(self): # The Firefox test wrapper currently can't kill the browser (on OS X) # after a testrun -- see http://trac.getwindmill.com/ticket/313 if self.is_windmill_initialized(): try: teardown(self.windmill_shell) except (ValueError, AssertionError), exception: # Mozrunner mac has a bug in the teardown code that will spit this out quite regulary # I swallow this exception here because the global exception handler throws away the test # output if this exception gets through which can easily make the entire test run unusable # This should be solved by mozrunner v2 in windmill 1.4 or 1.5 # TODO: log the exception pass self._windmill_initialized = False def disable_windmill_console_log_spam(self): # Windmill overwrites the root loggers level if present - so we feed it whatever was configured before # See http://trac.getwindmill.com/ticket/314 # See <windmill>/bin/admin_lib.py windmill.settings['CONSOLE_LOG_LEVEL'] = 'ERROR' # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment(AgiloFunctionalTestEnvironment.get_key(), AgiloFunctionalTestEnvironment)
proc_args.append(self.envdir) return proc_args def _start_standalone_tracd(self): "Start a standalone tracd and return its pid." if 'FIGLEAF' in os.environ: exe = os.environ['FIGLEAF'] else: exe = sys.executable proc_args = self._get_process_arguments() #print 'starting server', exe, ' '.join(proc_args) server = Popen([exe] + proc_args, stdout=self.logfile, stderr=self.logfile, close_fds=close_fds, cwd=self.command_cwd) return server.pid def _upgrade_environment(self): # Upgrading the environment is not necessary for trac but for all # plugins which need to do some database modifications. # '--no-backup' is important if you don't use sqlite. self._tracadmin('upgrade', '--no-backup') # ------------------------------------------------------------------------- # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment(TracFunctionalTestEnvironment.get_key(), TracFunctionalTestEnvironment)
return args def start(self): if not self.super(): return False trac_env = self._trac_functional_test_environment trac_env.tester = trac_env.build_tester() trac_env.tester.url = trac_env.url return True def destroy(self): self.super() self._trac_functional_test_environment.destroy() def environment_information(self): first_env_info = self.super() second_env_info = self._trac_functional_test_environment.environment_information() return ' -- '.join([first_env_info, second_env_info]) def get_key(cls): return 'agilo_multi' get_key = classmethod(get_key) # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment(MultiEnvironmentFunctionalTestEnvironment.get_key(), MultiEnvironmentFunctionalTestEnvironment)
# Then start windmill and the browser self.windmill_shell = setup() self.windmill_shell['start_' + self.windmill_browser]() def stop_windmill(self): # The Firefox test wrapper currently can't kill the browser (on OS X) # after a testrun -- see http://trac.getwindmill.com/ticket/313 if self.is_windmill_initialized(): try: teardown(self.windmill_shell) except (ValueError, AssertionError), exception: # Mozrunner mac has a bug in the teardown code that will spit this out quite regulary # I swallow this exception here because the global exception handler throws away the test # output if this exception gets through which can easily make the entire test run unusable # This should be solved by mozrunner v2 in windmill 1.4 or 1.5 # TODO: log the exception pass self._windmill_initialized = False def disable_windmill_console_log_spam(self): # Windmill overwrites the root loggers level if present - so we feed it whatever was configured before # See http://trac.getwindmill.com/ticket/314 # See <windmill>/bin/admin_lib.py windmill.settings['CONSOLE_LOG_LEVEL'] = 'ERROR' # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment( AgiloFunctionalTestEnvironment.get_key(), AgiloFunctionalTestEnvironment)
return proc_args def _start_standalone_tracd(self): "Start a standalone tracd and return its pid." if 'FIGLEAF' in os.environ: exe = os.environ['FIGLEAF'] else: exe = sys.executable proc_args = self._get_process_arguments() #print 'starting server', exe, ' '.join(proc_args) server = Popen([exe] + proc_args, stdout=self.logfile, stderr=self.logfile, close_fds=close_fds, cwd=self.command_cwd) return server.pid def _upgrade_environment(self): # Upgrading the environment is not necessary for trac but for all # plugins which need to do some database modifications. # '--no-backup' is important if you don't use sqlite. self._tracadmin('upgrade', '--no-backup') # ------------------------------------------------------------------------- # Register this module with the EnvironmentBuilder from agilo.test.functional.api import EnvironmentBuilder EnvironmentBuilder.register_environment( TracFunctionalTestEnvironment.get_key(), TracFunctionalTestEnvironment)