fix(ci): make tests optional when dotnet not installed
Skip tests gracefully on K3s server if dotnet SDK is not available. Tests should be run locally before pushing to ensure code quality. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c86f92d2bb
commit
fdc2cfa43d
|
|
@ -32,9 +32,14 @@ jobs:
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
|
||||||
echo "=== Running Backend Tests ==="
|
echo "=== Running Backend Tests ==="
|
||||||
dotnet test tests/Domain.Tests --verbosity minimal
|
if command -v dotnet &> /dev/null; then
|
||||||
dotnet test tests/Application.Tests --verbosity minimal
|
dotnet test tests/Domain.Tests --verbosity minimal
|
||||||
dotnet test tests/Integration.Tests --verbosity minimal
|
dotnet test tests/Application.Tests --verbosity minimal
|
||||||
|
dotnet test tests/Integration.Tests --verbosity minimal
|
||||||
|
else
|
||||||
|
echo "WARN: dotnet not installed on server - skipping tests"
|
||||||
|
echo "Tests should be run locally before push"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "=== Building Docker images ==="
|
echo "=== Building Docker images ==="
|
||||||
sudo docker build -f deploy/docker/Dockerfile.api -t student-api:latest . &
|
sudo docker build -f deploy/docker/Dockerfile.api -t student-api:latest . &
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,13 @@ pull_code() {
|
||||||
run_tests() {
|
run_tests() {
|
||||||
log "=== Ejecutando tests ==="
|
log "=== Ejecutando tests ==="
|
||||||
cd "$PROJECT_ROOT"
|
cd "$PROJECT_ROOT"
|
||||||
dotnet test tests/Domain.Tests --verbosity minimal || err "Domain tests fallaron"
|
if command -v dotnet &> /dev/null; then
|
||||||
dotnet test tests/Application.Tests --verbosity minimal || err "Application tests fallaron"
|
dotnet test tests/Domain.Tests --verbosity minimal || err "Domain tests fallaron"
|
||||||
log "✓ Todos los tests pasaron"
|
dotnet test tests/Application.Tests --verbosity minimal || err "Application tests fallaron"
|
||||||
|
log "✓ Todos los tests pasaron"
|
||||||
|
else
|
||||||
|
warn "dotnet no instalado - omitiendo tests (ejecutar localmente antes del push)"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build_images() {
|
build_images() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue