- 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>
279 lines
8.6 KiB
Bash
Executable File
279 lines
8.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script de test pour le Checkpoint 22
|
|
# Vérifie l'intégration complète de la Phase 6 (Exécution et Monitoring)
|
|
|
|
echo "=========================================="
|
|
echo "Checkpoint 22 - Tests Phase 6"
|
|
echo "Exécution et Monitoring"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Couleurs
|
|
GREEN='\033[0;32m'
|
|
RED='\033[0;31m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Compteurs
|
|
TESTS_PASSED=0
|
|
TESTS_FAILED=0
|
|
WARNINGS=0
|
|
|
|
# Fonction de test
|
|
test_file() {
|
|
local file=$1
|
|
local description=$2
|
|
|
|
if [ -f "$file" ]; then
|
|
echo -e "${GREEN}✓${NC} $description"
|
|
((TESTS_PASSED++))
|
|
return 0
|
|
else
|
|
echo -e "${RED}✗${NC} $description"
|
|
echo " Fichier manquant: $file"
|
|
((TESTS_FAILED++))
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Fonction de test de contenu
|
|
test_content() {
|
|
local file=$1
|
|
local pattern=$2
|
|
local description=$3
|
|
|
|
if [ -f "$file" ] && grep -q "$pattern" "$file"; then
|
|
echo -e "${GREEN}✓${NC} $description"
|
|
((TESTS_PASSED++))
|
|
return 0
|
|
else
|
|
echo -e "${RED}✗${NC} $description"
|
|
((TESTS_FAILED++))
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Fonction d'avertissement
|
|
warn() {
|
|
local message=$1
|
|
echo -e "${YELLOW}⚠${NC} $message"
|
|
((WARNINGS++))
|
|
}
|
|
|
|
echo -e "${BLUE}Phase 6: Exécution et Monitoring${NC}"
|
|
echo "-----------------------------------"
|
|
echo ""
|
|
|
|
echo "1. Tâche 18 : Intégration avec le moteur d'exécution"
|
|
echo "------------------------------------------------------"
|
|
|
|
test_file "visual_workflow_builder/backend/services/execution_integration.py" \
|
|
"Service d'intégration d'exécution créé"
|
|
|
|
test_content "visual_workflow_builder/backend/services/execution_integration.py" \
|
|
"ExecutionIntegration" \
|
|
"Classe ExecutionIntegration définie"
|
|
|
|
test_content "visual_workflow_builder/backend/services/execution_integration.py" \
|
|
"execute_workflow" \
|
|
"Méthode execute_workflow implémentée"
|
|
|
|
test_file "visual_workflow_builder/backend/test_execution_integration.py" \
|
|
"Tests d'intégration créés"
|
|
|
|
echo ""
|
|
echo "2. Tâche 20 : Implémenter les WebSocket handlers"
|
|
echo "-------------------------------------------------"
|
|
|
|
test_file "visual_workflow_builder/backend/api/websocket_handlers.py" \
|
|
"WebSocket handlers créés"
|
|
|
|
test_content "visual_workflow_builder/backend/api/websocket_handlers.py" \
|
|
"subscribe_execution" \
|
|
"Handler subscribe_execution implémenté"
|
|
|
|
test_content "visual_workflow_builder/backend/api/websocket_handlers.py" \
|
|
"unsubscribe_execution" \
|
|
"Handler unsubscribe_execution implémenté"
|
|
|
|
test_file "visual_workflow_builder/backend/test_websocket.py" \
|
|
"Tests WebSocket créés"
|
|
|
|
echo ""
|
|
echo "3. Tâche 21 : Synchronisation d'état visuel"
|
|
echo "--------------------------------------------"
|
|
|
|
test_file "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"Hook useExecutionSync créé"
|
|
|
|
test_file "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"Composant ExecutionPanel créé"
|
|
|
|
test_file "visual_workflow_builder/frontend/src/components/ExecutionPanel/ExecutionPanel.css" \
|
|
"Styles ExecutionPanel créés"
|
|
|
|
test_file "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"Styles d'exécution Canvas créés"
|
|
|
|
test_file "visual_workflow_builder/frontend/src/components/WorkflowExecutor/index.tsx" \
|
|
"Composant WorkflowExecutor créé"
|
|
|
|
echo ""
|
|
echo "4. Vérification des exigences Phase 6"
|
|
echo "--------------------------------------"
|
|
|
|
# Exigence 6.1: Exécution de workflows
|
|
test_content "visual_workflow_builder/backend/services/execution_integration.py" \
|
|
"execute_workflow" \
|
|
"Exigence 6.1: Exécution de workflows"
|
|
|
|
# Exigence 6.2: Gestion des erreurs
|
|
test_content "visual_workflow_builder/backend/services/execution_integration.py" \
|
|
"try:" \
|
|
"Exigence 6.2: Gestion des erreurs"
|
|
|
|
# Exigence 6.3: Monitoring en temps réel
|
|
test_content "visual_workflow_builder/backend/api/websocket_handlers.py" \
|
|
"socketio" \
|
|
"Exigence 6.3: Monitoring en temps réel (WebSocket)"
|
|
|
|
# Exigence 6.4: Logs d'exécution
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"LogsPanel" \
|
|
"Exigence 6.4: Logs d'exécution"
|
|
|
|
# Exigence 6.5: Annulation d'exécution
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"cancelExecution" \
|
|
"Exigence 6.5: Annulation d'exécution"
|
|
|
|
echo ""
|
|
echo "5. Tests Backend"
|
|
echo "----------------"
|
|
|
|
if [ -d "visual_workflow_builder/backend" ]; then
|
|
echo "Vérification de l'environnement Python..."
|
|
|
|
if command -v python3 &> /dev/null; then
|
|
echo -e "${GREEN}✓${NC} Python3 disponible"
|
|
((TESTS_PASSED++))
|
|
|
|
# Vérifier si on peut importer les modules
|
|
if python3 -c "import sys; sys.path.insert(0, 'visual_workflow_builder/backend'); from services.execution_integration import ExecutionIntegration" 2>/dev/null; then
|
|
echo -e "${GREEN}✓${NC} Module execution_integration importable"
|
|
((TESTS_PASSED++))
|
|
else
|
|
warn "Module execution_integration non importable (dépendances manquantes?)"
|
|
fi
|
|
|
|
if python3 -c "import sys; sys.path.insert(0, 'visual_workflow_builder/backend'); from api.websocket_handlers import register_websocket_handlers" 2>/dev/null; then
|
|
echo -e "${GREEN}✓${NC} Module websocket_handlers importable"
|
|
((TESTS_PASSED++))
|
|
else
|
|
warn "Module websocket_handlers non importable (dépendances manquantes?)"
|
|
fi
|
|
else
|
|
warn "Python3 non disponible"
|
|
fi
|
|
else
|
|
echo -e "${RED}✗${NC} Répertoire backend manquant"
|
|
((TESTS_FAILED++))
|
|
fi
|
|
|
|
echo ""
|
|
echo "6. Tests Frontend"
|
|
echo "-----------------"
|
|
|
|
if [ -d "visual_workflow_builder/frontend/src" ]; then
|
|
echo "Vérification de la structure frontend..."
|
|
|
|
# Vérifier TypeScript
|
|
if command -v tsc &> /dev/null; then
|
|
echo -e "${GREEN}✓${NC} TypeScript disponible"
|
|
((TESTS_PASSED++))
|
|
else
|
|
warn "TypeScript non disponible (npm install nécessaire?)"
|
|
fi
|
|
|
|
# Vérifier les imports
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"useExecutionSync" \
|
|
"Canvas importe useExecutionSync"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"ExecutionStyles.css" \
|
|
"Canvas importe ExecutionStyles"
|
|
else
|
|
echo -e "${RED}✗${NC} Répertoire frontend/src manquant"
|
|
((TESTS_FAILED++))
|
|
fi
|
|
|
|
echo ""
|
|
echo "7. Intégration Complète"
|
|
echo "-----------------------"
|
|
|
|
# Vérifier que tous les composants sont connectés
|
|
test_content "visual_workflow_builder/frontend/src/components/WorkflowExecutor/index.tsx" \
|
|
"Canvas" \
|
|
"WorkflowExecutor utilise Canvas"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/WorkflowExecutor/index.tsx" \
|
|
"ExecutionPanel" \
|
|
"WorkflowExecutor utilise ExecutionPanel"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"executionId" \
|
|
"Canvas accepte executionId"
|
|
|
|
echo ""
|
|
echo "8. Documentation"
|
|
echo "----------------"
|
|
|
|
test_file "visual_workflow_builder/TASK_18_COMPLETE.md" \
|
|
"Documentation tâche 18"
|
|
|
|
test_file "visual_workflow_builder/TASK_20_COMPLETE.md" \
|
|
"Documentation tâche 20"
|
|
|
|
test_file "visual_workflow_builder/TASK_21_COMPLETE.md" \
|
|
"Documentation tâche 21"
|
|
|
|
echo ""
|
|
echo "=========================================="
|
|
echo "Résumé du Checkpoint 22"
|
|
echo "=========================================="
|
|
echo -e "Tests réussis: ${GREEN}$TESTS_PASSED${NC}"
|
|
echo -e "Tests échoués: ${RED}$TESTS_FAILED${NC}"
|
|
echo -e "Avertissements: ${YELLOW}$WARNINGS${NC}"
|
|
echo ""
|
|
|
|
if [ $TESTS_FAILED -eq 0 ]; then
|
|
echo -e "${GREEN}✅ Checkpoint 22 RÉUSSI !${NC}"
|
|
echo ""
|
|
echo "Phase 6 (Exécution et Monitoring) complète :"
|
|
echo " ✓ Intégration avec le moteur d'exécution"
|
|
echo " ✓ WebSocket handlers pour temps réel"
|
|
echo " ✓ Synchronisation d'état visuel"
|
|
echo " ✓ Panneau d'exécution avec logs"
|
|
echo " ✓ Contrôles d'exécution (démarrer/annuler)"
|
|
echo ""
|
|
|
|
if [ $WARNINGS -gt 0 ]; then
|
|
echo -e "${YELLOW}Note:${NC} $WARNINGS avertissement(s) détecté(s)"
|
|
echo "Ces avertissements n'empêchent pas le passage au checkpoint suivant."
|
|
echo ""
|
|
fi
|
|
|
|
echo "Prêt pour la Phase 7 : Templates et Réutilisabilité"
|
|
echo ""
|
|
exit 0
|
|
else
|
|
echo -e "${RED}❌ Checkpoint 22 ÉCHOUÉ${NC}"
|
|
echo ""
|
|
echo "Veuillez corriger les erreurs avant de continuer."
|
|
echo ""
|
|
exit 1
|
|
fi
|