Skip to content

Python: updated integration tests and guidance#4181

Merged
eavanvalkenburg merged 9 commits intomicrosoft:mainfrom
eavanvalkenburg:int_tests_update
Feb 24, 2026
Merged

Python: updated integration tests and guidance#4181
eavanvalkenburg merged 9 commits intomicrosoft:mainfrom
eavanvalkenburg:int_tests_update

Conversation

@eavanvalkenburg
Copy link
Member

Motivation and Context

Refined our integration tests runs for Python, split them further out to ensure we maximise throughput for non-block parallelism, ensured we only run integration tests in those paths, while in parallel running the unit tests. Added filters to only run what needs running.

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings February 23, 2026 15:36
@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner February 23, 2026 15:36
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Feb 23, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 23, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   observability.py6588387%360, 362–364, 367–369, 374–375, 381–382, 388–389, 396, 398–400, 403–405, 410–411, 417–418, 424–425, 432, 470, 561, 703, 706, 714–715, 718–721, 723, 726–728, 731–732, 760, 762, 773–775, 777–779, 783, 791, 892, 894, 1043, 1045, 1049–1054, 1056, 1059–1063, 1065, 1174–1175, 1177, 1234–1235, 1311, 1434, 1604, 1607, 1666, 1834, 1988, 1990
packages/core/agent_framework/openai
   _chat_client.py2812491%210, 240–241, 245, 363, 370, 446–453, 455–458, 468, 546, 548, 564, 610, 626
TOTAL21560309585% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
4321 246 💤 0 ❌ 0 🔥 1m 14s ⏱️

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 pull request refines Python integration test execution by introducing marker-based test selection, parallel job execution in CI, and comprehensive documentation updates. The changes enable better separation between unit and integration tests, maximize CI parallelism through provider-specific jobs with change-based filtering, and provide clear guidance for contributors.

Changes:

  • Added @pytest.mark.integration marker to all integration tests across 20+ test files
  • Restructured CI workflow to split tests into 6 parallel jobs (unit, OpenAI, Azure OpenAI, misc providers, Functions, Azure AI) with path-based change detection
  • Updated documentation (DEV_SETUP.md, CODING_STANDARD.md, python-testing skill) with integration test patterns and CI workflow details

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/python-merge-tests.yml Restructured workflow with path filters and 6 parallel test jobs for unit and provider-specific integration tests
python/pyproject.toml Added integration marker definition; removed mypy from check-packages (still in ci-mypy)
python/packages/core/pyproject.toml Added pytest-xdist parallelization (-n auto --dist worksteal) to test task
python/packages/orchestrations/pyproject.toml Added pytest-xdist parallelization to test task
python/packages/anthropic/pyproject.toml Added pytest-xdist parallelization to test task
python/packages/ag-ui/pyproject.toml Added pytest-xdist parallelization to test task
python/packages//tests/.py Added @pytest.mark.integration and @pytest.mark.flaky markers to 70+ integration tests
python/packages/core/agent_framework/observability.py Removed unused SpanAttributes import (code formatting)
python/packages/core/agent_framework/openai/_chat_client.py Line length formatting improvements
python/DEV_SETUP.md Added integration test marker usage examples and pytest-xdist information
python/CODING_STANDARD.md Added comprehensive integration test marker requirements and CI workflow guidance
python/.github/skills/python-testing/SKILL.md Added integration test patterns, CI workflow details, and provider addition guidance

eavanvalkenburg and others added 6 commits February 24, 2026 09:00
Only one --dist mode can be active at a time; the second value silently
overrides the first. Keep --dist worksteal (dynamic load balancing) and
remove the redundant --dist loadfile from all workflow files and
pyproject.toml configs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both python-merge-tests.yml and python-integration-tests.yml share the
same parallel job structure. Added sync reminders in workflow file
comments, the python-testing SKILL.md, and CODING_STANDARD.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integration test gating now uses two mechanisms:
- `@pytest.mark.integration` for test selection via `-m` filtering
- `skip_if_*_disabled` for credential/service availability checks

The RUN_INTEGRATION_TESTS env var was redundant since the marker handles
selection and the skip decorators already check for actual credentials.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add OPENAI_EMBEDDINGS_MODEL_ID and AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME
to python-integration-tests.yml to match python-merge-tests.yml.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…docs

Missed test_openai_embedding_client.py and vector-stores README in the
earlier cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 24, 2026
Merged via the queue into microsoft:main with commit acc4919 Feb 24, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants