fix: resolve flaky holiday hours test and clean up dev scripts

- Use fixed date (Thursday Feb 26, 2026) instead of dynamic tomorrow
  to avoid timezone-related test flakiness
- Remove orphaned SQL fragment from init-script.sql
- Clean up duplicate color code definitions in local-dev-2.sh
- Add Rustfs data wipe and SabreDAV startup to dev script
- Add composer.lock to .gitignore
This commit is contained in:
2026-02-24 23:42:40 +00:00
parent c6fe9e92a7
commit ea1a80dbda
5 changed files with 32 additions and 28 deletions
+15 -11
View File
@@ -14,12 +14,7 @@ C_GREEN=$'\033[32m'
C_RED=$'\033[31m'
C_BLUE=$'\033[34m'
C_YELLOW=$'\033[33m'
# Color codes for output
C_RESET=$'\033[0m'
C_GREEN=$'\033[32m'
C_RED=$'\033[31m'
C_BLUE=$'\033[34m'
C_YELLOW=$'\033[33m'
log_info() { echo "🔹 $1" }
log_success() { echo "$1" }
log_error() { echo "$1" }
@@ -84,6 +79,7 @@ sleep 2
log_step "Seeding test database schema..."
docker exec -i postgres psql -U myuser -d crussell_test < init-scripts/init-script.sql 2>&1 | head -5 || true
log_success "Test database schema seeded"
# --- 3d. Verify test database is ready ---
log_step "Verifying test database readiness..."
MAX_ATTEMPTS=10
@@ -101,12 +97,21 @@ if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
exit 1
fi
# --- 3d. Rustfs (don't wipe data, just restart) ---
log_step "Restarting Rustfs (S3-compatible storage)..."
docker compose restart rustfs > /dev/null 2>&1
log_success "Rustfs restarted"
# --- 3e. Rustfs (wipe data for fresh start) ---
log_step "Wiping Rustfs (S3 storage)..."
docker compose stop rustfs > /dev/null 2>&1 || true
docker compose rm -f rustfs > /dev/null 2>&1 || true
docker volume rm crussell_rustfs_data > /dev/null 2>&1 || true
docker compose up rustfs -d > /dev/null 2>&1
log_success "Rustfs wiped and restarted"
sleep 2
# --- 3f. SabreDAV (start early to create tables) ---
log_step "Starting SabreDAV (CardDAV/CalDAV)..."
docker compose up sabredav -d > /dev/null 2>&1
log_success "SabreDAV started"
sleep 3
# --- 4. Tmux Session Setup ---
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
log_info "Killing existing tmux session..."
@@ -179,7 +184,6 @@ C_YELLOW=$'\033[33m'
# --- Global for ID Capture ---
LAST_BOOKING_ID=""
# --- Helper: API Request ---
# --- Helper: API Request ---
api_post() {
local url="$1"