Skip to content

Conversation

@kalenkevich
Copy link
Collaborator

Description

This PR introduces an integration testing framework for agents, enabling deterministic testing with mocked model responses.

Key Changes:

  • Testing Utilities (tests/integration/agents/test_case_utils.ts):

    • Implemented MockGenAIClient and GeminiWithMockResponses to simulate LLM interactions using predefined GenerateContentResponse objects.

    • Added runTestCase helper to execute agent flows, verify expected ADK Event sequences, and validate event structure (ignoring non-deterministic fields like IDs and timestamps).

  • Reference Integration Test (tests/integration/agents/simple_agent_with_tools/):

    • Created a sample LlmAgent ("weather_time_agent") with get_weather and get_current_time tools to serve as a test subject.
    • Added a Vitest test suite (agent_test.ts) that runs a multi-turn conversation.
    • Included JSON fixtures for mocked model responses and expected event outputs.

This infrastructure allows for reliable, offline integration testing of agent behaviors and tool execution flows.

@kalenkevich kalenkevich self-assigned this Jan 30, 2026
@kalenkevich kalenkevich force-pushed the chore/integration_tests branch 3 times, most recently from 7705683 to 1bc4207 Compare January 30, 2026 08:37
@kalenkevich kalenkevich force-pushed the chore/integration_tests branch from ddc0c5b to cb3b454 Compare January 30, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant