diff --git a/services/core-ai/tests/QUALITY_TESTS.md b/services/core-ai/tests/QUALITY_TESTS.md index b18c400..9e27e1e 100644 --- a/services/core-ai/tests/QUALITY_TESTS.md +++ b/services/core-ai/tests/QUALITY_TESTS.md @@ -73,6 +73,12 @@ pytest tests/test_ai_flow_quality.py -k regression -v - **Expected**: Multiple tool calls (get_current_time × 2, synthesis) - **Performance Target**: < 30s +### Scenario 6: DNS Lookup (OpenAPI Discovery) +- **Query**: "What are the A records for github.com? Use the core-api DNS lookup tool." +- **Expected**: Uses DNS lookup tool discovered via OpenAPI from core-api +- **Performance Target**: < 15s +- **Purpose**: Tests OpenAPI tool discovery and infrastructure integration + ## Report Format Reports are saved in two formats: diff --git a/services/core-ai/tests/test_ai_flow_quality.py b/services/core-ai/tests/test_ai_flow_quality.py index 53b8ab5..1f09b06 100644 --- a/services/core-ai/tests/test_ai_flow_quality.py +++ b/services/core-ai/tests/test_ai_flow_quality.py @@ -394,6 +394,30 @@ async def test_scenario5_multi_tool_reasoning(): print(f"✓ Multi-tool query: {result['total_time']:.2f}s") +@pytest.mark.asyncio +async def test_scenario6_dns_lookup(): + """ + Scenario 6: DNS Lookup + + Expected: Uses DNS lookup tool from core-api (discovered via OpenAPI) + Performance target: < 15s + """ + async with AIFlowTester() as tester: + result = await tester.chat( + "What are the A records for github.com? Use the core-api DNS lookup tool." + ) + + tester.assert_response_quality( + result, + expected_keywords=["github", "record"], + min_length=30, + max_time=15.0 + ) + + assert result["success"], "Request failed" + print(f"✓ DNS lookup query: {result['total_time']:.2f}s") + + @pytest.mark.asyncio async def test_tools_disabled(): """ @@ -537,6 +561,11 @@ async def run_full_quality_check(): "query": "Get current time in NYC and Tokyo, calculate difference", "test": test_scenario5_multi_tool_reasoning }, + { + "name": "Scenario 6: DNS Lookup", + "query": "What are the A records for github.com? Use the core-api DNS lookup tool.", + "test": test_scenario6_dns_lookup + }, ] print("\n" + "=" * 80)