#!/bin/bash # # Run All Governance System Tests # ================================ # Runs both Python and Bun/TypeScript test suites # set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" GOVERNANCE_DIR="${SCRIPT_DIR}/.." # Colors RED='\033[0;31m' GREEN='\033[0;32m' BLUE='\033[0;34m' NC='\033[0m' echo "" echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}" echo -e "${BLUE}║ AGENT GOVERNANCE SYSTEM - FULL TEST SUITE ║${NC}" echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}" echo "" # Track results PYTHON_RESULT=0 BUN_RESULT=0 # Run Python tests echo -e "${BLUE}Running Python tests...${NC}" echo "" cd "${SCRIPT_DIR}/governance" python3 test_all.py || PYTHON_RESULT=$? echo "" # Run Bun tests echo -e "${BLUE}Running Bun/TypeScript tests...${NC}" echo "" cd "${SCRIPT_DIR}/governance" bun run test_all.ts || BUN_RESULT=$? # Summary echo "" echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}" echo -e "${BLUE}║ FINAL RESULTS ║${NC}" echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}" echo "" if [ $PYTHON_RESULT -eq 0 ]; then echo -e " Python Tests: ${GREEN}PASSED${NC}" else echo -e " Python Tests: ${RED}FAILED${NC}" fi if [ $BUN_RESULT -eq 0 ]; then echo -e " Bun/TS Tests: ${GREEN}PASSED${NC}" else echo -e " Bun/TS Tests: ${RED}FAILED${NC}" fi echo "" if [ $PYTHON_RESULT -eq 0 ] && [ $BUN_RESULT -eq 0 ]; then echo -e "${GREEN}All test suites passed!${NC}" exit 0 else echo -e "${RED}Some test suites failed!${NC}" exit 1 fi