fix: refs #6695 update Cypress cache handling and increase wait timeout for elements
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
a4fa89f15e
commit
5b5ed2c34f
|
@ -107,8 +107,8 @@ pipeline {
|
||||||
-e TZ=Europe/Madrid
|
-e TZ=Europe/Madrid
|
||||||
-e DOCKER=true
|
-e DOCKER=true
|
||||||
-e CI=true
|
-e CI=true
|
||||||
-e CYPRESS_CACHE_FOLDER=/app/.cypress_cache
|
|
||||||
""".stripIndent()) {
|
""".stripIndent()) {
|
||||||
|
sh 'pnpm exec cypress install'
|
||||||
sh 'pnpm exec cypress run --browser chromium'
|
sh 'pnpm exec cypress run --browser chromium'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
FROM alexmorenovn/vndev:latest
|
FROM alexmorenovn/vndev:latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copiar los archivos de package.json y pnpm-lock.yaml para evitar reinstalar dependencias innecesariamente
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
# Especificamos la ruta personalizada para la caché de Cypress
|
# Instalar solo Cypress sin instalar todas las dependencias del proyecto
|
||||||
ENV CYPRESS_CACHE_FOLDER=/app/.cypress_cache
|
RUN pnpm install --frozen-lockfile && pnpm exec cypress install
|
||||||
|
|
||||||
# Instalamos las dependencias y Cypress en la ruta definida
|
|
||||||
RUN pnpm install --frozen-lockfile \
|
|
||||||
&& CYPRESS_CACHE_FOLDER=$CYPRESS_CACHE_FOLDER pnpm exec cypress install
|
|
||||||
|
|
||||||
# Verificamos que la caché de Cypress se haya instalado correctamente
|
|
||||||
RUN echo "Cypress cache installed at: $CYPRESS_CACHE_FOLDER" \
|
|
||||||
&& ls -la $CYPRESS_CACHE_FOLDER || true
|
|
||||||
|
|
||||||
# Configuramos el PATH para que Cypress sea accesible
|
|
||||||
ENV PATH="$CYPRESS_CACHE_FOLDER/${CYPRESS_VERSION}/Cypress:${PATH}"
|
|
||||||
|
|
||||||
|
# Definir el directorio de trabajo por defecto
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -18,7 +18,7 @@ run_group() {
|
||||||
-v "$(pwd)":/app \
|
-v "$(pwd)":/app \
|
||||||
-w /app \
|
-w /app \
|
||||||
cypress-setup \
|
cypress-setup \
|
||||||
pnpm exec cypress run --browser chromium --spec test/cypress/integration/${folderName}/**/*.spec.js)
|
pnpm exec cypress run --browser chromium --spec test/cypress/integration/${folderName}/**/*.spec.js --no-exit)
|
||||||
|
|
||||||
# 🔹 Esperar activamente a que el contenedor finalice
|
# 🔹 Esperar activamente a que el contenedor finalice
|
||||||
while true; do
|
while true; do
|
||||||
|
@ -33,7 +33,7 @@ run_group() {
|
||||||
exit_code=$(docker inspect -f '{{.State.ExitCode}}' "$containerId" 2>/dev/null || echo "1")
|
exit_code=$(docker inspect -f '{{.State.ExitCode}}' "$containerId" 2>/dev/null || echo "1")
|
||||||
|
|
||||||
if [[ "$exit_code" -ne 0 ]]; then
|
if [[ "$exit_code" -ne 0 ]]; then
|
||||||
# echo "❌ Error en la ejecución de ${folderName} (Exit Code: $exit_code)"
|
echo "❌ Fallos - ${folderName}"
|
||||||
docker logs "$containerId" > "test/cypress/docker/logs/${uniqueName}_${folderName}_log" 2>/dev/null || true
|
docker logs "$containerId" > "test/cypress/docker/logs/${uniqueName}_${folderName}_log" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
docker rm -f ${uniqueName}_${folderName}_cypress >/dev/null 2>&1 || true
|
docker rm -f ${uniqueName}_${folderName}_cypress >/dev/null 2>&1 || true
|
||||||
|
|
Loading…
Reference in New Issue