Skip to content

Commit e6e3fc9

Browse files
committed
Allow minio region change for tests and full URL config
1 parent 266f8b5 commit e6e3fc9

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

drivers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, config):
8484

8585
try:
8686
self.client = Minio(
87-
endpoint=config.minio.endpoint,
87+
endpoint=config.minio.endpoint.split("//")[-1], # Allow user to specify URL (https://) to avoid errors
8888
access_key=config.minio.access_key,
8989
secret_key=config.minio.secret_key,
9090
secure=config.as_bool("minio.secure"),

test/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
TEST_DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_data")
1515
WORKSPACE = os.environ.get("TEST_API_WORKSPACE")
1616
MINIO_URL = os.environ.get("TEST_MINIO_URL")
17+
MINIO_REGION = os.environ.get("TEST_MINIO_REGION")
1718
MINIO_ACCESS_KEY = os.environ.get("TEST_MINIO_ACCESS_KEY")
1819
MINIO_SECRET_KEY = os.environ.get("TEST_MINIO_SECRET_KEY")
1920
GOOGLE_DRIVE_FOLDER = os.environ.get("TEST_GOOGLE_DRIVE_FOLDER")
@@ -48,7 +49,7 @@ def setup_config():
4849
"MINIO__BUCKET": "",
4950
"MINIO__BUCKET_SUBPATH": "",
5051
"MINIO__SECURE": False,
51-
"MINIO__REGION": "",
52+
"MINIO__REGION": MINIO_REGION,
5253
}
5354
)
5455

test/test_sync.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
MINIO_URL,
3232
MINIO_ACCESS_KEY,
3333
MINIO_SECRET_KEY,
34+
MINIO_REGION,
3435
GOOGLE_DRIVE_SERVICE_ACCOUNT_FILE,
3536
GOOGLE_DRIVE_FOLDER,
3637
cleanup,
@@ -267,6 +268,7 @@ def test_minio_backend(mc):
267268
"MINIO__ACCESS_KEY": MINIO_ACCESS_KEY,
268269
"MINIO__SECRET_KEY": MINIO_SECRET_KEY,
269270
"MINIO__BUCKET": "test",
271+
"MINIO__REGION": MINIO_REGION
270272
}
271273
)
272274

0 commit comments

Comments
 (0)