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
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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,
     )
Esempio n. 5
0
 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()
Esempio n. 6
0
 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)
Esempio n. 7
0
File: mcp.py Progetto: Yelp/Tron
 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()
Esempio n. 8
0
 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)
Esempio n. 9
0
 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)
Esempio n. 10
0
 def test_create_default_action_command_no_config(self):
     config = ()
     factory = actioncommand.create_action_runner_factory_from_config(config)
     assert_equal(factory, actioncommand.NoActionRunnerFactory)
Esempio n. 11
0
 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)
Esempio n. 12
0
 def test_create_default_action_command_no_config(self):
     config = ()
     factory = actioncommand.create_action_runner_factory_from_config(
         config)
     assert_equal(factory, actioncommand.NoActionRunnerFactory)