chore(release): initialize separated production env
This commit is contained in:
@@ -35,6 +35,32 @@ def test_validate_release_env_accepts_strict_production(tmp_path: Path):
|
||||
assert validate(parse_env_file(env_file), strict_external=True) == []
|
||||
|
||||
|
||||
def test_validate_release_env_allows_disabled_smtp_with_strict_external(tmp_path: Path):
|
||||
env_file = tmp_path / ".env.production"
|
||||
env_file.write_text(
|
||||
"\n".join(
|
||||
[
|
||||
"APP_ENV=production",
|
||||
"DATABASE_URL=postgresql+psycopg://user:pass@db:5432/app",
|
||||
"JWT_SECRET_KEY=abcdefghijklmnopqrstuvwxyz123456",
|
||||
"REDIS_URL=redis://redis:6379/0",
|
||||
"ENABLE_EMAIL_DELIVERY=false",
|
||||
"ENABLE_REDIS_SESSIONS=true",
|
||||
"OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com",
|
||||
"OSS_ACCESS_KEY_ID=ak-real",
|
||||
"OSS_ACCESS_KEY_SECRET=sk-real-secret",
|
||||
"OSS_BUCKET_NAME=xiaoxia-prod",
|
||||
"GENERATED_FILES_HOST_DIR=/var/lib/xiaoxia-saas-production/generated",
|
||||
"DEBUG=false",
|
||||
"AUTO_CREATE_SCHEMA=false",
|
||||
]
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
assert validate(parse_env_file(env_file), strict_external=True) == []
|
||||
|
||||
|
||||
def test_validate_release_env_rejects_placeholders_and_staging_paths(tmp_path: Path):
|
||||
env_file = tmp_path / ".env.production"
|
||||
env_file.write_text(
|
||||
|
||||
Reference in New Issue
Block a user