Skip to content

Commit

Permalink
Add test_mlflow_server_command (#5043)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <hkawamura0130@gmail.com>
  • Loading branch information
harupy committed Nov 11, 2021
1 parent 57c3d8b commit 171a1ed
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import tempfile
import time
import subprocess
import requests

from urllib.request import url2pathname
from urllib.parse import urlparse, unquote
Expand All @@ -22,7 +23,22 @@
from mlflow.exceptions import MlflowException
from mlflow.entities import ViewType

from tests.helper_functions import pyfunc_serve_and_score_model
from tests.helper_functions import pyfunc_serve_and_score_model, get_safe_port
from tests.tracking.integration_test_utils import _await_server_up_or_die


@pytest.mark.parametrize("command", ["server", "ui"])
def test_mlflow_server_command(command):
port = get_safe_port()
cmd = ["mlflow", command, "--port", str(port)]
process = subprocess.Popen(cmd)
try:
_await_server_up_or_die(port, timeout=10)
resp = requests.get(f"http://localhost:{port}/health")
resp.raise_for_status()
assert resp.text == "OK"
finally:
process.kill()


def test_server_static_prefix_validation():
Expand Down

0 comments on commit 171a1ed

Please sign in to comment.