Some additional checks and cleanup
Build LinkLog Development Image / development-image (push) Successful in 10s
Build LinkLog Development Image / development-image (push) Successful in 10s
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_production_compose_configuration_matches_settings_environment_keys():
|
||||
compose = (ROOT / 'docker-compose.yml').read_text()
|
||||
settings = (ROOT / 'backend' / 'app' / 'core' / 'config.py').read_text()
|
||||
database = (ROOT / 'backend' / 'app' / 'database.py').read_text()
|
||||
|
||||
compose_keys = set(re.findall(r'\b(LINKLOG_[A-Z0-9_]+):', compose))
|
||||
settings_keys = set(re.findall(r"os\.getenv\('([^']+)'", settings + database))
|
||||
|
||||
assert {'LINKLOG_TOKEN_EXPIRY_MINUTES', 'LINKLOG_REFRESH_TOKEN_EXPIRY_DAYS'} <= compose_keys
|
||||
assert compose_keys & settings_keys == compose_keys
|
||||
assert 'LINKLOG_TOKEN_EXPIRY_DAYS' not in compose_keys
|
||||
Reference in New Issue
Block a user