prole/tests/final_test.sh
chrisfu 4ee2b259c9 Checkpoint: rename installer to knoe + harden db build context
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks)

- Update UI and core actions to use ~/.prole/build and shared copy helper

- Add/adjust tests and scripts; introduce knoe ops helpers and update manifests

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 01:45:21 -07:00

135 lines
3.9 KiB
Bash
Executable File

#!/bin/bash
echo "=============================================="
echo " FINAL COMPREHENSIVE TEST"
echo " Prole Database Installer"
echo "=============================================="
echo ""
TESTS_PASSED=0
TESTS_TOTAL=0
test_item() {
TESTS_TOTAL=$((TESTS_TOTAL + 1))
echo -n "[$TESTS_TOTAL] $1... "
shift
if "$@" > /dev/null 2>&1; then
echo "✓"
TESTS_PASSED=$((TESTS_PASSED + 1))
return 0
else
echo "✗"
return 1
fi
}
# Core Features
echo "CORE FEATURES"
test_item "Install.py imports" python3 -c "from install import ProleController, get_resource_path"
test_item "Ncurses interface" python3 -c "from knoe.ncurses_installer import run_ncurses_installer"
test_item "Display auto-detection" python3 -c "from install import has_display"
test_item "CLI arguments" python3 install.py --help
# Build System
echo ""
echo "BUILD SYSTEM"
test_item "Makefile" make help
test_item "Spec generator" python3 scripts/generate_spec.py
test_item "Icon conversion" make build/prole.icns
# Image Resources
echo ""
echo "IMAGE RESOURCES"
test_item "proleIcon.png" test -f img/proleIcon.png
test_item "proleLogo.png" test -f img/proleLogo.png
test_item "proleLogoSepia.png" test -f img/proleLogoSepia.png
# Binary Resources
echo ""
echo "BINARY RESOURCES"
test_item "prole-agent exists" test -f prole-net/prole-agent
test_item "prole-agent executable" test -x prole-net/prole-agent
# App Bundle
echo ""
echo "APP BUNDLE"
test_item "Prole Tools.app exists" test -d "prole-app/dist/Prole Tools.app"
# Docker Build Context
echo ""
echo "DOCKER BUILD CONTEXT"
test_item "prole-db directory" test -d prole-db
test_item "Dockerfile exists" test -f prole-db/Dockerfile
# Spec Verification
echo ""
echo "SPEC FILE VERIFICATION"
python3 scripts/generate_spec.py > /dev/null 2>&1
test_item "Spec includes img" grep -q "img" installer.spec
test_item "Spec includes prole-db" grep -q "prole-db" installer.spec
test_item "Spec includes prole-agent" grep -q "prole-agent" installer.spec
test_item "Spec includes Prole Tools" grep -q "Prole Tools" installer.spec
# Resource Path Tests
echo ""
echo "RESOURCE PATH RESOLUTION"
test_item "Image paths work" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('img/proleIcon.png').exists()
"
test_item "Binary paths work" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('prole-net/prole-agent').exists()
"
test_item "Docker context works" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('prole-db').exists()
"
# Summary
echo ""
echo "=============================================="
echo " RESULTS: $TESTS_PASSED/$TESTS_TOTAL PASSED"
echo "=============================================="
echo ""
if [ $TESTS_PASSED -eq $TESTS_TOTAL ]; then
echo "✓✓✓ ALL TESTS PASSED ✓✓✓"
echo ""
echo "READY TO BUILD:"
echo " make package"
echo ""
echo "FEATURES IMPLEMENTED:"
echo " ✓ Ncurses terminal interface"
echo " ✓ Automatic display detection"
echo " ✓ Static universal binary build system"
echo " ✓ Image resources embedded"
echo " ✓ prole-agent binary embedded"
echo " ✓ Prole Tools.app embedded"
echo " ✓ Docker build context embedded"
echo " ✓ Docker build uses ~/.prole/build (writable)"
echo ""
echo "PACKAGE WILL INCLUDE:"
echo " • Images (~11 MB)"
echo " • prole-agent (6.8 MB)"
echo " • Prole Tools.app (~12 MB)"
echo " • prole-db build context (~1-5 MB)"
echo " • Python runtime + deps (~30-50 MB)"
echo " • Total: ~50-100 MB"
echo ""
exit 0
else
echo "✗ SOME TESTS FAILED"
echo "Fix issues before building package"
exit 1
fi