Skip to content

Python: Re-enable Azure OpenAI integration tests#6839

Open
giles17 wants to merge 1 commit into
mainfrom
fix-azure-openai-tests
Open

Python: Re-enable Azure OpenAI integration tests#6839
giles17 wants to merge 1 commit into
mainfrom
fix-azure-openai-tests

Conversation

@giles17

@giles17 giles17 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

The Azure OpenAI integration tests were temporarily hard-skipped in #6753 because they were crashing the pytest-xdist runner in the merge queue (all workers reporting node down: Not properly terminated). That work is tracked for re-enablement in #6777.

Local investigation shows the tests themselves are healthy — they pass when run serially. The CI failure was a runner crash under high xdist parallelism against live Azure services, not a test defect. This PR re-enables the tests so we can validate them in CI (where the required Azure secrets are available).

Description & Review Guide

  • What are the major changes?

    • Restore the env-based skip_if_azure_openai_integration_tests_disabled guard (pytest.mark.skipif(...)) in the three Azure OpenAI test modules, reverting the unconditional pytest.mark.skip(...) introduced in Python: bump package versions for 1.10.0 release #6753:
      • packages/openai/tests/openai/test_openai_chat_client_azure.py
      • packages/openai/tests/openai/test_openai_chat_completion_client_azure.py
      • packages/openai/tests/openai/test_openai_embedding_client_azure.py
  • What is the impact of these changes?

    • The ~37 Azure OpenAI integration tests run again (locally verified: 36 passed, 1 skipped — the 1 skip is a pre-existing image-content skip unrelated to this change — 0 failed, run serially in ~4m).
    • This re-enables them in the merge-queue / integration CI jobs.

Related Issue

Part of #6777

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change.

Restore the env-based `skip_if_azure_openai_integration_tests_disabled`
guard in the three Azure OpenAI test modules. These integration tests were
temporarily hard-skipped in #6753 because they crashed the pytest-xdist runner
in the merge queue (tracked in #6777). Verified locally: 36 passed, 1 skipped
(pre-existing image-content skip), 0 failed when run serially.

Re-enabling here to validate them in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Re-enables the Python Azure OpenAI integration test coverage by restoring conditional, environment-driven skipping logic (instead of unconditional skipping) in the Azure-specific OpenAI test modules. This aligns with the repo’s approach of running live-service integration tests only when real Azure configuration is present.

Changes:

  • Replaced unconditional pytest.mark.skip(...) with pytest.mark.skipif(...) guards driven by AZURE_OPENAI_ENDPOINT and the relevant deployment env vars.
  • Updated skip reasons to reflect missing/placeholder Azure configuration rather than CI runner instability.
  • Applied the same pattern across chat (responses), chat-completions, and embeddings Azure integration test modules.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
python/packages/openai/tests/openai/test_openai_chat_client_azure.py Restores env-based skip guard for Azure OpenAI responses integration tests.
python/packages/openai/tests/openai/test_openai_chat_completion_client_azure.py Restores env-based skip guard for Azure OpenAI chat-completions integration tests.
python/packages/openai/tests/openai/test_openai_embedding_client_azure.py Restores env-based skip guard for Azure OpenAI embeddings integration tests.

@github-actions

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL43102514188% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
8497 37 💤 0 ❌ 0 🔥 2m 13s ⏱️

@rogerbarreto rogerbarreto added the python Usage: [Issues, PRs], Target: Python label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants