Skip to content

Conversation

@chidozieononiwu
Copy link
Member

What does this PR do?

Migrate Azure.Mcp.Tools.Communication to Recorded Tests

GitHub issue number?

Resolves #1280

@chidozieononiwu chidozieononiwu force-pushed the LiveToRecordedTestsCommunication branch from 2cfd1e7 to 8743a54 Compare January 27, 2026 22:54
@scbedd scbedd marked this pull request as ready for review January 30, 2026 22:39
@scbedd scbedd requested review from a team and KarishmaGhiya as code owners January 30, 2026 22:39
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 pull request migrates the Azure.Mcp.Tools.Communication.LiveTests from live tests to recorded tests, enabling the tests to run without requiring a .testsettings.json file. The migration follows the established pattern for recorded tests using the test proxy framework.

Changes:

  • Migrated test classes from CommandTestsBase to RecordedCommandTestsBase with proper primary constructor syntax
  • Updated CommunicationService to use HttpClientTransport with TenantService.GetClient() for recording support
  • Added assets.json file for test recording metadata

Reviewed changes

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

File Description
tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/assets.json Added test recording assets configuration with TagPrefix and Tag values
tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/Email/EmailSendCommandLiveTests.cs Migrated to RecordedCommandTestsBase, added sanitizers and initialization logic for playback/live modes
tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs Migrated to RecordedCommandTestsBase, added sanitizers and initialization logic for SMS tests
tools/Azure.Mcp.Tools.Communication/src/Services/CommunicationService.cs Updated to inject HttpClient via TenantService for recording support
Comments suppressed due to low confidence (1)

tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs:146

  • The assertion changed from checking if 'to' starts with '+' to checking exact equality with toSms (which has the '+' prefix removed). However, in live mode, the SMS service returns phone numbers with the '+' prefix. This assertion will fail in live mode because the API response will contain "+12345678901" but toSms contains "12345678901". In playback mode it works because the sanitizer replaces the value. Consider either keeping the original StartsWith check or prepending '+' to toSms in the assertion.
    [InlineData("--endpoint https://mycomm.communication.azure.com --from")]

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Jan 30, 2026
@KarishmaGhiya KarishmaGhiya merged commit de3e53f into microsoft:main Jan 30, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Migrate Azure.Mcp.Tools.Communication.LiveTests LiveTests to Recorded Tests

3 participants