| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| set -e |
|
|
| PASS=0; FAIL=0; TOTAL=0 |
|
|
| run_test() { |
| local name="$1"; local cmd="$2" |
| echo "" |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| echo " Running: $name" |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| if eval "$cmd"; then |
| echo " β
$name PASSED"; PASS=$((PASS+1)) |
| else |
| echo " β $name FAILED"; FAIL=$((FAIL+1)) |
| fi |
| TOTAL=$((TOTAL+1)) |
| } |
|
|
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| echo "β purpose-agent v3.0.0 β Full Test Suite (Local + Cloud)β" |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
|
|
| |
| echo "βββ Pre-flight βββ" |
| python -c " |
| import purpose_agent as pa |
| print(f' v{pa.__version__} β {len(pa.__all__)} exports') |
| assert pa.__version__ == '3.0.0', f'Version: {pa.__version__}' |
| assert len(pa.__all__) >= 110, f'Exports: {len(pa.__all__)}' |
| missing = [n for n in pa.__all__ if not hasattr(pa, n)] |
| assert not missing, f'Missing: {missing}' |
| print(' β
All exports importable') |
| " |
|
|
| |
| echo "" |
| echo "βββ Applying test fixes βββ" |
| python apply_fixes.py |
|
|
| |
| run_test "test_core" "python tests/test_core.py" |
| run_test "test_public_api_211" "python tests/compat/test_public_api_211.py" |
| run_test "test_first_principles" "python tests/test_first_principles.py" |
| run_test "test_hardening" "python tests/test_hardening.py" |
| run_test "test_sre_regression" "python tests/test_sre_regression.py" |
|
|
| |
| run_test "test_sprint1_events" "python tests/test_sprint1_events.py" |
| run_test "test_sprint2_checkpoint" "python tests/test_sprint2_checkpoint.py" |
| run_test "test_sprint3_homeostasis" "python tests/test_sprint3_homeostasis.py" |
| run_test "test_sprint4_8_protocols" "python tests/test_sprint4_8_protocols.py" |
| run_test "test_track_c" "python tests/test_track_c.py" |
| run_test "test_track_d" "python tests/test_track_d.py" |
|
|
| |
| run_test "validate_quick" "python benchmarks/validate.py --quick" |
| run_test "benchmark_v3" "python -m purpose_agent.benchmark_v3" |
|
|
| |
| if [ -n "$OPENROUTER_API_KEY" ]; then |
| run_test "prod_test (real model)" "python tests/prod_test.py" |
| else |
| echo " β οΈ OPENROUTER_API_KEY not set β skipping cloud tests" |
| fi |
|
|
| |
| echo "" |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| echo "β RESULTS: $PASS/$TOTAL passed, $FAIL failed" |
| if [ $FAIL -eq 0 ]; then |
| echo "β β
ALL TESTS PASSED β READY TO PUBLISH" |
| echo "β Next: python build_and_publish.py" |
| else |
| echo "β β $FAIL FAILURES β FIX BEFORE PUBLISHING" |
| fi |
| echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" |
| exit $FAIL |
|
|