Files
TSYSDevStack-SupportStack-L…/demo/tests/e2e/test_deployment_workflow.sh
reachableceo 25f7a6cd75 feat(demo): migrate 5 SelfStack services to demo stack (16→24 services)
Add Reactive Resume, Metrics, Kiwix, Resume Matcher, and Apple Health
from the earlier SelfStack project. Rewrite Apple Health collector to
use InfluxDB v2 with proper error handling. Update all tests, scripts,
Homepage config, env template, and documentation for the expanded stack.

New services:
- Reactive Resume (4016) + Postgres/Minio/Chrome companions
- Metrics (4021) - GitHub metrics visualization
- Kiwix (4022) - offline wiki reader
- Resume Matcher (4023) - AI resume screening
- Apple Health (4024) - health data collector → InfluxDB v2

Also adds git policy to AGENTS.md: always commit and push automatically.

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
2026-05-08 12:28:56 -05:00

82 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# E2E test: Complete deployment workflow
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
ENV_FILE="$PROJECT_ROOT/demo.env"
set -a; source "$ENV_FILE"; set +a
PASS=0
FAIL=0
pass() { echo "PASS: $1"; ((PASS++)); }
fail() { echo "FAIL: $1"; ((FAIL++)); }
test_complete_deployment() {
echo "Testing complete deployment workflow..."
# Step 1: Run deployment script
if "$PROJECT_ROOT/scripts/demo-stack.sh" deploy; then
pass "Deployment script execution"
else
fail "Deployment script execution"
return 1
fi
# Step 2: Wait for services to stabilize
echo "Waiting 90 seconds for services to stabilize..."
sleep 90
# Step 3: Validate no exited/unhealthy services
local unhealthy
unhealthy=$(docker compose -f "$PROJECT_ROOT/docker-compose.yml" ps --format json 2>/dev/null | \
grep -c '"unhealthy\|exited\|dead"' || echo "0")
if [[ "$unhealthy" -eq 0 ]]; then
pass "All services healthy/running"
else
fail "$unhealthy services unhealthy/exited"
fi
# Step 4: Validate all ports accessible
local ports=(
"$HOMEPAGE_PORT"
"$DOCKHAND_PORT"
"$PIHOLE_PORT"
"$INFLUXDB_PORT"
"$GRAFANA_PORT"
"$DRAWIO_PORT"
"$KROKI_PORT"
"$ATOMIC_TRACKER_PORT"
"$ARCHIVEBOX_PORT"
"$TUBE_ARCHIVIST_PORT"
"$WAKAPI_PORT"
"$MAILHOG_PORT"
"$ATUIN_PORT"
"$REACTIVE_RESUME_PORT"
"$METRICS_PORT"
"$KIWIX_PORT"
"$RESUME_MATCHER_PORT"
"$APPLEHEALTH_PORT"
)
local failed_ports=0
for port in "${ports[@]}"; do
if curl -f -s --max-time 10 "http://localhost:$port" >/dev/null 2>&1; then
pass "Port $port accessible"
else
fail "Port $port not accessible"
((failed_ports++))
fi
done
echo ""
echo "===================================="
echo "E2E Test Results: $PASS passed, $FAIL failed"
echo "===================================="
[[ $FAIL -eq 0 ]]
}
test_complete_deployment