Python: Automate sample validation#4193
Merged
TaoChenOSU merged 5 commits intomicrosoft:mainfrom Feb 24, 2026
Merged
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an automated, workflow-driven system to validate Python samples on a daily cadence, aiming to catch regressions early and surface results as build artifacts.
Changes:
- Introduces a new
_sample_validationpackage that discovers runnable samples, orchestrates concurrent validation via a nested workflow, and generates a report. - Adds a scheduled GitHub Actions workflow to run sample validation per sample area (01-get-started, 02-agents, etc.) and upload reports as artifacts.
- Includes a few related cleanups/fixes in existing samples and orchestration code.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/_sample_validation/workflow.py | Top-level workflow composition wiring discovery → nested workflow creation → execution → report. |
| python/samples/_sample_validation/run_dynamic_validation_workflow_executor.py | Executes the nested workflow, streams progress events, and fans results back into the parent workflow. |
| python/samples/_sample_validation/report.py | Builds/prints report summary and yields the final Report output. |
| python/samples/_sample_validation/models.py | Defines config and result/report datamodels used across the validation pipeline. |
| python/samples/_sample_validation/discovery.py | Discovers sample scripts (filters for files with if __name__ == "__main__" guards). |
| python/samples/_sample_validation/create_dynamic_workflow_executor.py | Constructs nested coordinator/worker/collector workflow and runs Copilot agents per sample. |
| python/samples/_sample_validation/const.py | Defines workflow event type constants. |
| python/samples/_sample_validation/main.py | CLI entrypoint to run validation and optionally save report artifacts. |
| python/samples/_sample_validation/init.py | Package exports and usage documentation. |
| python/samples/_sample_validation/README.md | Architecture and usage documentation for the validation system. |
| python/samples/_run_all_samples.py | Removes previous sample runner script in favor of the new validation system. |
| python/samples/02-agents/context_providers/redis/redis_conversation.py | Removes an unused import. |
| python/samples/01-get-started/04_memory.py | Ensures the sample context provider calls BaseContextProvider constructor with the expected source id. |
| python/packages/orchestrations/agent_framework_orchestrations/_handoff.py | Updates the synthetic handoff tool signature/body and minor formatting. |
| .github/workflows/python-sample-validation.yml | Adds scheduled/manual workflow to run sample validation across sample areas and upload reports. |
python/samples/_sample_validation/create_dynamic_workflow_executor.py
Outdated
Show resolved
Hide resolved
python/samples/_sample_validation/create_dynamic_workflow_executor.py
Outdated
Show resolved
Hide resolved
python/samples/_sample_validation/create_dynamic_workflow_executor.py
Outdated
Show resolved
Hide resolved
python/samples/_sample_validation/create_dynamic_workflow_executor.py
Outdated
Show resolved
Hide resolved
python/samples/_sample_validation/create_dynamic_workflow_executor.py
Outdated
Show resolved
Hide resolved
moonbox3
approved these changes
Feb 23, 2026
giles17
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Our samples are entry point for many customers, so we need to ensure that they run correctly. With changes coming in fast, we often forget to validate if our samples are affected by the changes. We need a way to catch regressions and fix them promptly.
Description
Add a GH workflow to run daily to ensure samples are working as expected.
Contribution Checklist