-
Notifications
You must be signed in to change notification settings - Fork 3.2k
code clean up and added readme #44525
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
base: main
Are you sure you want to change the base?
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 test infrastructure by consolidating and organizing the sample executor code, extracting shared helper functions, and adding comprehensive documentation. The changes improve code maintainability and provide clear guidance for writing sample tests.
Key Changes
- Consolidated
sample_executor_helpers.pyintosample_executor.pywith better organization of sync and async executors - Extracted shared constants and helper functions to
test_samples_helpers.pyfor better reusability - Added comprehensive README.md with examples and documentation for the sample test framework
- Refactored validation to use explicit
validate_print_calls_by_llmmethod calls with configurable instructions
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tests/test_base.py | Added originalServicePreparer configuration (appears unused) |
| sdk/ai/azure-ai-projects/tests/samples/test_samples_helpers.py | New file containing shared agent_tools_instructions constant and get_sample_environment_variables_map helper function |
| sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py | Updated imports to use new module structure and added explicit LLM validation call |
| sdk/ai/azure-ai-projects/tests/samples/test_samples.py | Updated imports to use new module structure, removed unused is_async parameter, and added explicit LLM validation call |
| sdk/ai/azure-ai-projects/tests/samples/sample_executor_helpers.py | File deleted - code moved to sample_executor.py and test_samples_helpers.py |
| sdk/ai/azure-ai-projects/tests/samples/sample_executor.py | New consolidated file with improved structure, overloaded functions for better type hints, and separated validation logic |
| sdk/ai/azure-ai-projects/tests/samples/README.md | New documentation file with detailed examples and guidance for writing sample tests |
Refractor code for Python SDK team to move sample test feature to dev tools: