From 9d3e74d41573929114ae22c5fd1a5a192d8a23e6 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 22 May 2026 14:24:47 -0500 Subject: [PATCH] fix(ci): mostrar progreso de tests Playwright en consola de Jenkins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Con --reporter=junit,html el output a stdout era vacío (junit escribe a archivo, html a carpeta) — la consola se quedaba colgada en "Running 48 tests" hasta que terminaba toda la suite. Cambios: - Agregar 'list' al --reporter para imprimir una línea por test conforme corren. Visible en Jenkins live. - stdbuf -oL -eL fuerza line-buffering para evitar que pnpm/playwright acumulen el output hasta el final. - FORCE_COLOR=0 evita ANSI escapes que se ven feo en logs de Jenkins. Co-Authored-By: Claude Opus 4.7 (1M context) --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e85ded5c..8a9ff51e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -502,9 +502,16 @@ pipeline { echo "✓ Playwright listo" # ── Correr tests ──────────────────────────────────────────────── + # --reporter=list,junit,html: + # - list → progreso por test a stdout (visible en Jenkins) + # - junit → archivo XML para junit() plugin + # - html → carpeta playwright-report con UI + # stdbuf -oL fuerza buffer por líneas para que Jenkins vea el output + # incremental aunque pnpm/playwright bufferen. E2E_EXIT=0 docker exec \ -e CI=true \ + -e FORCE_COLOR=0 \ -e "JENKINS_URL=${JENKINS_URL}" \ -e "PLAYWRIGHT_TEST_BASE_URL=http://localhost:5173" \ -e "E2E_TEST_USER=${E2E_USER}" \ @@ -512,8 +519,8 @@ pipeline { -e "PLAYWRIGHT_JUNIT_OUTPUT_NAME=playwright-results.xml" \ -w /workspace/frontend \ "$PLAYWRIGHT_C" \ - pnpm exec playwright test \ - --reporter=junit,html \ + stdbuf -oL -eL pnpm exec playwright test \ + --reporter=list,junit,html \ --trace=retain-on-failure || E2E_EXIT=$? # Copiar artefactos antes de salir (pase o falle)