Add [LiveTestOnly] attribute to skip tests in Playback mode#1647
Draft
Add [LiveTestOnly] attribute to skip tests in Playback mode#1647
Conversation
- Created LiveTestOnlyAttribute in Azure.Mcp.Tests/Attributes - Attribute skips tests in Playback mode using Assert.Skip - Tests marked with this attribute will run in Live and Record modes - Intended for tests that cannot be recorded (WebSocket, TCP, etc.) Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
- Added verification tests in RecordedCommandTestsBaseTests - Tests verify the attribute can be instantiated and applied to methods - Integration testing will verify skip behavior in actual test scenarios Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
- Added detailed XML documentation with usage examples - Documented when and how to use the attribute - Listed scenarios where the attribute should be applied Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add [LiveTestOnly] Test attribute to Azure.Mcp.Tests
Add [LiveTestOnly] attribute to skip tests in Playback mode
Feb 4, 2026
Contributor
|
@copilot you need to run |
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation Complete ✅
All requirements have been successfully implemented with minimal changes.
Changes Made
LiveTestOnlyAttributeclass in/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Attributes/BeforeAfterTestAttributeTestModeinBeforemethodAssert.Skip()when inPlaybackmodeLiveandRecordmodesRecordedCommandTestsBaseTests.csFiles Changed (2 files, 161 insertions)
core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Attributes/LiveTestOnlyAttribute.cs (121 lines)
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/RecordingFramework/RecordedCommandTestsBaseTests.cs (40 lines)
How It Works
The
[LiveTestOnly]attribute:Usage
Validation
Ready for Use
Teams working on Speech, Postgres, and Foundry can now apply
[LiveTestOnly]to individual tests that cannot be recorded, allowing them to transition toRecordedCommandTestsBasewhile marking problematic tests to skip in Playback mode.Original prompt
[LiveTestOnly]Test attribute toAzure.Mcp.Tests#1389💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.