Skip to content

test: updated the unit testcases to update the latest agent framework version#862

Merged
Roopan-Microsoft merged 3 commits intodev-v4from
psl-latestversinov2
Mar 17, 2026
Merged

test: updated the unit testcases to update the latest agent framework version#862
Roopan-Microsoft merged 3 commits intodev-v4from
psl-latestversinov2

Conversation

@Dhruvkumar-Microsoft
Copy link
Collaborator

Purpose

This pull request updates the test suite and requirements to support the new agent-framework release candidate (rc4) and its related modules. The changes include updating mocks and test logic to reflect new core classes (Agent, Message), removal of the local code interpreter tool (now handled server-side), and adjustments to test dependencies and assertions. These updates ensure compatibility with the latest agent framework and streamline agent-related testing.

Agent Framework Integration and Mock Updates:

  • Added agent-framework-core, agent-framework-azure-ai, and agent-framework-orchestrations to requirements.txt to support new agent framework modules.
  • Updated test mocks to include new classes (Agent, Message, AgentSession, etc.), and created mocks for new submodules such as agent_framework_orchestrations. [1] [2] [3] [4]
  • Changed test logic and assertions to use Agent and Message instead of ChatAgent and ChatMessage, reflecting the new framework API. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Code Interpreter Tool Handling:

  • Removed local instantiation and testing of HostedCodeInterpreterTool; tests now assert that code interpreter functionality is handled server-side by AzureAIClient, as per rc4 changes. [1] [2] [3]

Test Dependency and Mock Adjustments:

  • Added mocks for new dependencies such as azure.identity.aio and common.config.app_config to ensure test isolation and compatibility.
  • Updated agent property references in tests to use client instead of chat_client per new agent framework conventions. [1] [2]

These changes collectively update the test suite for compatibility with the latest agent framework, improve test reliability, and reflect new agent lifecycle and tool handling patterns.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the test suite and requirements.txt to support a new agent-framework release candidate (rc4). Core changes rename ChatAgentAgent, ChatMessageMessage, and run_streamrun(..., stream=True), and remove local HostedCodeInterpreterTool usage (now server-side).

Changes:

  • Updated all test mocks and assertions to use new agent framework API names (Agent, Message, run instead of ChatAgent, ChatMessage, run_stream)
  • Added mocks for new agent_framework_orchestrations submodules and updated conftest.py shared fixtures
  • Pinned all dependencies in requirements.txt and added new agent-framework-* packages

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/backend/requirements.txt Pinned all deps, added agent-framework-core/azure-ai/orchestrations, removed semantic-kernel/autogen/babel
src/tests/backend/conftest.py Added Agent, Message, AgentSession classes and agent_framework_orchestrations mock modules
src/tests/backend/v4/orchestration/test_orchestration_manager.py Updated mocks/assertions for new event dispatch model and run API
src/tests/backend/v4/orchestration/test_human_approval_manager.py Added agent_framework_orchestrations mocks and Message/AgentResponse
src/tests/backend/v4/magentic_agents/test_foundry_agent.py Updated to Agent/Message, removed HostedCodeInterpreterTool tests
src/tests/backend/v4/magentic_agents/common/test_lifecycle.py Changed chat_clientclient, added config mocks
src/tests/backend/v4/callbacks/test_response_handlers.py Added MockMessage, updated isinstance checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Roopan-Microsoft Roopan-Microsoft merged commit 9bd6f91 into dev-v4 Mar 17, 2026
11 checks passed
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.

3 participants