feat: move Azure Blob to clientless validation#143
Open
cofin wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop
azure-storage-blobfrom theazure-storageextra. 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:latestsidecar (az storage container create). Tests drive Azurite through the sameazsidecar pattern, preserving xdist behavior under both worker accounts (databaseisolation) and per-worker transient containers (serverisolation).The bundled
azure_blob_container_clientandazure_blob_async_container_clientfixtures are gone. Users construct their ownContainerClient.from_connection_string(service.connection_string, container_name=...).