def test_create_default_action_command(self): config = schema.ConfigActionRunner( schema.ActionRunnerTypes.none.value, None, None, ) factory = actioncommand.create_action_runner_factory_from_config( config, ) assert type(factory) is actioncommand.NoActionRunnerFactory
def test_create_action_command_with_simple_runner(self): status_path, exec_path = '/tmp/what', '/remote/bin' config = schema.ConfigActionRunner('subprocess', status_path, exec_path) factory = actioncommand.create_action_runner_factory_from_config( config) assert_equal(factory.status_path, status_path) assert_equal(factory.exec_path, exec_path)
def build_job_scheduler_factory(self, master_config): output_stream_dir = master_config.output_stream_dir or self.working_dir action_runner = actioncommand.create_action_runner_factory_from_config( master_config.action_runner) return job.JobSchedulerFactory( self.context, output_stream_dir, master_config.time_zone, action_runner)
def build_job_scheduler_factory(self, master_config): output_stream_dir = master_config.output_stream_dir or self.working_dir action_runner = actioncommand.create_action_runner_factory_from_config( master_config.action_runner, ) return job.JobSchedulerFactory( self.context, output_stream_dir, master_config.time_zone, action_runner, )
def initial_setup(self): """When the MCP is initialized the config is applied before the state. In this case jobs shouldn't be scheduled until the state is applied. """ self._load_config() self.restore_state( actioncommand.create_action_runner_factory_from_config( self.config.load().get_master().action_runner)) # Any job with existing state would have been scheduled already. Jobs # without any state will be scheduled here. self.jobs.run_queue_schedule()
def test_create_action_command_with_simple_runner(self): status_path, exec_path = '/tmp/what', '/remote/bin' config = schema.ConfigActionRunner( schema.ActionRunnerTypes.subprocess.value, status_path, exec_path, ) factory = actioncommand.create_action_runner_factory_from_config( config, ) assert_equal(factory.status_path, status_path) assert_equal(factory.exec_path, exec_path)
def initial_setup(self): """When the MCP is initialized the config is applied before the state. In this case jobs shouldn't be scheduled until the state is applied. """ self._load_config() self.restore_state( actioncommand.create_action_runner_factory_from_config( self.config.load().get_master().action_runner ) ) # Any job with existing state would have been scheduled already. Jobs # without any state will be scheduled here. self.jobs.run_queue_schedule()
def test_create_action_command_with_simple_runner(self): status_path, exec_path = "/tmp/what", "/remote/bin" config = schema.ConfigActionRunner("subprocess", status_path, exec_path) factory = actioncommand.create_action_runner_factory_from_config(config) assert_equal(factory.status_path, status_path) assert_equal(factory.exec_path, exec_path)
def test_create_default_action_command(self): config = schema.ConfigActionRunner("none", None, None) factory = actioncommand.create_action_runner_factory_from_config(config) assert_equal(factory, actioncommand.NoActionRunnerFactory)
def test_create_default_action_command_no_config(self): config = () factory = actioncommand.create_action_runner_factory_from_config(config) assert_equal(factory, actioncommand.NoActionRunnerFactory)
def test_create_default_action_command(self): config = schema.ConfigActionRunner('none', None, None) factory = actioncommand.create_action_runner_factory_from_config( config) assert_equal(factory, actioncommand.NoActionRunnerFactory)
def test_create_default_action_command_no_config(self): config = () factory = actioncommand.create_action_runner_factory_from_config( config) assert_equal(factory, actioncommand.NoActionRunnerFactory)