Skip to content

Commit

Permalink
Update tox configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jun 18, 2024
1 parent 63b17a8 commit cffe06c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
15 changes: 8 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ docker =
docker: db-vlc
docker: minio-vlc
setenv =
docker: VLC_DEV_DB_HOST=localhost
docker: VLC_DEV_DB_PORT=9010
docker: VLC_DEV_AWS_S3_ENDPOINT_URL=http://localhost:9011
COVERAGE_FILE = .coverage.{envname}
allowlist_externals =
poetry
Expand All @@ -35,8 +32,10 @@ environment =
POSTGRES_USER=vlc
POSTGRES_PASSWORD=test
POSTGRES_DB=test_virtual_library_card_dev
ports =
9010:5432/tcp
expose =
VLC_DEV_DB_PORT=5432/tcp
host_var =
VLC_DEV_DB_HOST
healthcheck_cmd = pg_isready
healthcheck_interval = 5
healthcheck_retries = 10
Expand All @@ -47,8 +46,10 @@ environment =
MINIO_ACCESS_KEY=vlc-minio
MINIO_SECRET_KEY=123456789
MINIO_DEFAULT_BUCKETS=vlc-test:download
ports =
9011:9000/tcp
expose =
VLC_DEV_AWS_S3_ENDPOINT_URL_PORT=9000/tcp
host_var =
VLC_DEV_AWS_S3_ENDPOINT_URL_HOST

[gh-actions]
python =
Expand Down
16 changes: 13 additions & 3 deletions virtual_library_card/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,19 @@
DEFAULT_FILE_STORAGE = "virtual_library_card.storage.S3PublicStorage"
STATICFILES_STORAGE = "virtual_library_card.storage.S3StaticStorage"
AWS_STORAGE_BUCKET_NAME = "vlc-test"
AWS_S3_ENDPOINT_URL = os.environ.get(
"VLC_DEV_AWS_S3_ENDPOINT_URL", "http://localhost:9000"
)
if "VLC_DEV_AWS_S3_ENDPOINT_URL" in os.environ:
AWS_S3_ENDPOINT_URL = os.environ["VLC_DEV_AWS_S3_ENDPOINT_URL"]

Check warning on line 63 in virtual_library_card/settings/dev.py

View check run for this annotation

Codecov / codecov/patch

virtual_library_card/settings/dev.py#L63

Added line #L63 was not covered by tests
elif (
"VLC_DEV_AWS_S3_ENDPOINT_URL_HOST" in os.environ
and "VLC_DEV_AWS_S3_ENDPOINT_URL_PORT" in os.environ
):
AWS_S3_ENDPOINT_URL = (
f"http://{os.environ['VLC_DEV_AWS_S3_ENDPOINT_URL_HOST']}"
f":{os.environ['VLC_DEV_AWS_S3_ENDPOINT_URL_PORT']}"
)
else:
AWS_S3_ENDPOINT_URL = "http://localhost:9000"

Check warning on line 73 in virtual_library_card/settings/dev.py

View check run for this annotation

Codecov / codecov/patch

virtual_library_card/settings/dev.py#L73

Added line #L73 was not covered by tests

AWS_S3_CUSTOM_DOMAIN = os.environ.get("VLC_DEV_AWS_S3_CUSTOM_DOMAIN", False)
AWS_S3_URL_PROTOCOL = os.environ.get("VLC_DEV_AWS_S3_URL_PROTOCOL", "https:")

Expand Down

0 comments on commit cffe06c

Please sign in to comment.