Skip to content

Conversation

@howieleung
Copy link
Member

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

New stuff:

  • Readme
  • Test recording with optional parameters

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 for the Azure AI Projects Python SDK in preparation for moving test executor classes to dev tools. The changes separate concerns between helper functions, executor classes, and documentation.

Key changes:

  • Extracted test executor classes (SyncSampleExecutor, AsyncSampleExecutor) into sample_executor.py
  • Created test_samples_helpers.py for helper functions not destined for dev tools
  • Separated LLM validation into dedicated methods (validate_print_calls_by_llm, validate_print_calls_by_llm_async)
  • Added AdditionalTestsWithEnvironmentVariables decorator for recording samples with optional environment variables
  • Added comprehensive README documentation with usage examples

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
sdk/ai/azure-ai-projects/tests/samples/test_samples_helpers.py New file containing shared helper functions including LLM validation instructions and environment variable mapping
sdk/ai/azure-ai-projects/tests/samples/sample_executor.py New file with executor classes and helper functions, including the new decorator for optional environment variables
sdk/ai/azure-ai-projects/tests/samples/sample_executor_helpers.py Deleted file - content moved to sample_executor.py and test_samples_helpers.py
sdk/ai/azure-ai-projects/tests/samples/test_samples.py Updated imports and separated LLM validation into a separate method call
sdk/ai/azure-ai-projects/tests/samples/test_samples_async.py Updated imports, separated LLM validation, and added decorator usage for optional env vars
sdk/ai/azure-ai-projects/tests/samples/README.md New comprehensive documentation for using the sample testing infrastructure

@howieleung howieleung force-pushed the howie/sample-recording-6 branch from 224a33c to b0117d5 Compare December 31, 2025 01:50
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