parameterize the finetuning test cases#44996
Merged
jayesh-tanna merged 18 commits intoAzure:mainfrom Feb 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors finetuning test cases by parametrizing them to reduce code duplication. The changes consolidate multiple individual test methods into single parametrized test methods using pytest.mark.parametrize, reducing the overall test code while maintaining the same test coverage.
Changes:
- Introduced new constants for method types (SUPERVISED_METHOD_TYPE, DPO_METHOD_TYPE, REINFORCEMENT_METHOD_TYPE) and model types (OPENAI_MODEL_TYPE, OSS_MODEL_TYPE) in test_base.py
- Consolidated 10+ individual create job tests into a single parametrized
test_create_jobmethod - Consolidated 3 retrieve job tests into a single parametrized
test_retrieve_jobmethod - Consolidated 10 cancel job tests into a single parametrized
test_cancel_jobmethod - Consolidated 4 deploy and infer tests into a single parametrized
test_deploy_and_infer_jobmethod - Applied the same refactoring pattern to both sync and async test files
- Removed unused
osimport from both test files - Updated test recording assets (assets.json)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tests/test_base.py | Added new constants for method types and model types to support parametrization |
| sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning_async.py | Refactored async tests to use parametrization, added decorator wrappers for pytest compatibility, removed unused import |
| sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py | Refactored sync tests to use parametrization with critical decorator ordering issue, added decorator wrappers, removed unused import |
| sdk/ai/azure-ai-projects/assets.json | Updated test recording assets tag to reflect new test structure |
dargilco
approved these changes
Feb 5, 2026
howieleung
approved these changes
Feb 6, 2026
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.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines