minio_helpers.py
python
sha256:369f691c7aaec3ca84a864ad1d099d5409045ddc12d185a922b3c84b9e2a1bad
merge: 100% passing, parallelized MuseHub test suite (task/…
Sonnet 5.5
patch
3 days ago
| 1 | """Where the tests' real MinIO (S3-compatible) lives. |
| 2 | |
| 3 | Resolution: ``TEST_MINIO_ENDPOINT`` (explicit), then ``BLOB_STORAGE_ENDPOINT`` (what the dev |
| 4 | container is configured with, e.g. ``http://minio:9000``), then ``http://localhost:9000`` |
| 5 | (MinIO published on the host). |
| 6 | """ |
| 7 | |
| 8 | from __future__ import annotations |
| 9 | |
| 10 | import os |
| 11 | |
| 12 | MINIO_BUCKET = "muse-objects" |
| 13 | MINIO_ACCESS_KEY = "minioadmin" |
| 14 | MINIO_SECRET_KEY = "minioadmin" |
| 15 | |
| 16 | |
| 17 | def minio_endpoint() -> str: |
| 18 | return ( |
| 19 | os.environ.get("TEST_MINIO_ENDPOINT") |
| 20 | or os.environ.get("BLOB_STORAGE_ENDPOINT") |
| 21 | or "http://localhost:9000" |
| 22 | ) |
| 23 | |
| 24 | |
| 25 | def minio_blob_backend(): # type: ignore[no-untyped-def] |
| 26 | """A real ``BlobBackend`` against the test MinIO (no network needed to presign).""" |
| 27 | from musehub.storage.backends import BlobBackend |
| 28 | |
| 29 | return BlobBackend( |
| 30 | bucket=MINIO_BUCKET, |
| 31 | endpoint_url=minio_endpoint(), |
| 32 | access_key_id=MINIO_ACCESS_KEY, |
| 33 | secret_access_key=MINIO_SECRET_KEY, |
| 34 | region="us-east-1", |
| 35 | ) |
File History
2 commits
sha256:369f691c7aaec3ca84a864ad1d099d5409045ddc12d185a922b3c84b9e2a1bad
merge: 100% passing, parallelized MuseHub test suite (task/…
Sonnet 5.5
patch
3 days ago
sha256:8166b51ae53275831023a7ce334228b3ccc8237b55d68a35172389db9ff46ad5
test: 100% passing MuseHub suite, parallelized (xdist, one …
Sonnet 5.5
patch
3 days ago