fix(jenkins): corregir captura de HTTP status en verificación de Keycloak

curl -sf falla con exit!=0 en HTTP >=400, disparando || echo '000' y
concatenando '502000' en lugar de '502'. Cambiado a curl -s para
capturar el código real sin que el flag -f interfiera.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 13:08:51 -05:00
parent d0a1a299cc
commit c04b6876f6

4
Jenkinsfile vendored
View File

@@ -218,7 +218,9 @@ pipeline {
# (auth.setup.ts lo usa directamente — sin pasar por /login)
echo "--- Verificando Keycloak token endpoint ---"
KC_TOKEN_EP="${E2E_KEYCLOAK_URL}/realms/master/protocol/openid-connect/token"
KC_STATUS=$(curl -sf --max-time 10 -o /dev/null -w "%{http_code}" \
# -s sin -f: curl no falla en HTTP 4xx/5xx, devuelve el código real
# || echo "000" solo se activa si curl no puede conectar (timeout, DNS, etc.)
KC_STATUS=$(curl -s --max-time 10 -o /dev/null -w "%{http_code}" \
-X POST "$KC_TOKEN_EP" \
-d "grant_type=password&client_id=anexo76-frontend&username=${E2E_TEST_USER}&password=${E2E_TEST_PASSWORD}&scope=openid" \
2>/dev/null || echo "000")