Skip to content

parameterize the finetuning test cases#44996

Merged
jayesh-tanna merged 18 commits intoAzure:mainfrom
jayesh-tanna:ft_parameter_v1
Feb 6, 2026
Merged

parameterize the finetuning test cases#44996
jayesh-tanna merged 18 commits intoAzure:mainfrom
jayesh-tanna:ft_parameter_v1

Conversation

@jayesh-tanna
Copy link
Member

@jayesh-tanna jayesh-tanna commented Feb 4, 2026

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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link
Contributor

Copilot AI left a 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 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_job method
  • Consolidated 3 retrieve job tests into a single parametrized test_retrieve_job method
  • Consolidated 10 cancel job tests into a single parametrized test_cancel_job method
  • Consolidated 4 deploy and infer tests into a single parametrized test_deploy_and_infer_job method
  • Applied the same refactoring pattern to both sync and async test files
  • Removed unused os import 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

@jayesh-tanna jayesh-tanna changed the title Parametrizing the finetuning test cases parameterize the finetuning test cases Feb 5, 2026
@jayesh-tanna jayesh-tanna enabled auto-merge (squash) February 5, 2026 16:57
@jayesh-tanna jayesh-tanna merged commit e7baa6c into Azure:main Feb 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants