def test_run_server_gevent(): with patch("gordo.server.server.run_cmd", MagicMock(return_value=None, autospec=True)) as m: server.run_server( "127.0.0.1", 9000, 2, "debug", worker_connections=50, threads=8, worker_class="gevent", ) m.assert_called_once_with([ "gunicorn", "--bind", "127.0.0.1:9000", "--log-level", "debug", "--error-logfile", "-", "--access-logfile", "-", "--worker-class", "gevent", "--worker-tmp-dir", "/dev/shm", "--workers", "2", "--worker-connections", "50", "gordo.server.server:build_app()", ])
def run_server_cli( host, port, workers, worker_connections, threads, worker_class, log_level, server_app, with_prometheus_config, ): """ Run the gordo server app with Gunicorn """ config_module = None if with_prometheus_config: config_module = "gordo.server.prometheus.gunicorn_config" server.run_server( host, port, workers, log_level.lower(), config_module=config_module, worker_connections=worker_connections, threads=threads, worker_class=worker_class, server_app=server_app, )
def run_server_cli(host, port, workers, worker_connections, log_level): """ Run the gordo server app with Gunicorn """ server.run_server(host, port, workers, worker_connections, log_level.lower())