Migrate Load Testing tools to new tool design#3079
Open
alzimmermsft wants to merge 1 commit into
Open
Conversation
alzimmermsft
requested review from
RickWinter,
chidozieononiwu,
conniey,
jongio,
joshfree,
msalaman and
saikoumudi
July 17, 2026 13:38
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
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
ISubscriptionOptionoption POCOs using[Option]attributes. - Updated unit tests to use
SubscriptionCommandUnitTestsBaseand removedSystem.CommandLineusage 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." | |||
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.
What does this PR do?
Migrates Load Testing tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline