-
Notifications
You must be signed in to change notification settings - Fork 356
Migrate Communication LiveTests to RecordedTests #1424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Communication LiveTests to RecordedTests #1424
Conversation
2cfd1e7 to
8743a54
Compare
...ols.Communication/tests/Azure.Mcp.Tools.Communication.LiveTests/CommunicationCommandTests.cs
Show resolved
Hide resolved
There was a problem hiding this 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
CommandTestsBasetoRecordedCommandTestsBasewith proper primary constructor syntax - Updated
CommunicationServiceto useHttpClientTransportwithTenantService.GetClient()for recording support - Added
assets.jsonfile 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")]
What does this PR do?
Migrate
Azure.Mcp.Tools.Communicationto Recorded TestsGitHub issue number?
Resolves #1280