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
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"

View File

@ -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"

View File

@ -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