- 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>
243 lines
7.8 KiB
Bash
Executable File
243 lines
7.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script de test pour la synchronisation d'état visuel
|
|
# Tâche 21 - Visual Workflow Builder
|
|
|
|
echo "=========================================="
|
|
echo "Test de la Synchronisation d'État Visuel"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Couleurs
|
|
GREEN='\033[0;32m'
|
|
RED='\033[0;31m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Compteurs
|
|
TESTS_PASSED=0
|
|
TESTS_FAILED=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"
|
|
echo " Pattern non trouvé: $pattern dans $file"
|
|
((TESTS_FAILED++))
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
echo "1. Vérification des fichiers créés"
|
|
echo "-----------------------------------"
|
|
|
|
# Hook de synchronisation
|
|
test_file "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"Hook useExecutionSync créé"
|
|
|
|
# Composant ExecutionPanel
|
|
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"
|
|
|
|
# Styles d'exécution
|
|
test_file "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"Styles d'exécution Canvas créés"
|
|
|
|
# Composant WorkflowExecutor
|
|
test_file "visual_workflow_builder/frontend/src/components/WorkflowExecutor/index.tsx" \
|
|
"Composant WorkflowExecutor créé"
|
|
|
|
# Tests
|
|
test_file "visual_workflow_builder/frontend/src/hooks/useExecutionSync.test.ts" \
|
|
"Tests useExecutionSync créés"
|
|
|
|
echo ""
|
|
echo "2. Vérification du contenu des fichiers"
|
|
echo "----------------------------------------"
|
|
|
|
# Vérifier les fonctionnalités du hook
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"useExecutionSync" \
|
|
"Hook useExecutionSync défini"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"useNodeSync" \
|
|
"Hook useNodeSync défini"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"useEdgeSync" \
|
|
"Hook useEdgeSync défini"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"socket.io-client" \
|
|
"Import de socket.io-client"
|
|
|
|
# Vérifier ExecutionPanel
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"ExecutionPanel" \
|
|
"Composant ExecutionPanel défini"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"ProgressBar" \
|
|
"Composant ProgressBar défini"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"LogsPanel" \
|
|
"Composant LogsPanel défini"
|
|
|
|
# Vérifier les styles d'exécution
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"node-running" \
|
|
"Styles pour node-running"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"node-success" \
|
|
"Styles pour node-success"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"edge-active" \
|
|
"Styles pour edge-active"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"@keyframes" \
|
|
"Animations CSS définies"
|
|
|
|
# Vérifier l'intégration dans Canvas
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"useExecutionSync" \
|
|
"Import de useExecutionSync dans Canvas"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"ExecutionStyles.css" \
|
|
"Import des styles d'exécution dans Canvas"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/index.tsx" \
|
|
"executionId" \
|
|
"Prop executionId dans Canvas"
|
|
|
|
echo ""
|
|
echo "3. Vérification des exigences"
|
|
echo "------------------------------"
|
|
|
|
# Exigence 7.1: Synchronisation des nodes
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"NodeExecutionStatus" \
|
|
"Exigence 7.1: Types de statut de node"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"getNodeStatus" \
|
|
"Exigence 7.1: Fonction getNodeStatus"
|
|
|
|
# Exigence 7.2: Synchronisation des edges
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"useEdgeSync" \
|
|
"Exigence 7.2: Hook useEdgeSync"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/Canvas/ExecutionStyles.css" \
|
|
"edge-active" \
|
|
"Exigence 7.2: Styles pour edges actifs"
|
|
|
|
# Exigence 7.3: Affichage de la progression
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"ProgressBar" \
|
|
"Exigence 7.3: Composant ProgressBar"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"progress" \
|
|
"Exigence 7.3: Affichage de la progression"
|
|
|
|
# Exigence 7.4: Logs en temps réel
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"LogsPanel" \
|
|
"Exigence 7.4: Composant LogsPanel"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/components/ExecutionPanel/index.tsx" \
|
|
"autoScroll" \
|
|
"Exigence 7.4: Auto-scroll des logs"
|
|
|
|
echo ""
|
|
echo "4. Vérification des événements WebSocket"
|
|
echo "-----------------------------------------"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"execution_started" \
|
|
"Événement execution_started"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"node_status" \
|
|
"Événement node_status"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"execution_progress" \
|
|
"Événement execution_progress"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"execution_complete" \
|
|
"Événement execution_complete"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"execution_error" \
|
|
"Événement execution_error"
|
|
|
|
test_content "visual_workflow_builder/frontend/src/hooks/useExecutionSync.ts" \
|
|
"execution_log" \
|
|
"Événement execution_log"
|
|
|
|
echo ""
|
|
echo "=========================================="
|
|
echo "Résumé des tests"
|
|
echo "=========================================="
|
|
echo -e "Tests réussis: ${GREEN}$TESTS_PASSED${NC}"
|
|
echo -e "Tests échoués: ${RED}$TESTS_FAILED${NC}"
|
|
echo ""
|
|
|
|
if [ $TESTS_FAILED -eq 0 ]; then
|
|
echo -e "${GREEN}✓ Tous les tests sont passés !${NC}"
|
|
echo ""
|
|
echo "La synchronisation d'état visuel est implémentée avec succès."
|
|
echo ""
|
|
echo "Fonctionnalités disponibles:"
|
|
echo " • Hook useExecutionSync pour la synchronisation WebSocket"
|
|
echo " • Hook useNodeSync pour synchroniser les états des nodes"
|
|
echo " • Hook useEdgeSync pour synchroniser les états des edges"
|
|
echo " • Composant ExecutionPanel avec progression et logs"
|
|
echo " • Styles CSS pour les états d'exécution (running, success, failed)"
|
|
echo " • Animations pour les nodes et edges actifs"
|
|
echo " • Composant WorkflowExecutor pour l'intégration complète"
|
|
echo ""
|
|
exit 0
|
|
else
|
|
echo -e "${RED}✗ Certains tests ont échoué${NC}"
|
|
echo ""
|
|
echo "Veuillez vérifier les fichiers manquants ou incomplets."
|
|
exit 1
|
|
fi
|