From 00df9169db1c4e052bb8410dca1e741d585eff0d Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 11:59:23 -0400 Subject: [PATCH 1/6] Remove unnecessary installation step for K* MCP Server image --- mcp_server/Dockerfile.mcp | 1 - 1 file changed, 1 deletion(-) diff --git a/mcp_server/Dockerfile.mcp b/mcp_server/Dockerfile.mcp index 7c578e6..09a6767 100644 --- a/mcp_server/Dockerfile.mcp +++ b/mcp_server/Dockerfile.mcp @@ -1,6 +1,5 @@ FROM python:3.11 -RUN apt-get update && apt-get install -y cmake make g++ COPY mcp_server /src/mcp_server WORKDIR /src RUN pip install -r mcp_server/requirements.txt From 082154d7d26e5f2dd6a5f278261e929f91f681d3 Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 12:04:55 -0400 Subject: [PATCH 2/6] Refactor integration test for K* MCP Server test --- mcp_server/tests/test_container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp_server/tests/test_container.py b/mcp_server/tests/test_container.py index c81b0f0..95ada23 100644 --- a/mcp_server/tests/test_container.py +++ b/mcp_server/tests/test_container.py @@ -23,10 +23,10 @@ async def test_planner_tool_t(self) -> None: payload = await client.call_tool( "KstarPlannerUnorderedTopQ", - {"domain": domain, "problem": problem}, + {"domain": domain, "problem": problem, "quality_bound": 20.0, "num_plans": 1000}, ) assert payload is not None - assert len(payload.structured_content["plans"]) == 1 + assert len(payload.structured_content["plans"]) == 1000 optimal_plan = payload.structured_content["plans"][0] assert len(optimal_plan["actions"]) == 4 assert optimal_plan["cost"] == 4 From 52396202f13cf75ff7602705772bd5f58a750b91 Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 12:19:38 -0400 Subject: [PATCH 3/6] Observe failed assertions at Github Action --- mcp_server/tests/test_container.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mcp_server/tests/test_container.py b/mcp_server/tests/test_container.py index 95ada23..0fe30dd 100644 --- a/mcp_server/tests/test_container.py +++ b/mcp_server/tests/test_container.py @@ -25,8 +25,8 @@ async def test_planner_tool_t(self) -> None: "KstarPlannerUnorderedTopQ", {"domain": domain, "problem": problem, "quality_bound": 20.0, "num_plans": 1000}, ) - assert payload is not None - assert len(payload.structured_content["plans"]) == 1000 + assert payload is not None, "Payload is empty." + assert len(payload.structured_content["plans"]) == 1000, "The number of plans is not 1000." optimal_plan = payload.structured_content["plans"][0] - assert len(optimal_plan["actions"]) == 4 - assert optimal_plan["cost"] == 4 + assert len(optimal_plan["actions"]) == 4, "Four actions should be found in the optimal plan." + assert optimal_plan["cost"] == 4, "The cost of the optimal plan should be 4." From c59da14dec322e032f97640f2272413588c118e4 Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 12:26:00 -0400 Subject: [PATCH 4/6] Update assertion failure messages --- mcp_server/tests/test_container.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcp_server/tests/test_container.py b/mcp_server/tests/test_container.py index 0fe30dd..943e5ce 100644 --- a/mcp_server/tests/test_container.py +++ b/mcp_server/tests/test_container.py @@ -26,7 +26,7 @@ async def test_planner_tool_t(self) -> None: {"domain": domain, "problem": problem, "quality_bound": 20.0, "num_plans": 1000}, ) assert payload is not None, "Payload is empty." - assert len(payload.structured_content["plans"]) == 1000, "The number of plans is not 1000." + assert len(payload.structured_content["plans"]) == 1000, "The number of plans returned by KstarPlannerUnorderedTopQ is not 1000." optimal_plan = payload.structured_content["plans"][0] - assert len(optimal_plan["actions"]) == 4, "Four actions should be found in the optimal plan." - assert optimal_plan["cost"] == 4, "The cost of the optimal plan should be 4." + assert len(optimal_plan["actions"]) == 4, "Four actions should be found in the optimal plan returned by KstarPlannerUnorderedTopQ" + assert optimal_plan["cost"] == 4, "The cost of the optimal plan returned by KstarPlannerUnorderedTopQ should be 4." From 2edc766a22e8f973877bc2ba4a6e27ed49e22358 Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 12:36:27 -0400 Subject: [PATCH 5/6] Show assertion success message on Github Action --- mcp_server/tests/test_container.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/mcp_server/tests/test_container.py b/mcp_server/tests/test_container.py index 943e5ce..0536de9 100644 --- a/mcp_server/tests/test_container.py +++ b/mcp_server/tests/test_container.py @@ -25,8 +25,25 @@ async def test_planner_tool_t(self) -> None: "KstarPlannerUnorderedTopQ", {"domain": domain, "problem": problem, "quality_bound": 20.0, "num_plans": 1000}, ) - assert payload is not None, "Payload is empty." - assert len(payload.structured_content["plans"]) == 1000, "The number of plans returned by KstarPlannerUnorderedTopQ is not 1000." + + assertion_status_payload = payload is not None + assert assertion_status_payload, "Payload is empty." + if assertion_status_payload: + print("Payload is not empty.") + + assertion_status_plans = len(payload.structured_content["plans"]) == 1000 + assert assertion_status_plans, "The number of plans returned by KstarPlannerUnorderedTopQ is not 1000." + if assertion_status_payload: + print("The number of plans returned by KstarPlannerUnorderedTopQ is 1000.") + optimal_plan = payload.structured_content["plans"][0] - assert len(optimal_plan["actions"]) == 4, "Four actions should be found in the optimal plan returned by KstarPlannerUnorderedTopQ" - assert optimal_plan["cost"] == 4, "The cost of the optimal plan returned by KstarPlannerUnorderedTopQ should be 4." + + assertion_status_actions = len(optimal_plan["actions"]) == 4 + assert assertion_status_actions, "The number of actions found in the optimal plan returned by KstarPlannerUnorderedTopQ is not 4." + if assertion_status_actions: + print("Four actions are found in the optimal plan returned by KstarPlannerUnorderedTopQ.") + + assertion_status_cost = optimal_plan["cost"] == 4 + assert assertion_status_cost, "The cost of the optimal plan returned by KstarPlannerUnorderedTopQ is not 4." + if assertion_status_cost: + print("The cost of the optimal plan returned by KstarPlannerUnorderedTopQ is 4.") From 412dc9aced06da55c8b83a1594fe6bbd8275df8c Mon Sep 17 00:00:00 2001 From: Jungkoo Kang Date: Mon, 13 Oct 2025 12:37:08 -0400 Subject: [PATCH 6/6] Update workflow to show messages from pytest --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1161b33..f27ae5e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -104,4 +104,4 @@ jobs: - name: Test MCP Server Container env: MCP_SERVER_URL: http://localhost:8000/mcp - run: python -m pytest mcp_server/tests/test_container.py \ No newline at end of file + run: python -m pytest -s mcp_server/tests/test_container.py \ No newline at end of file