Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to make sure mlflow ui and mlflow server commands run successfully #5043

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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:
BenWilson2 marked this conversation as resolved.
Show resolved Hide resolved
_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