Skip to content

feat: move Azure Blob to clientless validation#143

Open
cofin wants to merge 2 commits into
mainfrom
feat/clientless-azure-blob
Open

feat: move Azure Blob to clientless validation#143
cofin wants to merge 2 commits into
mainfrom
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 added 2 commits May 24, 2026 21:11
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.
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.

1 participant