Files
Denis Bykhov da88233dda Add 'foundations/net/' from commit '7722c9534141cf92ea7e990b8687c14ef3c747b2'
git-subtree-dir: foundations/net
git-subtree-mainline: 2b0d510202
git-subtree-split: 7722c95341
2025-11-26 22:57:00 +05:00

55 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Test all examples and report results
cd "$(dirname "$0")/examples"
examples=(
"basic:Basic container request-response"
"events:Event broadcasting"
"multi-tenant:Multi-tenant setup"
"production:Complete production setup"
"retry:Error handling and retry"
"timeout:Custom timeout configuration"
"ha:High-availability stateless containers"
)
echo "Testing all examples..."
echo "======================"
echo ""
for entry in "${examples[@]}"; do
IFS=':' read -r name desc <<< "$entry"
echo "Testing: $desc (run:$name)"
echo "---"
# Run with timeout and capture output
output=$(timeout 10 rushx run:$name 2>&1)
exit_code=$?
# Check for success indicators
if echo "$output" | grep -q "✓.*completed successfully"; then
echo "✅ PASS"
elif [ $exit_code -eq 0 ] && echo "$output" | grep -q "✓"; then
echo "✅ PASS"
elif echo "$output" | grep -qE "(TSError|SyntaxError|Error:.*failed)"; then
echo "❌ FAIL - Compilation or runtime error"
echo "$output" | grep -E "(TSError|SyntaxError|Error)" | head -3
elif [ $exit_code -eq 124 ]; then
# Timeout usually means it's running (waiting for cleanup)
if echo "$output" | grep -q "✓"; then
echo "✅ PASS (timed out but ran successfully)"
else
echo "⚠️ TIMEOUT - May need longer runtime"
fi
else
echo "⚠️ UNKNOWN - Exit code: $exit_code"
fi
echo ""
sleep 2
done
echo "======================"
echo "Testing complete!"