Files
aurorabot/shared/scripts/test-isolated.sh
syntaxbullet 25a0bd3431
Some checks failed
Deploy to Production / test (push) Failing after 29s
Sign panel sessions and isolate test runs
- Replace in-memory auth sessions with signed cookies and signed OAuth state
- Add auth route coverage and update panel/web server wiring
- Switch test script to per-file Bun processes and clean up type checks
2026-04-09 21:44:05 +02:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
INCLUDE_INTEGRATION=false
if [[ "${1:-}" == "--integration" ]]; then
INCLUDE_INTEGRATION=true
fi
JOBS="${AURORA_TEST_JOBS:-4}"
echo "🔍 Finding test files..."
if [ "$INCLUDE_INTEGRATION" = true ]; then
FIND_ARGS=( -name "*.test.ts" )
else
FIND_ARGS=( -name "*.test.ts" -not -name "*.integration.test.ts" )
fi
TEST_FILES=()
while IFS= read -r file; do
TEST_FILES+=("$file")
done < <(find . "${FIND_ARGS[@]}" -not -path "*/node_modules/*" | sort)
if [ "${#TEST_FILES[@]}" -eq 0 ]; then
echo "⚠️ No test files found!"
exit 0
fi
echo "🧪 Running ${#TEST_FILES[@]} test files with isolated Bun processes..."
echo " Workers: $JOBS"
if [ "$INCLUDE_INTEGRATION" = true ]; then
echo " (including integration tests)"
fi
if printf '%s\n' "${TEST_FILES[@]}" | xargs -n1 -P "$JOBS" bash -lc 'echo "---------------------------------------------------"; echo "running: $1"; bun test "$1"' _; then
echo "---------------------------------------------------"
echo "✅ All tests passed!"
exit 0
fi
echo "---------------------------------------------------"
echo "❌ Some tests failed."
exit 1