fix: Update test deployment scripts to use port 8081 for test environment

- Updated test-deployment.sh to use port 8081 instead of 8080
- Updated test-e2e-deployment.py to use port 8081 instead of 8080
- Updated setup-test-environment.sh to use port 8081 instead of 8080
- All test scripts now work correctly with test environment configuration
This commit is contained in:
openhands 2025-11-01 17:50:28 +00:00
parent 2b52e27532
commit 66e56eb70c
3 changed files with 15 additions and 15 deletions

View File

@ -130,7 +130,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: calejo-control-adapter-test container_name: calejo-control-adapter-test
ports: ports:
- "8080:8080" # REST API - "8081:8081" # REST API
- "4840:4840" # OPC UA - "4840:4840" # OPC UA
- "502:502" # Modbus TCP - "502:502" # Modbus TCP
- "9090:9090" # Prometheus metrics - "9090:9090" # Prometheus metrics
@ -148,7 +148,7 @@ services:
- mock-optimizer - mock-optimizer
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
@ -745,7 +745,7 @@ sleep 30
print_status "Running health checks..." print_status "Running health checks..."
# Check Calejo Control Adapter # 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" print_success "Calejo Control Adapter is healthy"
else else
print_error "Calejo Control Adapter health check failed" print_error "Calejo Control Adapter health check failed"
@ -778,7 +778,7 @@ echo " TEST ENVIRONMENT READY"
echo "==================================================" echo "=================================================="
echo "" echo ""
echo "🌐 Access URLs:" 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 SCADA API: http://localhost:8081/api/v1/data"
echo " Mock Optimizer API: http://localhost:8082/api/v1/models" echo " Mock Optimizer API: http://localhost:8082/api/v1/models"
echo " PostgreSQL: localhost:5432" echo " PostgreSQL: localhost:5432"

View File

@ -48,7 +48,7 @@ echo "✅ Services started successfully"
echo "" echo ""
echo "⏳ Waiting for application to be ready..." echo "⏳ Waiting for application to be ready..."
for i in {1..30}; do 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!" echo "✅ Application is ready!"
break break
fi fi
@ -65,7 +65,7 @@ done
# Test the dashboard # Test the dashboard
echo "" echo ""
echo "🧪 Testing dashboard access..." 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 if [ "$DASHBOARD_RESPONSE" = "200" ]; then
echo "✅ Dashboard is accessible (HTTP 200)" echo "✅ Dashboard is accessible (HTTP 200)"
@ -76,7 +76,7 @@ fi
# Test the dashboard API # Test the dashboard API
echo "" echo ""
echo "🧪 Testing dashboard API..." 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 if [ "$API_RESPONSE" = "200" ]; then
echo "✅ Dashboard API is accessible (HTTP 200)" echo "✅ Dashboard API is accessible (HTTP 200)"
@ -87,7 +87,7 @@ fi
# Test configuration endpoint # Test configuration endpoint
echo "" echo ""
echo "🧪 Testing configuration endpoint..." 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 if [ "$CONFIG_RESPONSE" = "200" ]; then
echo "✅ Configuration endpoint is accessible (HTTP 200)" echo "✅ Configuration endpoint is accessible (HTTP 200)"
@ -101,9 +101,9 @@ echo "🎉 Deployment Test Complete!"
echo "============================" echo "============================"
echo "" echo ""
echo "📊 Access URLs:" echo "📊 Access URLs:"
echo " Dashboard: http://localhost:8080/dashboard" echo " Dashboard: http://localhost:8081/dashboard"
echo " REST API: http://localhost:8080" echo " REST API: http://localhost:8081"
echo " Health Check: http://localhost:8080/health" echo " Health Check: http://localhost:8081/health"
echo "" echo ""
echo "🔍 View logs:" echo "🔍 View logs:"
echo " docker-compose -f docker-compose.test.yml logs app" echo " docker-compose -f docker-compose.test.yml logs app"
@ -117,19 +117,19 @@ echo ""
# Run a quick health check # Run a quick health check
echo "🏥 Running 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" echo " Application status: $HEALTH"
# Test dashboard functionality # Test dashboard functionality
echo "" echo ""
echo "🧪 Testing dashboard functionality..." 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" echo "✅ Dashboard HTML is loading correctly"
else else
echo "❌ Dashboard HTML may not be loading correctly" echo "❌ Dashboard HTML may not be loading correctly"
fi 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" echo "✅ Dashboard JavaScript is loading correctly"
else else
echo "❌ Dashboard JavaScript may not be loading correctly" echo "❌ Dashboard JavaScript may not be loading correctly"

View File

@ -22,7 +22,7 @@ class E2ETestRunner:
"""End-to-end test runner for Calejo Control Adapter""" """End-to-end test runner for Calejo Control Adapter"""
def __init__(self): def __init__(self):
self.base_url = "http://localhost:8080" self.base_url = "http://localhost:8081"
self.mock_scada_process = None self.mock_scada_process = None
self.mock_optimization_process = None self.mock_optimization_process = None
self.main_app_process = None self.main_app_process = None