-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Test and sample recording #44539
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
Test and sample recording #44539
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 PR refactors the sample testing infrastructure for the Azure AI Projects SDK. The main goal is to consolidate, simplify, and improve the framework for running and validating SDK samples as automated tests with recording/playback support.
Key Changes
- Consolidated sample executor logic into a single
sample_executor.pymodule (replacingsample_executor_helpers.py) - Introduced new features including
additionalSampleTestsdecorator for testing samples with optional environment variables - Separated shared constants and helpers into
test_samples_helpers.pyfor better modularity - Added comprehensive documentation in a new README.md explaining the testing framework
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tests/samples/sample_executor.py | New consolidated module containing all sample executor classes (SyncSampleExecutor, AsyncSampleExecutor), sample path discovery functions, and the additionalSampleTests decorator for parametrized test variants |
| sdk/ai/azure-ai-projects/tests/samples/test_samples_helpers.py | New helper module extracting shared constants (agent_tools_instructions) and utility functions (get_sample_environment_variables_map) |
| sdk/ai/azure-ai-projects/tests/samples/test_samples.py | Updated to import from new modules, added usage of additionalSampleTests decorator, and separated validation from execution |
| sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py | Updated to import from new modules and use the refactored async executor with separated validation |
| sdk/ai/azure-ai-projects/tests/samples/sample_executor_helpers.py | Deleted file - functionality moved to sample_executor.py and test_samples_helpers.py |
| sdk/ai/azure-ai-projects/tests/samples/README.md | New comprehensive documentation explaining the sample testing framework, with sync/async examples and usage patterns |
| sdk/ai/azure-ai-projects/assets.json | Updated recording assets tag to reflect new test recordings |
6dd77eb to
0d03d51
Compare
- Changed environment variable names in test files to use a consistent naming convention, replacing "azure_ai_projects_tests_" prefix with a simplified version. - Updated references in test cases to reflect the new environment variable names for model deployments, project endpoints, and connection IDs. - Modified the sample executor to handle environment variable mapping more flexibly. - Ensured all tests are aligned with the new naming conventions for better clarity and maintainability.
0d03d51 to
20deee8
Compare
|
Since we have .env.template, do we now also need .env.test.template? |
Refractor code for Python SDK team to move sample test feature to dev tools including:
New stuff: