OpenWriterControle/scripts/test.sh
darrenhinde d7e1aa7f19 feat: add monorepo structure with versioning and CI/CD
Monorepo Features:
- Root package.json with convenient npm scripts for all agents
- Easy testing from root: npm test, npm run test:openagent, npm run test:opencoder
- Multi-model support: test with Grok, Claude, or GPT-4
- Quick dashboard access: npm run dashboard
- No folder navigation required

Versioning System:
- VERSION file tracking current version (0.1.0-alpha.1)
- CHANGELOG.md with comprehensive version history
- Version bump scripts for alpha, beta, rc, and stable releases
- Semantic versioning with progression: Alpha → Beta → RC → Stable

CI/CD:
- GitHub Actions workflow for automated testing
- Pre-merge validation for agent changes
- Smoke tests for both openagent and opencoder
- Automated test result reporting
- Runs on PRs to main/dev and pushes to main

Helper Scripts:
- scripts/test.sh: Advanced test runner with multi-agent support
- scripts/dashboard.sh: Enhanced dashboard launcher with auto-open
- scripts/bump-version.sh: Version management tool

Documentation:
- QUICK_START.md: Comprehensive testing and usage guide
- Clear examples for all test scenarios
- Multi-agent and multi-model workflows

Benefits:
- Easy testing from root directory
- Automated quality checks before merges
- Clear version tracking and history
- Developer-friendly workflows
- No breaking changes to existing structure
2025-11-26 22:06:36 +00:00

60 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# Advanced test runner with multi-agent support
# Usage: ./scripts/test.sh [agent] [model] [options]
set -e
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Defaults
AGENT=${1:-all}
MODEL=${2:-opencode/grok-code-fast}
shift 2 2>/dev/null || true
EXTRA_ARGS="$@"
echo -e "${BLUE}🧪 OpenCode Agents Test Runner${NC}"
echo -e "${BLUE}================================${NC}"
echo ""
echo -e "Agent: ${GREEN}${AGENT}${NC}"
echo -e "Model: ${GREEN}${MODEL}${NC}"
if [ -n "$EXTRA_ARGS" ]; then
echo -e "Extra: ${YELLOW}${EXTRA_ARGS}${NC}"
fi
echo ""
# Navigate to framework directory
cd "$(dirname "$0")/../evals/framework" || exit 1
# Check if dependencies are installed
if [ ! -d "node_modules" ]; then
echo -e "${YELLOW}⚠️ Dependencies not installed. Running npm install...${NC}"
npm install
echo ""
fi
# Run tests
if [ "$AGENT" = "all" ]; then
echo -e "${YELLOW}Running tests for ALL agents...${NC}"
npm run eval:sdk -- --model="$MODEL" $EXTRA_ARGS
else
echo -e "${YELLOW}Running tests for ${AGENT}...${NC}"
npm run eval:sdk -- --agent="$AGENT" --model="$MODEL" $EXTRA_ARGS
fi
EXIT_CODE=$?
echo ""
if [ $EXIT_CODE -eq 0 ]; then
echo -e "${GREEN}✅ Tests complete!${NC}"
else
echo -e "${RED}❌ Tests failed with exit code ${EXIT_CODE}${NC}"
fi
echo -e "${BLUE}View results: npm run dashboard${NC}"
echo ""
exit $EXIT_CODE