[perf-automation] Add Go language support#15807
Open
bhattmanish98 wants to merge 1 commit into
Open
Conversation
|
Thank you for your contribution @bhattmanish98! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Go as a supported language for the perf-automation runner and pipeline so Go SDK perf tests can be executed and results printed alongside existing languages.
Changes:
- Added Go parameters, repo resource, perf job, and result-printing steps to
tests.yml. - Implemented Go runner (
Go.cs) and enabledLanguage.Goin the CLI. - Updated documentation and added NUnit coverage for Go parsing/path logic.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/perf-automation/tests.yml | Adds Go pipeline parameters, repo resource, perf job template invocation, and result printing |
| tools/perf-automation/README.md | Documents Go usage and lists supported languages |
| tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | Registers Go language handler and enforces sync-only behavior |
| tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Models/Language.cs | Extends language enum with Go |
| tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Go.cs | Implements Go setup/run/cleanup and throughput parsing |
| tools/perf-automation/Azure.Sdk.Tools.PerfAutomation.Tests/GoTests.cs | Adds unit tests for Go parsing and helper behaviors |
Comment on lines
+101
to
+103
| // Capture combined output for parsing and return. | ||
| var combinedOutput = (processResult.StandardOutput ?? string.Empty) + Environment.NewLine + (processResult.StandardError ?? string.Empty); | ||
| var opsPerSecond = ParseOpsPerSecond(combinedOutput); |
Comment on lines
+199
to
+205
| var module = parts[0]; | ||
| var version = parts[1]; | ||
|
|
||
| if (parts.Length > 2 && parts[2] == "=>") | ||
| { | ||
| version = string.Join(" ", parts.Skip(1)); | ||
| } |
Comment on lines
+148
to
+152
| - repository: azure-sdk-for-go | ||
| type: github | ||
| endpoint: Azure | ||
| name: Azure/azure-sdk-for-go | ||
| ref: main |
Comment on lines
+429
to
+434
| - ${{ if parameters.IncludeGo }}: | ||
| - pwsh: | | ||
| write-host results-Go-Linux/results.txt | ||
| get-content results-Go-Linux/results.txt | ||
| workingDirectory: $(Pipeline.Workspace) | ||
| displayName: Go |
Comment on lines
+25
to
+33
| | Language | `--language` value | Example `--language-version` | | ||
| | -------- | ------------------ | ---------------------------- | | ||
| | .NET | `Net` | `8` | | ||
| | Java | `Java` | `17` | | ||
| | JS | `JS` | `18` | | ||
| | Python | `Python` | `3.11` | | ||
| | Cpp | `Cpp` | `N/A` | | ||
| | Rust | `Rust` | `N/A` | | ||
| | Go | `Go` | `1.25` | |
| public void ResolveSourcePath_AzurePackage_ReturnsExpectedPath() | ||
| { | ||
| var go = new Go(); | ||
| go.WorkingDirectory = Path.Combine(Path.DirectorySeparatorChar.ToString(), "tmp", "azure-sdk-for-go"); |
| public void ResolveSourcePath_NonAzurePackage_Throws() | ||
| { | ||
| var go = new Go(); | ||
| go.WorkingDirectory = Path.Combine(Path.DirectorySeparatorChar.ToString(), "tmp", "azure-sdk-for-go"); |
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.
Summary
Adds Go as a supported language to the perf-automation tool, enabling automated performance runs against
azure-sdk-for-gopackages in the same way other language SDKs (.NET, Java, JS, Python, C++) are already driven.Changes
Models/Language.cs— AddGoto theLanguageenum.Program.cs— Register the newGorunner so--language gois recognized and dispatched.Go.cs(new) —LanguageBaseimplementation for Go:SetupAsync: backs upgo.mod/go.sum, drops stalereplacedirectives for requested packages, then either pins published versions viago get <pkg>@<version>or wires local source viago mod edit -replace, followed bygo mod tidy.RunAsync: invokesgo run . <test> <args>from the project directory, captures stdout/stderr, and parses throughput via a regex matching the standard(<value> ops/s, ...)perf line (handles comma-grouped numbers, invariant culture).CleanupAsync: restoresgo.mod/go.sumfrom backup and best-effortgo mod tidyto leave the module graph consistent.FilterRuntimePackageVersions: keepsgithub.com/Azure/*,golang.org/x/*, and thegoruntime entry fromgo list -m all.ResolveSourcePath: maps agithub.com/Azure/azure-sdk-for-go/...import path to a local directory underWorkingDirectory.Azure.Sdk.Tools.PerfAutomation.Tests/GoTests.cs(new) — NUnit coverage forParseOpsPerSecond(valid / comma-formatted / missing),FilterRuntimePackageVersions, andResolveSourcePath(Azure path + non-Azure rejection).tests.yml— Add Go perf test definitions/templates consumed by the runner.README.md— Document Go usage, prerequisites, and example invocation.Validation
Built locally with
dotnet build.New NUnit tests pass (
dotnet test).Manual end-to-end run against
azure-sdk-for-gostorage/azblob perf tests:
bash dotnet run -- run \ --language go --language-version 1.22 \ --repo-root <path>/azure-sdk-for-go \ --tests-file <path>/sdk/storage/azblob/testdata/perf/perfautomation-tests.yml \ --package-versions '.*' --tests '.*' --arguments '.*' --iterations 1 Notes / Compatibility
go.mod/go.sumare restored on cleanup to avoid mutating the consumer repo state.github.com/Azure/azure-sdk-for-go/...packages can be resolved to a local source path; other packages must use a published version.