Document sample validation process in Azure SDK for Go CI pipelines #25143
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.
This documentation provides a comprehensive overview of how samples are validated in the Azure SDK for Go CI pipelines, addressing the question about sample validation processes.
Sample Validation Overview
The Azure SDK for Go employs a multi-layered validation approach for samples through its CI pipeline system:
Pipeline Architecture
/eng/pipelines/pullrequest.yml
extendingarchetype-sdk-client.yml
Sample Validation Methods
1. Code Execution Validation
Examples are written as Go test files (
example*_test.go
) with functions prefixedExample
. The CI pipeline:go test
viaeng/scripts/run_tests.ps1
→eng/scripts/test.ps1
2. Sample Metadata Validation
eng/common/scripts/Test-SampleMetadata.ps1
eng/common/pipelines/templates/steps/verify-samples.yml
3. Static Analysis and Quality Checks
The analyze stage performs comprehensive validation:
4. Package and API Validation
Testing Infrastructure
Example Standards
Sample code must follow specific patterns:
func Example...()
)// Output:
comments for Go's testing frameworkThis validation system ensures samples are not only syntactically correct but also executable, well-documented, and compliant with Azure SDK standards.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.