Alembic construit le moteur directement, sans passer par le fichier ini
build / Garde-fou (pull_request) Successful in 9m29s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m44s
build / Garde-fou (push) Successful in 9m31s
build / Images Harbor (web, Dockerfile) (push) Successful in 13m8s

This commit is contained in:
hcornet committed 2026-09-11 08:54:56 +02:00
1 parent 5659c32b66
commit 6c602c97ad
3 files changed
+43 -11

No files matched your search

+32
View File
@@ -7,6 +7,7 @@ ici, et la CI reste sans service externe.
from __future__ import annotations
import importlib
import os
from pathlib import Path
import pytest
@@ -388,3 +389,34 @@ def test_les_entetes_du_proxy_sont_honores(app_oidc):
headers={"X-Forwarded-Proto": "https", "X-Forwarded-Host": "enclume.example"},
)
assert vu["url"] == "https://enclume.example/"
def test_alembic_supporte_un_mot_de_passe_encode():
"""Un mot de passe contenant @ devient %40 une fois encode ; Alembic ne doit
pas y voir une interpolation configparser. On lance la vraie commande."""
import subprocess
import sys
environnement = {
**os.environ,
"ENCLUME_DB_HOTE": "hote-inexistant.invalid",
"ENCLUME_DB_MOTDEPASSE": "G00d-P@ssw0rd",
"PATH": os.environ.get("PATH", ""),
}
environnement.pop("ENCLUME_DATABASE_URL", None)
resultat = subprocess.run(
[sys.executable, "-m", "alembic", "upgrade", "head"],
capture_output=True,
text=True,
env=environnement,
timeout=60,
)
sortie = resultat.stdout + resultat.stderr
# Le point verifie : l'URL a ete lue sans etre prise pour un motif
# d'interpolation. L'echec qui suit porte sur la connexion elle-meme.
assert "invalid interpolation" not in sortie, sortie[-800:]
assert any(
marque in sortie
for marque in ("OperationalError", "could not translate", "Name or service not known")
), sortie[-800:]