Skip to content

feat: move Azure Blob to clientless validation - #143

Open
cofin wants to merge 3 commits into
feat/provider-aware-cifrom
feat/clientless-azure-blob
Open

feat: move Azure Blob to clientless validation#143
cofin wants to merge 3 commits into
feat/provider-aware-cifrom
feat/clientless-azure-blob

Conversation

@cofin

@cofin cofin commented May 24, 2026

Copy link
Copy Markdown
Member

Drop azure-storage-blob from the azure-storage extra. The module no longer imports the Azure SDK.

The fixture auto-creates the default container before yielding via a one-shot mcr.microsoft.com/azure-cli:latest sidecar (az storage container create). Tests drive Azurite through the same az sidecar pattern, preserving xdist behavior under both worker accounts (database isolation) and per-worker transient containers (server isolation).

The bundled azure_blob_container_client and azure_blob_async_container_client fixtures are gone. Users construct their own ContainerClient.from_connection_string(service.connection_string, container_name=...).

@cofin
cofin force-pushed the feat/clientless-azure-blob branch from 34ca342 to 8104a71 Compare July 21, 2026 17:13
@cofin
cofin changed the base branch from main to feat/provider-aware-ci July 21, 2026 18:51
@cofin
cofin force-pushed the feat/clientless-azure-blob branch 2 times, most recently from 7569ccd to d3a016e Compare July 22, 2026 05:08
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feat/provider-aware-ci@51a063d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/pytest_databases/docker/azure_blob.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##             feat/provider-aware-ci    #143   +/-   ##
========================================================
  Coverage                          ?   1.61%           
========================================================
  Files                             ?      22           
  Lines                             ?    1794           
  Branches                          ?     133           
========================================================
  Hits                              ?      29           
  Misses                            ?    1765           
  Partials                          ?       0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cofin added 3 commits July 22, 2026 15:56
Drop the `azure.storage.blob` (sync + aio) imports from
`pytest_databases.docker.azure_blob`. Readiness was already log-based
(`wait_for_log="Azurite Blob service successfully listens on"`); no
replacement probe is needed in the provider.

Public surface changes:
- Remove the `azure_blob_container_client` and
  `azure_blob_async_container_client` fixtures — users now build their
  own `ContainerClient.from_connection_string(...)` from
  `azure_blob_service.connection_string` and
  `azure_blob_default_container_name`.
- Keep `AzureBlobService` (all fields are plain strings),
  `azure_blob_service`, `azure_blob_default_container_name`,
  `azurite_in_memory`, and `azure_blob_xdist_isolation_level`.
- Empty the `azure-storage` extra so `pytest-databases[azure-storage]`
  no longer pulls in `azure-storage-blob` and its transitive Azure SDK
  dependencies.

Tests rewritten to drive Azurite through a short-lived
`mcr.microsoft.com/azure-cli:latest` sidecar via
`docker_service._client.containers.run(..., network_mode="host", remove=True)`
running `az storage container ...` against the service's connection
string, mirroring the existing yugabyte mapped-endpoint sidecar
pattern. The default-container behavior matches `main` — the service
fixture does not auto-create the container; tests still drive
creation. A regression guard intercepts `azure.storage.blob` and
`azure.storage.blob.aio` via `builtins.__import__` and confirms the
plugin module still loads. Docs updated to show user-owned
`ContainerClient.from_connection_string(...)` wiring.
… service fixture

The azure_blob_service fixture now runs a one-shot azure-cli sidecar after
Azurite logs ready to create the default container (idempotent via
`az storage container create`). Users get a ready-to-use container without
boilerplate, matching the default-resource creation parity already provided
by BigQuery (emulator `--dataset=` flag) and Spanner (gcloud-cli sidecar).

Tests no longer create the container themselves and just assert it exists
under each xdist isolation strategy. Docs drop the explicit
`container.create_container()` call.
@cofin
cofin force-pushed the feat/clientless-azure-blob branch from d3a016e to da48131 Compare July 22, 2026 15:56
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.

2 participants