- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
169 lines
5.0 KiB
Bash
Executable File
169 lines
5.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 🧪 Test Complet des Services RPA Vision V3
|
|
# Auteur : Dom, Alice Kiro
|
|
# Date : 22 décembre 2024
|
|
|
|
set -e
|
|
|
|
# Couleurs pour l'affichage
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
PURPLE='\033[0;35m'
|
|
CYAN='\033[0;36m'
|
|
NC='\033[0m' # No Color
|
|
|
|
print_header() {
|
|
echo -e "${PURPLE}"
|
|
echo "╔════════════════════════════════════════════════════════════╗"
|
|
echo "║ 🧪 Test Complet des Services RPA V3 🧪 ║"
|
|
echo "║ Vérification de tous les endpoints ║"
|
|
echo "╚════════════════════════════════════════════════════════════╝"
|
|
echo -e "${NC}"
|
|
}
|
|
|
|
# Fonction de test d'un service
|
|
test_service() {
|
|
local name=$1
|
|
local url=$2
|
|
local expected_status=${3:-200}
|
|
|
|
echo -e "${BLUE}🔍 Test de $name...${NC}"
|
|
|
|
if curl -s -o /dev/null -w "%{http_code}" "$url" | grep -q "$expected_status"; then
|
|
echo -e "${GREEN}✅ $name : OK${NC}"
|
|
return 0
|
|
else
|
|
echo -e "${RED}❌ $name : ÉCHEC${NC}"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Fonction de test avec contenu
|
|
test_service_content() {
|
|
local name=$1
|
|
local url=$2
|
|
local expected_content=$3
|
|
|
|
echo -e "${BLUE}🔍 Test de $name (contenu)...${NC}"
|
|
|
|
local response=$(curl -s "$url")
|
|
if echo "$response" | grep -q "$expected_content"; then
|
|
echo -e "${GREEN}✅ $name : Contenu OK${NC}"
|
|
return 0
|
|
else
|
|
echo -e "${RED}❌ $name : Contenu manquant${NC}"
|
|
echo -e "${YELLOW}Réponse reçue : ${response:0:100}...${NC}"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Fonction principale de test
|
|
run_tests() {
|
|
local failed=0
|
|
|
|
echo -e "${CYAN}[1/6] Test de l'API principale...${NC}"
|
|
if ! test_service "API Status Check" "http://localhost:8000/api/traces/status" "200"; then
|
|
((failed++))
|
|
fi
|
|
|
|
echo -e "${CYAN}[2/6] Test du Dashboard Web...${NC}"
|
|
if ! test_service "Dashboard" "http://localhost:5001" "200"; then
|
|
((failed++))
|
|
fi
|
|
|
|
echo -e "${CYAN}[3/6] Test du Visual Workflow Builder...${NC}"
|
|
if ! test_service_content "VWB Frontend" "http://localhost:3000" "Visual Workflow Builder"; then
|
|
((failed++))
|
|
fi
|
|
|
|
echo -e "${CYAN}[4/6] Test du Backend VWB...${NC}"
|
|
if ! test_service "VWB Backend Health" "http://localhost:5002/health" "200"; then
|
|
((failed++))
|
|
fi
|
|
|
|
echo -e "${CYAN}[5/6] Test des APIs VWB...${NC}"
|
|
if ! test_service "VWB Workflows API" "http://localhost:5002/api/workflows" "200"; then
|
|
((failed++))
|
|
fi
|
|
|
|
echo -e "${CYAN}[6/6] Test des logs...${NC}"
|
|
if [ -f "logs/main_backend.log" ] && [ -f "logs/vwb_backend.log" ] && [ -f "logs/vwb_frontend.log" ]; then
|
|
echo -e "${GREEN}✅ Fichiers de logs : OK${NC}"
|
|
else
|
|
echo -e "${RED}❌ Fichiers de logs : Manquants${NC}"
|
|
((failed++))
|
|
fi
|
|
|
|
return $failed
|
|
}
|
|
|
|
# Fonction d'affichage des résultats
|
|
show_results() {
|
|
local failed=$1
|
|
|
|
echo ""
|
|
echo -e "${PURPLE}📊 Résultats des tests${NC}"
|
|
echo "=========================="
|
|
|
|
if [ $failed -eq 0 ]; then
|
|
echo -e "${GREEN}🎉 Tous les tests sont passés avec succès !${NC}"
|
|
echo -e "${GREEN}✅ Système RPA Vision V3 entièrement opérationnel${NC}"
|
|
else
|
|
echo -e "${RED}❌ $failed test(s) ont échoué${NC}"
|
|
echo -e "${YELLOW}⚠️ Vérifiez que tous les services sont démarrés avec ./launch_all.sh${NC}"
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${BLUE}🌐 URLs des services :${NC}"
|
|
echo -e "${CYAN} • API REST: http://localhost:8000${NC}"
|
|
echo -e "${CYAN} • Dashboard Web: http://localhost:5001${NC}"
|
|
echo -e "${CYAN} • Visual Workflow Builder: http://localhost:3000${NC}"
|
|
echo -e "${CYAN} • VWB Backend: http://localhost:5002${NC}"
|
|
}
|
|
|
|
# Fonction de diagnostic
|
|
run_diagnostics() {
|
|
echo ""
|
|
echo -e "${YELLOW}🔧 Diagnostic des services...${NC}"
|
|
|
|
echo -e "${BLUE}Processus Python actifs :${NC}"
|
|
ps aux | grep python | grep -v grep | head -5
|
|
|
|
echo -e "${BLUE}Ports en écoute :${NC}"
|
|
netstat -tlnp 2>/dev/null | grep -E ":(3000|5001|5002|8000)" || echo "Aucun port trouvé"
|
|
|
|
echo -e "${BLUE}Taille des logs :${NC}"
|
|
if [ -d "logs" ]; then
|
|
ls -lh logs/*.log 2>/dev/null || echo "Pas de fichiers de logs"
|
|
else
|
|
echo "Répertoire logs non trouvé"
|
|
fi
|
|
}
|
|
|
|
# Script principal
|
|
main() {
|
|
print_header
|
|
|
|
echo -e "${YELLOW}⏳ Attente de 3 secondes pour que les services se stabilisent...${NC}"
|
|
sleep 3
|
|
|
|
if run_tests; then
|
|
failed=$?
|
|
else
|
|
failed=$?
|
|
fi
|
|
|
|
show_results $failed
|
|
|
|
if [ $failed -gt 0 ]; then
|
|
run_diagnostics
|
|
fi
|
|
|
|
exit $failed
|
|
}
|
|
|
|
# Lancer le script
|
|
main "$@" |