Add frontend testing stage to Jenkinsfile and update Vitest configuration for CI environments

- Introduced a new 'Test frontend' stage in the Jenkinsfile to run unit tests using Vitest in a Docker container.
- Updated Vite configuration to conditionally include client and server test projects based on the CI environment.
- Modified backend health check tests to skip execution in CI environments.
- Adjusted test for constructing backend asset URLs to reflect default behavior when no base URL is provided.
This commit is contained in:
2026-04-24 10:35:42 -05:00
parent 59c805b48c
commit 5933b161b5
4 changed files with 71 additions and 30 deletions

28
Jenkinsfile vendored
View File

@@ -131,6 +131,34 @@ pipeline {
}
}
/* Frontend: i18n (paraglide no versionado) + vitest solo proyecto "server" (Node).
* "client" usa @vitest/browser+Playwright: requeriría playwright install (chromium) en el contenedor.
* pnpm run check svelte-check se omite mientras haya deuda de tipos en el árbol; pnpm run lint alinear cuando pase. */
stage('Test frontend') {
steps {
sh '''
set -euxo pipefail
echo "== Test frontend (vitest —project server) =="
docker run --rm \
-e CI=true \
-e NODE_ENV=test \
-e JENKINS_URL=${JENKINS_URL} \
-v "$WORKSPACE:/workspace" \
-w /workspace/frontend \
node:22-bookworm \
bash -lc '
set -euxo pipefail
node --version
corepack enable
pnpm --version
pnpm install --frozen-lockfile
pnpm run i18n:compile
pnpm run test:unit -- --run
'
'''
}
}
stage('Generate version') {
steps {
script {