Skip to content

Gate Azure integration tests on explicit deploy context - #11

Draft
johnstel with Copilot wants to merge 2 commits into
mainfrom
copilot/gate-azure-integration-tests
Draft

Gate Azure integration tests on explicit deploy context#11
johnstel with Copilot wants to merge 2 commits into
mainfrom
copilot/gate-azure-integration-tests

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown

azure_infrastructure_test.py crashed with subscription_id must not be None on any machine without Azure context, making the validation suite non-reproducible and unusable in CI without a live subscription.

Changes

  • conftest.py (new): Registers the azure_integration pytest marker and hooks pytest_collection_modifyitems to skip all tagged tests when AZURE_SUBSCRIPTION_ID is absent — with a message that names the missing vars and points to docs.

  • azure_infrastructure_test.py:

    • Adds pytestmark = pytest.mark.azure_integration to opt all 30 tests into the gate.
    • Replaces module-level credential = DefaultAzureCredential() with a lazy _get_credential() so import no longer probes Azure credentials.
    • Adds a __main__ preflight that exits 2 with actionable steps when AZURE_SUBSCRIPTION_ID is unset.
  • docs/SETUP.md: New Running Integration Tests section covering required env vars, pytest and standalone command paths, and an expected-outcomes table for each environment state.

Behavior

# Clean machine — no Azure context
$ pytest azure_infrastructure_test.py -rs
SKIPPED [30] — missing env vars: AZURE_SUBSCRIPTION_ID. Set them and run `az login`...

$ python azure_infrastructure_test.py
ERROR: Azure deploy context is not configured.
Missing required environment variables: AZURE_SUBSCRIPTION_ID
...
Exit code: 2

# With context — tests run normally
$ export AZURE_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
$ pytest azure_infrastructure_test.py -v

Copilot AI linked an issue May 29, 2026 that may be closed by this pull request
8 tasks
Copilot AI changed the title [WIP] Add explicit gate for Azure integration tests in deploy context Gate Azure integration tests on explicit deploy context May 29, 2026
Copilot AI requested a review from johnstel May 29, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gate Azure integration tests on explicit deploy context

2 participants