module setup process

This commit is contained in:
uprightbass360
2025-11-17 02:23:53 -05:00
parent ea908dbbcf
commit d3484a3aea
30 changed files with 7685 additions and 430 deletions

View File

@@ -33,7 +33,7 @@ info() {
ok() {
echo -e "${GREEN}${ICON_SUCCESS}${NC} $*"
((TESTS_PASSED++))
((TESTS_PASSED+=1))
}
warn() {
@@ -42,11 +42,11 @@ warn() {
err() {
echo -e "${RED}${ICON_ERROR}${NC} $*"
((TESTS_FAILED++))
((TESTS_FAILED+=1))
}
test_header() {
((TESTS_TOTAL++))
((TESTS_TOTAL+=1))
echo ""
echo -e "${BOLD}${ICON_TEST} Test $TESTS_TOTAL: $*${NC}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -192,7 +192,6 @@ fi
# Test 7: Verify new scripts exist and are executable
test_header "New Script Verification"
scripts=(
"scripts/bash/stage-module-sql.sh"
"scripts/bash/verify-sql-updates.sh"
"scripts/bash/backup-status.sh"
"scripts/bash/db-health-check.sh"
@@ -214,11 +213,17 @@ done
# Test 8: Test backup-status.sh (without running containers)
test_header "Backup Status Script Test"
if ./scripts/bash/backup-status.sh 2>&1 | head -10 | grep -q "BACKUP STATUS"; then
ok "backup-status.sh executes successfully"
backup_status_log="$(mktemp)"
if ./scripts/bash/backup-status.sh >"$backup_status_log" 2>&1; then
if grep -q "BACKUP STATUS" "$backup_status_log"; then
ok "backup-status.sh executes successfully"
else
err "backup-status.sh output missing 'BACKUP STATUS' marker"
fi
else
err "backup-status.sh failed to execute"
fi
rm -f "$backup_status_log"
# Test 9: Test db-health-check.sh help
test_header "Database Health Check Script Test"
@@ -231,11 +236,11 @@ fi
# Test 10: Check modified scripts for new functionality
test_header "Modified Script Verification"
# Check manage-modules.sh has staging function
if grep -q "stage_module_sql_files()" scripts/bash/manage-modules.sh; then
ok "manage-modules.sh contains SQL staging function"
# Check stage-modules.sh has runtime SQL staging function
if grep -q "stage_module_sql_to_core()" scripts/bash/stage-modules.sh; then
ok "stage-modules.sh contains runtime SQL staging function"
else
err "manage-modules.sh missing SQL staging function"
err "stage-modules.sh missing runtime SQL staging function"
fi
# Check db-import-conditional.sh has playerbots support
@@ -251,6 +256,13 @@ else
warn "db-import-conditional.sh may have incorrect EnableDatabases value"
fi
# Check for restore marker safety net
if grep -q "verify_databases_populated" scripts/bash/db-import-conditional.sh; then
ok "db-import-conditional.sh verifies live MySQL state before honoring restore markers"
else
err "db-import-conditional.sh missing restore marker safety check"
fi
# Check for post-restore verification
if grep -q "verify_and_update_restored_databases" scripts/bash/db-import-conditional.sh; then
ok "db-import-conditional.sh has post-restore verification"
@@ -258,7 +270,17 @@ else
err "db-import-conditional.sh missing post-restore verification"
fi
# Test 11: Docker Compose configuration check
# Test 11: Restore + Module Staging Automation
test_header "Restore + Module Staging Automation"
if grep -q "restore-and-stage.sh" docker-compose.yml && \
grep -q ".restore-prestaged" scripts/bash/restore-and-stage.sh && \
grep -q "module-sql-ledger" scripts/bash/restore-and-stage.sh; then
ok "restore-and-stage.sh wired into compose, refreshes ledger snapshot, and flags staging"
else
err "restore-and-stage.sh missing compose wiring or ledger/flag handling"
fi
# Test 12: Docker Compose configuration check
test_header "Docker Compose Configuration Check"
if [ -f docker-compose.yml ]; then
ok "docker-compose.yml exists"