Files
ars-backend/script/run-tests-seed.sh
ROOG e956df9daa main: 增强工具功能与消息处理
- 添加 `FileReadTool`,支持文件内容读取与安全验证
- 引入 `hasToolMessages` 逻辑,优化工具历史上下文处理
- 修改工具选项逻辑,支持禁用工具时的动态调整
- 增加消息序列化逻辑,优化 Redis 序列管理与数据同步
- 扩展测试覆盖,验证序列化与工具调用场景
- 增强 Docker Compose 脚本,支持应用重置与日志清理
- 调整工具调用超时设置,提升运行时用户体验
2025-12-24 00:55:54 +08:00

68 lines
1.3 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 定义颜色
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# 打印带颜色的信息
print_info() {
echo -e "${BLUE} $1${NC}"
}
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
print_error() {
echo -e "${RED}$1${NC}"
}
# 打印分割线
print_separator() {
echo -e "${BLUE}────────────────────────────────────${NC}"
}
# 主流程
print_separator
print_info "Docker Compose 测试与数据库填充脚本"
print_separator
echo ""
# Step 1: 运行测试
print_info "Step 1/2: 运行 PHPUnit 测试..."
echo ""
if docker compose exec -T app php artisan test; then
echo ""
print_success "测试通过"
else
echo ""
print_error "测试失败"
exit 1
fi
echo ""
# Step 2: 数据库填充
print_info "Step 2/2: 执行数据库填充..."
echo ""
if docker compose exec -T app php artisan db:seed; then
echo ""
print_success "数据库填充完成"
else
echo ""
print_error "数据库填充失败"
exit 1
fi
echo ""
# 完成
print_separator
print_success "🎉 测试和数据库填充全部完成!"
print_separator