diff --git a/Jenkinsfile b/Jenkinsfile index 7415d95..536b7ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ spec: - name: workspace-volume mountPath: /home/jenkins/agent - name: frontend - image: mcr.microsoft.com/playwright:v1.51.0-jammy + image: mcr.microsoft.com/playwright:v1.59.1-jammy command: ["cat"] tty: true volumeMounts: @@ -253,7 +253,11 @@ PY mkdir -p build export PYTHONPATH="${WORKSPACE}/backend:${PYTHONPATH:-}" python -m pip install --no-cache-dir -r backend/requirements.txt -r backend/requirements-dev.txt + set +e python -m pytest backend/tests -q --cov=backend/atlas_portal --cov-report=xml:build/backend-coverage.xml --junitxml=build/junit-backend.xml + backend_rc=$? + set -e + printf '%s\n' "${backend_rc}" > build/backend-tests.rc ''' } } @@ -266,11 +270,15 @@ PY set -euo pipefail mkdir -p build cd frontend +set +e npm ci npm run lint npm run test:unit npm run test:component npm run test:e2e +frontend_rc=$? +set -e +printf '%s\n' "${frontend_rc}" > ../build/frontend-tests.rc ''') } } @@ -288,6 +296,11 @@ npm run test:e2e --frontend-coverage frontend/coverage/coverage-summary.json \ --report build/quality-gate.json gate_rc=$? + backend_rc="$(cat build/backend-tests.rc 2>/dev/null || echo 1)" + frontend_rc="$(cat build/frontend-tests.rc 2>/dev/null || echo 1)" + if [ "${backend_rc}" -ne 0 ] || [ "${frontend_rc}" -ne 0 ]; then + gate_rc=1 + fi set -e printf '%s\n' "${gate_rc}" > build/quality-gate.rc '''