Skip to content

Migrate Load Testing tools to new tool design#3079

Open
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateLoadTestingToolsToNewDesign
Open

Migrate Load Testing tools to new tool design#3079
alzimmermsft wants to merge 1 commit into
microsoft:mainfrom
alzimmermsft:MigrateLoadTestingToolsToNewDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates Load Testing tools to new design where Register and Bind options are based on Option attributes.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@alzimmermsft alzimmermsft self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 13:38
@alzimmermsft
alzimmermsft requested review from a team as code owners July 17, 2026 13:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 migrates the Azure Load Testing toolset from the legacy RegisterOptions/BindOptions pattern to the attribute-based options model ([Option] / [OptionContainer]) and updates commands/tests accordingly to align with the newer command design.

Changes:

  • Converted Load Testing commands to SubscriptionCommand<TOptions, TResult> and removed legacy option registration/binding code.
  • Replaced legacy option definitions/base options with new flat ISubscriptionOption option POCOs using [Option] attributes.
  • Updated unit tests to use SubscriptionCommandUnitTestsBase and removed System.CommandLine usage from the tool project.

Reviewed changes

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

Show a summary per file
File Description
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunGetCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunCreateOrUpdateCommandTests.cs Switches tests to subscription-aware command test base and updates expectations.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourcesListCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourceCreateCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestGetCommandTests.cs Switches tests to subscription-aware command test base.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestCreateCommandTests.cs Switches tests to subscription-aware command test base and reformats argument matching.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/LoadTestingCommandTests.cs Removes unused constants from recorded/live test suite.
tools/Azure.Mcp.Tools.LoadTesting/src/Services/LoadTestingService.cs Adjusts service implementation for removed global usings and signature updates.
tools/Azure.Mcp.Tools.LoadTesting/src/Services/ILoadTestingService.cs Updates service interface to require testRunId for create/update test runs.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs Introduces attribute-based options for “get/list test runs”.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs Introduces attribute-based options for “create/update test runs”.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs Introduces attribute-based options for listing resources.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs Introduces attribute-based options for creating resources.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestingOptionDescriptions.cs Adds centralized option description strings for reuse.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestingOptionDefinitions.cs Removes legacy System.CommandLine option definitions.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs Introduces attribute-based options for getting a test.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs Introduces attribute-based options for creating a test.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/BaseLoadTestingOptions.cs Removes legacy base options class.
tools/Azure.Mcp.Tools.LoadTesting/src/GlobalUsings.cs Removes global usings tied to legacy System.CommandLine approach.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunGetCommand.cs Converts command to new subscription command pattern and adds option validation.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunCreateOrUpdateCommand.cs Converts command to new subscription command pattern.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceListCommand.cs Converts command to new subscription command pattern.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceCreateCommand.cs Converts command to new subscription command pattern.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestGetCommand.cs Converts command to new subscription command pattern.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestCreateCommand.cs Converts command to new subscription command pattern.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/BaseLoadTestingCommand.cs Removes legacy base command that handled System.CommandLine option binding.
tools/Azure.Mcp.Tools.LoadTesting/src/Azure.Mcp.Tools.LoadTesting.csproj Removes System.CommandLine dependency and updates core project reference path.
servers/Azure.Mcp.Server/changelog-entries/1784295488788.yaml Adds changelog entry for the Load Testing tool changes.

Comment on lines +88 to +89
_logger.LogError(ex, "Error in {Operation}. Subscription: {Subscription}, TestResouceName: {TestResourceName}, TestId: {TestId}, TestrunId: {TestrunId}",
Name, options.Subscription, options.TestResourceName, options.TestId, options.TestrunId);
Comment on lines +64 to +65
_logger.LogError(ex, "Error in {Operation}. Subscription: {Subscription}, TestResouceName: {TestResourceName}, TestId: {TestId}, TestrunId: {TestrunId}",
Name, options.Subscription, options.TestResourceName, options.TestId, options.TestrunId);
Comment on lines 29 to 33
/// <summary>
/// The display name of the load test.
/// </summary>
[Option(Description = LoadTestingOptionDescriptions.Description)]
public string? Description { get; set; }
Comment on lines 35 to 39
/// <summary>
/// The display name of the load test.
/// </summary>
[Option(Description = "The endpoint URL to be tested. This is the URL of the HTTP endpoint that will be subjected to load testing.")]
public string? Endpoint { get; set; }
Comment on lines 41 to 45
/// <summary>
/// The display name of the load test.
/// </summary>
[Option(Description = "Virtual users is a measure of load that is simulated to test the HTTP endpoint. Default is 50.")]
public int? VirtualUsers { get; set; }
Comment on lines 47 to 51
/// <summary>
/// The duration of the load test.
/// </summary>
[Option(Description = "Number of minutes for which the load is simulated against the endpoint. Enter decimals for fractional minutes (e.g., 1.5 for 1 minute and 30 seconds). Default is 20 minutes.")]
public int? Duration { get; set; }
Comment on lines 53 to 57
/// <summary>
/// The ramp-up time for the load test.
/// </summary>
[Option(Description = "Numer of minutes it takes for the system to ramp-up to the total load specified. Enter decimals for fractional minutes (e.g., 1.5 for 1 minute and 30 seconds). Default is 1 minute.")]
public int? RampUpTime { get; set; }
Comment on lines 23 to 27
/// <summary>
/// The ID of the load test resource. If provided (and TestRunId is not), returns all test runs for this test.
/// </summary>
[Option(Description = LoadTestingOptionDescriptions.TestId)]
public string? TestId { get; set; }
Comment on lines 17 to 22
/// <summary>
/// The ID of the load test run resource.
/// </summary>
public string? TestRunId { get; set; }
[Option(Description = LoadTestingOptionDescriptions.TestrunId)]
public required string TestrunId { get; set; }

@@ -0,0 +1,3 @@
changes:
- section: "Breaking Changes"
description: "Removed unused parameters from Load Testing tools."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants