#!/bin/bash # # Phase 14: Testing & Validation # Health checks, integration tests, E2E tests, performance tests, security tests # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/config.sh" log_info "==========================================" log_info "Phase 14: Testing & Validation" log_info "==========================================" # 14.1 Health Checks log_step "14.1 Running health checks..." check_proxmox_access curl -fsS "http://${ORDER_PORTAL_PUBLIC_IP}:${ORDER_PORTAL_PUBLIC_PORT}/api/health" >/dev/null \ && log_success "Direct Order CT health check passed" \ || log_warning "Direct Order CT health check failed" curl -fsS -H "Host: the-order.sankofa.nexus" "http://${ORDER_HAPROXY_IP}/api/health" >/dev/null \ && log_success "Order HAProxy health check passed" \ || log_warning "Order HAProxy health check failed" curl -fsS "${THE_ORDER_PUBLIC_URL}/api/health" >/dev/null \ && log_success "Public The Order health check passed" \ || log_warning "Public The Order health check failed" curl -fsS "${SANKOFA_PHOENIX_URL}/health" >/dev/null \ && log_success "Phoenix public health check passed" \ || log_warning "Phoenix public health check failed" # 14.2 Integration Testing log_step "14.2 Running integration tests..." if [ -f "${PROJECT_ROOT}/package.json" ]; then log_info "Running integration tests..." cd "${PROJECT_ROOT}" pnpm test:integration || log_warning "Integration tests failed or not configured" else log_info "Integration tests not configured" fi log_info "Testing complete" log_info "Next steps (manual):" log_info " 1. Run E2E tests" log_info " 2. Run performance tests" log_info " 3. Run security scans" log_info " 4. Review test results" # Save state save_state "phase14" "complete" log_success "==========================================" log_success "Phase 14: Testing & Validation - COMPLETE" log_success "=========================================="