\chapter{Pruebas de integraci\'on} \label{ch:integracion} \section{Stack de integraci\'on} Compose de prueba con PostgreSQL, Redis, LocalStack (MinIO), \texttt{bot-descarga}, \texttt{api\_gateway} y, seg\'un caso, extraction/cleaning/count-api. LLM siempre mockeado en CI. \section{Gateway} \begin{longtable}{@{}p{2.4cm}p{4.2cm}p{5.5cm}@{}} \caption{Integraci\'on gateway.}\\ \toprule \textbf{ID} & \textbf{Caso} & \textbf{Criterio de \'exito} \\ \midrule \endhead IT-GW-01 & Proxy \texttt{/bot-descarga/health} & 200 desde host :8189 \\ IT-GW-02 & Proxy \texttt{/tasks} & Llega a extraction \\ IT-GW-03 & Upstream ca\'ido & 502/504 sin colgar el gateway \\ IT-GW-04 & Upload path timeout & Rutas de upload usan 600\,s \\ \bottomrule \end{longtable} \section{Bot-descarga} \begin{longtable}{@{}p{2.6cm}p{4.5cm}p{5.0cm}@{}} \caption{Integraci\'on bot-descarga.}\\ \toprule \textbf{ID} & \textbf{Caso} & \textbf{Criterio de \'exito} \\ \midrule \endhead IT-BOT-01 & Register $\rightarrow$ create $\rightarrow$ claim & Job RUNNING una sola vez \\ IT-BOT-02 & Upload Excel a MinIO & Key \texttt{uploads/\{id\}/} presente \\ IT-BOT-03 & Events + patch complete & Historial y status finales \\ IT-BOT-04 & Worker offline create & HTTP 409 \\ IT-BOT-05 & Parent job inexistente & HTTP 404 \\ IT-BOT-06 & MinIO down en create & Job failed + HTTP 502 \\ \bottomrule \end{longtable} \section{Extraction / Cleaning / Count} \begin{longtable}{@{}p{2.6cm}p{4.5cm}p{5.0cm}@{}} \caption{Integraci\'on extraction, cleaning, count y BD.}\\ \toprule \textbf{ID} & \textbf{Caso} & \textbf{Criterio de \'exito} \\ \midrule \endhead IT-EXT-01 & Task $\rightarrow$ ARQ $\rightarrow$ rows & Filas en PG con LLM fake \\ IT-EXT-02 & Redis ca\'ido & Fallback sync o error claro \\ IT-EXT-03 & from-count lee \texttt{/data} & Paths v\'alidos montados \\ IT-CLN-01 & Job desde batch\_id & \texttt{cleaned\_rows} persistidos \\ IT-CLN-02 & CSV upload job & Preview + apply \\ IT-CNT-01 & PDF fixture $\rightarrow$ JSON & Paridad con baseline \\ IT-DB-01 & Migraciones 0001--0004 & BD limpia aplica sin error \\ \bottomrule \end{longtable} \section{Smoke m\'inimo post-compose} \begin{lstlisting}[language=bash,caption={Smoke health}] docker compose up --build -d curl http://127.0.0.1:8189/health/live curl http://127.0.0.1:8189/health \end{lstlisting} Nota Windows: usar \texttt{127.0.0.1}, no \texttt{localhost} (IPv6).