diff --git a/scripts/setup-test-environment.sh b/scripts/setup-test-environment.sh index 423b074..4f4a871 100755 --- a/scripts/setup-test-environment.sh +++ b/scripts/setup-test-environment.sh @@ -130,7 +130,7 @@ services: dockerfile: Dockerfile container_name: calejo-control-adapter-test ports: - - "8080:8080" # REST API + - "8081:8081" # REST API - "4840:4840" # OPC UA - "502:502" # Modbus TCP - "9090:9090" # Prometheus metrics @@ -148,7 +148,7 @@ services: - mock-optimizer restart: unless-stopped healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + test: ["CMD", "curl", "-f", "http://localhost:8081/health"] interval: 30s timeout: 10s retries: 3 @@ -745,7 +745,7 @@ sleep 30 print_status "Running health checks..." # Check Calejo Control Adapter -if curl -f http://localhost:8080/health > /dev/null 2>&1; then +if curl -f http://localhost:8081/health > /dev/null 2>&1; then print_success "Calejo Control Adapter is healthy" else print_error "Calejo Control Adapter health check failed" @@ -778,7 +778,7 @@ echo " TEST ENVIRONMENT READY" echo "==================================================" echo "" echo "๐ŸŒ Access URLs:" -echo " Calejo Dashboard: http://localhost:8080/dashboard" +echo " Calejo Dashboard: http://localhost:8081/dashboard" echo " Mock SCADA API: http://localhost:8081/api/v1/data" echo " Mock Optimizer API: http://localhost:8082/api/v1/models" echo " PostgreSQL: localhost:5432" diff --git a/test-deployment.sh b/test-deployment.sh index 1eae0fe..308c1b8 100755 --- a/test-deployment.sh +++ b/test-deployment.sh @@ -48,7 +48,7 @@ echo "โœ… Services started successfully" echo "" echo "โณ Waiting for application to be ready..." for i in {1..30}; do - if curl -s http://localhost:8080/health > /dev/null 2>&1; then + if curl -s http://localhost:8081/health > /dev/null 2>&1; then echo "โœ… Application is ready!" break fi @@ -65,7 +65,7 @@ done # Test the dashboard echo "" echo "๐Ÿงช Testing dashboard access..." -DASHBOARD_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/dashboard) +DASHBOARD_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8081/dashboard) if [ "$DASHBOARD_RESPONSE" = "200" ]; then echo "โœ… Dashboard is accessible (HTTP 200)" @@ -76,7 +76,7 @@ fi # Test the dashboard API echo "" echo "๐Ÿงช Testing dashboard API..." -API_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/api/v1/dashboard/status) +API_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8081/api/v1/dashboard/status) if [ "$API_RESPONSE" = "200" ]; then echo "โœ… Dashboard API is accessible (HTTP 200)" @@ -87,7 +87,7 @@ fi # Test configuration endpoint echo "" echo "๐Ÿงช Testing configuration endpoint..." -CONFIG_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/api/v1/dashboard/config) +CONFIG_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8081/api/v1/dashboard/config) if [ "$CONFIG_RESPONSE" = "200" ]; then echo "โœ… Configuration endpoint is accessible (HTTP 200)" @@ -101,9 +101,9 @@ echo "๐ŸŽ‰ Deployment Test Complete!" echo "============================" echo "" echo "๐Ÿ“Š Access URLs:" -echo " Dashboard: http://localhost:8080/dashboard" -echo " REST API: http://localhost:8080" -echo " Health Check: http://localhost:8080/health" +echo " Dashboard: http://localhost:8081/dashboard" +echo " REST API: http://localhost:8081" +echo " Health Check: http://localhost:8081/health" echo "" echo "๐Ÿ” View logs:" echo " docker-compose -f docker-compose.test.yml logs app" @@ -117,19 +117,19 @@ echo "" # Run a quick health check echo "๐Ÿฅ Running health check..." -HEALTH=$(curl -s http://localhost:8080/health | jq -r '.status' 2>/dev/null || echo "unknown") +HEALTH=$(curl -s http://localhost:8081/health | jq -r '.status' 2>/dev/null || echo "unknown") echo " Application status: $HEALTH" # Test dashboard functionality echo "" echo "๐Ÿงช Testing dashboard functionality..." -if curl -s http://localhost:8080/dashboard | grep -q "Calejo Control Adapter Dashboard"; then +if curl -s http://localhost:8081/dashboard | grep -q "Calejo Control Adapter Dashboard"; then echo "โœ… Dashboard HTML is loading correctly" else echo "โŒ Dashboard HTML may not be loading correctly" fi -if curl -s http://localhost:8080/static/dashboard.js | grep -q "showTab"; then +if curl -s http://localhost:8081/static/dashboard.js | grep -q "showTab"; then echo "โœ… Dashboard JavaScript is loading correctly" else echo "โŒ Dashboard JavaScript may not be loading correctly" diff --git a/test-e2e-deployment.py b/test-e2e-deployment.py index 1a3e955..3b8a3a3 100755 --- a/test-e2e-deployment.py +++ b/test-e2e-deployment.py @@ -22,7 +22,7 @@ class E2ETestRunner: """End-to-end test runner for Calejo Control Adapter""" def __init__(self): - self.base_url = "http://localhost:8080" + self.base_url = "http://localhost:8081" self.mock_scada_process = None self.mock_optimization_process = None self.main_app_process = None