Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions automl-service/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def pytest_configure(config):
config.option.htmlpath = str(report_dir / filename)


@pytest.fixture(autouse=True)
def _use_local_mlflow_tracking_uri(monkeypatch):
"""Keep tests on the repo-local MLflow store instead of inherited remote URIs."""
tracking_uri = Path(__file__).resolve().parent.parent / "mlruns"
tracking_uri.mkdir(exist_ok=True)
monkeypatch.setenv("MLFLOW_TRACKING_URI", str(tracking_uri))


# ---------------------------------------------------------------------------
# Auto-skip markers when optional packages are absent
# ---------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion automl-service/tests/test_api_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def _make_success_response(model_id: str, model_version: int = 3):


@pytest.mark.asyncio
async def test_deploy_from_job_happy_path(app_client):
async def test_deploy_from_job_happy_path(app_client, monkeypatch):
"""
Verifies that the helper that reaches out to domino to get jobs is called and that the domino api
for creating model apis is called
"""
monkeypatch.setenv("DOMINO_ENVIRONMENT_ID", "fakeenvid")
set_request_auth_header("Bearer test-token")
job_id = "8771df7b-5550-4b6e-bea9-838f9fad040b"
project_id = "69c66e4d729d187bd89d71f4"
Expand All @@ -54,4 +55,5 @@ async def test_deploy_from_job_happy_path(app_client):
set_request_auth_header(None)
body = response.json()

assert body['success'], f"Body was not successful, {body}"
assert response.status_code == 200