From f80c1347726076fa0570898bae5b19acd05eea11 Mon Sep 17 00:00:00 2001 From: Abram Date: Thu, 25 Jan 2024 11:52:46 +0100 Subject: [PATCH] Update - fix failing tests --- .../tests/variants_main_router/conftest.py | 5 ++++- .../test_variant_evaluators_router.py | 18 ------------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/agenta-backend/agenta_backend/tests/variants_main_router/conftest.py b/agenta-backend/agenta_backend/tests/variants_main_router/conftest.py index 3a3d58979a..11a22c4243 100644 --- a/agenta-backend/agenta_backend/tests/variants_main_router/conftest.py +++ b/agenta-backend/agenta_backend/tests/variants_main_router/conftest.py @@ -228,7 +228,10 @@ def use_open_ai_key(): @pytest.fixture(scope="session") def fetch_single_prompt_template(fetch_templates): - return fetch_templates[1] + return next( + (temp for temp in fetch_templates if temp["image"]["name"] == "chat_openai"), + None, + ) @pytest.fixture() diff --git a/agenta-backend/agenta_backend/tests/variants_main_router/test_variant_evaluators_router.py b/agenta-backend/agenta_backend/tests/variants_main_router/test_variant_evaluators_router.py index e977bfeac0..ed1d46d839 100644 --- a/agenta-backend/agenta_backend/tests/variants_main_router/test_variant_evaluators_router.py +++ b/agenta-backend/agenta_backend/tests/variants_main_router/test_variant_evaluators_router.py @@ -147,24 +147,6 @@ async def test_get_evaluator_configs(): assert type(response.json()) == list -@pytest.mark.asyncio -async def test_update_app_variant_parameters(update_app_variant_parameters): - app = await AppDB.find_one(AppDB.app_name == APP_NAME) - testset = await TestSetDB.find_one(TestSetDB.app.id == app.id) - app_variant = await AppVariantDB.find_one( - AppVariantDB.app.id == app.id, AppVariantDB.variant_name == "app.default" - ) - - parameters = update_app_variant_parameters - parameters["inputs"] = [{"name": list(testset.csvdata[0].keys())[0]}] - payload = {"parameters": parameters} - - response = await test_client.put( - f"{BACKEND_API_HOST}/variants/{str(app_variant.id)}/parameters/", json=payload - ) - assert response.status_code == 200 - - @pytest.mark.asyncio async def test_create_evaluation(): # Fetch app, app_variant and testset