-
Notifications
You must be signed in to change notification settings - Fork 267
Add unit tests for azure.ai.finetune extension #6554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests for azure.ai.finetune extension #6554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive unit test coverage for the azure.ai.finetune extension. The tests cover models, utilities, services, providers, and command functionality with table-driven patterns and thorough edge case testing.
Changes:
- Adds 16 new test files covering all major components of the azure.ai.finetune extension
- Adds 13 testdata YAML files for parser validation testing
- Fixes spacing alignment for a constant in environment.go (formatting only)
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/models/views_test.go | Tests for view model transformations and formatting helpers |
| pkg/models/requests_test.go | Tests for request structure validation |
| pkg/models/finetune_test.go | Tests for fine-tuning job models, validation, and JSON marshaling |
| pkg/models/errors_test.go | Tests for error handling and error code uniqueness |
| pkg/models/deployment_test.go | Tests for deployment models and configurations |
| internal/utils/time_test.go | Tests for time formatting and duration calculations |
| internal/utils/status_test.go | Tests for job status symbols and terminal status detection |
| internal/utils/retry_test.go | Tests for retry logic with various failure scenarios |
| internal/utils/parser_test.go | Tests for YAML config parsing with valid and invalid inputs |
| internal/utils/output_test.go | Tests for output formatting (table, JSON, YAML) |
| internal/utils/environment_test.go | Tests for environment constant validation |
| internal/utils/common_test.go | Tests for file path utilities |
| internal/services/finetune_service_test.go | Tests for fine-tuning service with mock providers |
| internal/providers/azure/provider_test.go | Tests for Azure provider validation |
| internal/cmd/init_test.go | Tests for initialization command and resource ID parsing |
| internal/utils/environment.go | Formatting fix: aligns EnvFinetuningTokenScope constant spacing |
| internal/utils/testdata/*.yaml | Test fixture files for parser validation tests |
3b68231 to
100080a
Compare
Adds comprehensive unit test coverage for the azure.ai.finetune extension and enables CI test execution.
CI/Pipeline
Add ci-test.ps1 to run unit tests with gotestsum for better output formatting
Enable test execution in pipeline (SkipTests: false)
Add workingDirectory to the "Run tests" step in build-azd-extension.yml
Test Coverage
464+ tests across all packages
All tests pass on Windows, Linux, and macOS
Tests are deterministic (not flaky) and use mocks for external dependencies