Skip to content

Define agent integration tests framework#100

Merged
kalenkevich merged 1 commit into
mainfrom
chore/integration_tests
Feb 2, 2026
Merged

Define agent integration tests framework#100
kalenkevich merged 1 commit into
mainfrom
chore/integration_tests

Conversation

@kalenkevich
Copy link
Copy Markdown
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 4 times, most recently from ddc0c5b to cb3b454 Compare January 30, 2026 21:38
Copy link
Copy Markdown
Member

@ScottMansfield ScottMansfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after an offline conversation. This is good for now as a stopgap but we will be integrating with the conformance testing soon so some of this will be redone.

@kalenkevich kalenkevich force-pushed the chore/integration_tests branch from cb3b454 to f9aa502 Compare February 2, 2026 22:33
@kalenkevich kalenkevich merged commit 4d7eeb6 into main Feb 2, 2026
6 of 12 checks passed
@kalenkevich kalenkevich deleted the chore/integration_tests branch February 2, 2026 23:00
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.

2 participants