Пример #1
0
def test_main():
    with contextlib.nested(
        mock.patch('paasta_tools.native_mesos_scheduler.get_paasta_native_jobs_for_cluster',
                   return_value=[('service1', 'instance1'), ('service2', 'instance2')],
                   autospec=True),
        mock.patch('paasta_tools.native_mesos_scheduler.create_driver', autospec=True),
        mock.patch('paasta_tools.native_mesos_scheduler.sleep', autospec=True),
        mock.patch('paasta_tools.native_mesos_scheduler.load_system_paasta_config', autospec=True),
        mock.patch('paasta_tools.native_mesos_scheduler.PaastaScheduler', autospec=True),
    ):
        native_mesos_scheduler.main(["--stay-alive-seconds=0"])
Пример #2
0
def run_native_mesos_scheduler_main(context):
    clear_mesos_tools_cache()
    context.main_schedulers = main([
        '--soa-dir', context.soa_dir,
        '--stay-alive-seconds', '10',
        '--periodic-interval', '1'
    ])
Пример #3
0
def run_native_mesos_scheduler_main(context):
    clear_mesos_tools_cache()
    context.main_schedulers = main([
        '--soa-dir', context.soa_dir,
        '--stay-alive-seconds', '10',
        '--periodic-interval', '1'
    ])
def test_main():
    with mock.patch(
        "paasta_tools.native_mesos_scheduler.get_paasta_native_jobs_for_cluster",
        return_value=[("service1", "instance1"), ("service2", "instance2")],
        autospec=True,
    ), mock.patch(
        "paasta_tools.native_mesos_scheduler.create_driver", autospec=True
    ), mock.patch(
        "paasta_tools.native_mesos_scheduler.sleep", autospec=True
    ), mock.patch(
        "paasta_tools.native_mesos_scheduler.load_system_paasta_config", autospec=True
    ), mock.patch(
        "paasta_tools.native_mesos_scheduler.compose_job_id", autospec=True
    ), mock.patch(
        "paasta_tools.native_mesos_scheduler.NativeScheduler", autospec=True
    ):
        native_mesos_scheduler.main(["--stay-alive-seconds=0"])
Пример #5
0
def test_main():
    with contextlib.nested(
            mock.patch(
                'paasta_tools.native_mesos_scheduler.get_paasta_native_jobs_for_cluster',
                return_value=[('service1', 'instance1'),
                              ('service2', 'instance2')],
                autospec=True),
            mock.patch('paasta_tools.native_mesos_scheduler.create_driver',
                       autospec=True),
            mock.patch('paasta_tools.native_mesos_scheduler.sleep',
                       autospec=True),
            mock.patch(
                'paasta_tools.native_mesos_scheduler.load_system_paasta_config',
                autospec=True),
            mock.patch('paasta_tools.native_mesos_scheduler.PaastaScheduler',
                       autospec=True),
    ):
        native_mesos_scheduler.main(["--stay-alive-seconds=0"])
Пример #6
0
def run_native_mesos_scheduler_main(context):
    clear_mesos_tools_cache()
    context.main_schedulers = main([
        "--soa-dir",
        context.soa_dir,
        "--stay-alive-seconds",
        "10",
        "--periodic-interval",
        "1",
    ])
Пример #7
0
def run_native_mesos_scheduler_main(context):
    clear_mesos_tools_cache()
    context.main_schedulers = main(
        ["--soa-dir", context.soa_dir, "--stay-alive-seconds", "10", "--periodic-interval", "1"]
    )