move repos into monorepo
This commit is contained in:
53
bin/supervisor/scripts/test.sh
Executable file
53
bin/supervisor/scripts/test.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
# Spinner function
|
||||
spinner() {
|
||||
local pid=$1
|
||||
local delay=0.1
|
||||
local spinstr='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
|
||||
while ps -p $pid > /dev/null 2>&1; do
|
||||
local temp=${spinstr#?}
|
||||
printf " [%c] " "$spinstr"
|
||||
local spinstr=$temp${spinstr%"$temp"}
|
||||
sleep $delay
|
||||
printf "\b\b\b\b\b\b"
|
||||
done
|
||||
printf " \b\b\b\b"
|
||||
}
|
||||
|
||||
echo "Testing Hero Supervisor Workspace"
|
||||
echo ""
|
||||
|
||||
# Test core and client
|
||||
printf "🧪 Core & Client... "
|
||||
cd "$PROJECT_DIR"
|
||||
if cargo test --workspace > /tmp/supervisor-test-core.log 2>&1 & spinner $!; wait $!; then
|
||||
echo "✅"
|
||||
else
|
||||
echo "❌"
|
||||
echo " Error: Tests failed. Run 'cd $PROJECT_DIR && cargo test --workspace' for details"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test UI
|
||||
printf "🧪 UI (WASM)... "
|
||||
cd "$PROJECT_DIR/ui"
|
||||
|
||||
if ! command -v wasm-pack &> /dev/null; then
|
||||
echo "⚠️ (wasm-pack not installed)"
|
||||
echo " Install with: cargo install wasm-pack"
|
||||
else
|
||||
if wasm-pack test --headless --firefox > /tmp/supervisor-test-ui.log 2>&1 & spinner $!; wait $!; then
|
||||
echo "✅"
|
||||
else
|
||||
echo "❌"
|
||||
echo " Error: Tests failed. Run 'cd $PROJECT_DIR/ui && wasm-pack test --headless --firefox' for details"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ All tests completed"
|
||||
Reference in New Issue
Block a user