chore(release): initialize separated production env
Deploy / Deploy Production (push) Failing after 2089h3m52s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 2089h6m25s
Deploy / Deploy Staging (push) Has been cancelled

This commit is contained in:
Xiaoxia AI
2026-06-21 14:24:23 +08:00
parent 1f89f8edfe
commit f22af7ee4c
7 changed files with 146 additions and 5 deletions
+26
View File
@@ -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(