Skip to content

Conversation

@howieleung
Copy link
Member

@howieleung howieleung commented Dec 29, 2025

Refractor code for Python SDK team to move sample test feature to dev tools:

  • Moved test executor classes to sample_executor.py and later to be moved to dev tools
  • Moved other helper functions not going to dev tools to test_samples_helpers.py
  • Move LM validation from execute to a new function, validate_print_calls_by_llm
  • Readme

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 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.py into sample_executor.py with better organization of sync and async executors
  • Extracted shared constants and helper functions to test_samples_helpers.py for better reusability
  • Added comprehensive README.md with examples and documentation for the sample test framework
  • Refactored validation to use explicit validate_print_calls_by_llm method 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

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.

2 participants