prole/tests/test_embedded_resources.sh
chrisfu fff18fdbe4 Update Prole-DB and improve Supabase integration
- Bumped Prole-DB image version to 17.7-053 in scripts, Dockerfile, and manifests.
- Replaced `prole-scan` with `prole-agent` throughout scripts and tests.
- Refined Kubernetes setup for Supabase to use namespace 'supabase'.
- Introduced conversion of Supabase Docker Compose to Kubernetes manifests with `kompose`.
- Added support for Kerberos toggle via environment variables in `init_kerberos.sh`.
- Improved error handling and logging in scripts for better maintainability.
2026-02-01 23:56:25 -08:00

85 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
echo "=== Testing Embedded Resources ==="
echo ""
# Test 1: Images
echo "1. Testing image resources..."
python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
images = [
'img/proleIcon.png',
'img/proleLogo.png',
'img/proleLogoSepia.png',
]
for img in images:
path = get_resource_path(img)
if not path.exists():
print(f'✗ Missing: {img}')
sys.exit(1)
print('✓ All images present')
"
if [ $? -ne 0 ]; then exit 1; fi
# Test 2: Binaries
echo "2. Testing binary resources..."
if [ -f "prole-net/prole-agent" ] && [ -x "prole-net/prole-agent" ]; then
echo " ✓ prole-agent binary present and executable"
else
echo " ✗ prole-agent missing or not executable"
exit 1
fi
# Test 3: App bundle
echo "3. Testing Prole Tools.app bundle..."
if [ -d "prole-app/dist/Prole Tools.app" ]; then
echo " ✓ Prole Tools.app present"
else
echo " ✗ Prole Tools.app missing"
exit 1
fi
# Test 4: Spec file
echo "4. Testing spec file generation..."
python3 scripts/generate_spec.py > /dev/null 2>&1
if [ -f "installer.spec" ]; then
echo " ✓ installer.spec generated"
else
echo " ✗ installer.spec generation failed"
exit 1
fi
# Test 5: Verify spec includes everything
echo "5. Verifying spec includes all resources..."
grep -q "prole-app/dist/Prole Tools.app" installer.spec && \
grep -q "prole-net/prole-agent" installer.spec && \
grep -q "img" installer.spec
if [ $? -eq 0 ]; then
echo " ✓ All resources included in spec"
else
echo " ✗ Some resources missing from spec"
exit 1
fi
# Test 6: Check binary size
echo "6. Checking binary sizes..."
SCAN_SIZE=$(ls -lh prole-net/prole-agent | awk '{print $5}')
echo " prole-agent: $SCAN_SIZE (universal binary)"
APP_SIZE=$(du -sh "prole-app/dist/Prole Tools.app" | awk '{print $1}')
echo " Prole Tools.app: $APP_SIZE"
echo ""
echo "=== All Embedded Resource Tests Passed ==="
echo ""
echo "Resources ready for packaging:"
echo " ✓ Images (proleIcon.png, proleLogo.png, proleLogoSepia.png)"
echo " ✓ Binary (prole-net/prole-agent)"
echo " ✓ App bundle (prole-app/dist/Prole Tools.app)"
echo ""
echo "Build with: make package"