100 lines
3.8 KiB
PowerShell
100 lines
3.8 KiB
PowerShell
# Script PowerShell pour tester la compilation du module unionflow-server-api
|
|
# Auteur: UnionFlow Team
|
|
# Version: 1.0
|
|
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "TEST DE COMPILATION UNIONFLOW-SERVER-API" -ForegroundColor Cyan
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Fonction pour exécuter une commande Maven et vérifier le résultat
|
|
function Invoke-MavenCommand {
|
|
param(
|
|
[string]$Command,
|
|
[string]$Description
|
|
)
|
|
|
|
Write-Host "🔄 $Description..." -ForegroundColor Yellow
|
|
|
|
try {
|
|
$result = Invoke-Expression "mvn $Command"
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✅ $Description - SUCCÈS" -ForegroundColor Green
|
|
return $true
|
|
} else {
|
|
Write-Host "❌ $Description - ÉCHEC" -ForegroundColor Red
|
|
Write-Host $result -ForegroundColor Red
|
|
return $false
|
|
}
|
|
} catch {
|
|
Write-Host "❌ $Description - ERREUR: $_" -ForegroundColor Red
|
|
return $false
|
|
}
|
|
}
|
|
|
|
# Test 1: Nettoyage et compilation
|
|
if (-not (Invoke-MavenCommand "clean compile -q" "Nettoyage et compilation")) {
|
|
Write-Host "🛑 Arrêt du script - Erreur de compilation" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Test 2: Compilation des tests
|
|
if (-not (Invoke-MavenCommand "test-compile -q" "Compilation des tests")) {
|
|
Write-Host "🛑 Arrêt du script - Erreur de compilation des tests" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Test 3: Vérification Checkstyle
|
|
Write-Host "🔄 Vérification Checkstyle..." -ForegroundColor Yellow
|
|
try {
|
|
$checkstyleResult = mvn checkstyle:check -q 2>&1
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✅ Checkstyle - AUCUNE VIOLATION" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "⚠️ Checkstyle - VIOLATIONS DÉTECTÉES" -ForegroundColor Yellow
|
|
Write-Host $checkstyleResult -ForegroundColor Yellow
|
|
}
|
|
} catch {
|
|
Write-Host "❌ Checkstyle - ERREUR: $_" -ForegroundColor Red
|
|
}
|
|
|
|
# Test 4: Exécution des tests
|
|
if (-not (Invoke-MavenCommand "test -q" "Exécution des tests")) {
|
|
Write-Host "🛑 Arrêt du script - Échec des tests" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Test 5: Vérification de la couverture JaCoCo
|
|
Write-Host "🔄 Vérification de la couverture JaCoCo..." -ForegroundColor Yellow
|
|
try {
|
|
$jacocoResult = mvn jacoco:check -q 2>&1
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✅ JaCoCo - COUVERTURE SUFFISANTE" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "⚠️ JaCoCo - COUVERTURE INSUFFISANTE" -ForegroundColor Yellow
|
|
Write-Host $jacocoResult -ForegroundColor Yellow
|
|
}
|
|
} catch {
|
|
Write-Host "❌ JaCoCo - ERREUR: $_" -ForegroundColor Red
|
|
}
|
|
|
|
# Test 6: Installation complète
|
|
if (-not (Invoke-MavenCommand "clean install -q" "Installation complète")) {
|
|
Write-Host "🛑 Arrêt du script - Erreur d'installation" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "🎉 SUCCÈS: Toutes les vérifications sont passées !" -ForegroundColor Green
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
Write-Host "📊 Résumé des corrections appliquées:" -ForegroundColor Cyan
|
|
Write-Host " ✅ Correction des switch statements dans EvenementDTO et AideDTO" -ForegroundColor Green
|
|
Write-Host " ✅ Correction des types UUID et Long dans DemandeAideDTO" -ForegroundColor Green
|
|
Write-Host " ✅ Correction de la visibilité de marquerCommeModifie()" -ForegroundColor Green
|
|
Write-Host " ✅ Correction du type BigDecimal dans PropositionAideDTO" -ForegroundColor Green
|
|
Write-Host " ✅ Suppression des méthodes inexistantes dans AideDTOLegacy" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "🚀 Le module unionflow-server-api est prêt pour la production !" -ForegroundColor Green
|