WuYongJie 5821d73291 初始提交:3D家具安装展示系统
包含:
- furniture-3d-system:Next.js 16 全栈应用(资产中心、产品管理、3D装配动画)
- autocad-plugin:AutoCAD 家具导出插件源码
- 资产中心改造:编辑弹窗化、删除功能、Toast反馈、自定义Select组件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 14:00:19 +08:00

82 lines
2.6 KiB
PowerShell

# ============================================
# 数据库备份测试脚本 (PowerShell)
# ============================================
$ErrorActionPreference = "Stop"
Write-Host "========================================"
Write-Host " 测试数据库备份功能"
Write-Host "========================================"
Write-Host ""
# 测试目录
$TestBackupDir = ".\backups\test"
# 清理测试目录
if (Test-Path $TestBackupDir) {
Write-Host "清理旧的测试目录..."
Remove-Item -Path $TestBackupDir -Recurse -Force
}
# 执行备份
Write-Host "执行备份测试..."
& .\scripts\backup-db.ps1 -BackupDir $TestBackupDir
# 验证结果
Write-Host ""
Write-Host "========================================"
Write-Host " 验证测试结果"
Write-Host "========================================"
Write-Host ""
# 检查备份文件
$backupFiles = Get-ChildItem -Path $TestBackupDir -Filter "db-backup-*.sql.gz" -ErrorAction SilentlyContinue
if ($backupFiles.Count -eq 1) {
Write-Host "✅ 备份文件已创建" -ForegroundColor Green
} else {
Write-Host "❌ 备份文件创建失败" -ForegroundColor Red
exit 1
}
# 检查 checksum 文件
$checksumFiles = Get-ChildItem -Path $TestBackupDir -Filter "db-backup-*.sql.gz.sha256" -ErrorAction SilentlyContinue
if ($checksumFiles.Count -eq 1) {
Write-Host "✅ Checksum 文件已创建" -ForegroundColor Green
} else {
Write-Host "❌ Checksum 文件创建失败" -ForegroundColor Red
exit 1
}
# 检查摘要文件
$summaryFiles = Get-ChildItem -Path $TestBackupDir -Filter "backup-summary-*.json" -ErrorAction SilentlyContinue
if ($summaryFiles.Count -eq 1) {
Write-Host "✅ 摘要文件已创建" -ForegroundColor Green
} else {
Write-Host "❌ 摘要文件创建失败" -ForegroundColor Red
exit 1
}
# 检查日志文件
$logFiles = Get-ChildItem -Path $TestBackupDir -Filter "backup-db-*.log" -ErrorAction SilentlyContinue
if ($logFiles.Count -eq 1) {
Write-Host "✅ 日志文件已创建" -ForegroundColor Green
} else {
Write-Host "❌ 日志文件创建失败" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "========================================"
Write-Host " 🎉 所有测试通过!" -ForegroundColor Green
Write-Host "========================================"
Write-Host ""
# 显示备份文件信息
Write-Host "备份文件列表:"
Get-ChildItem -Path $TestBackupDir -Filter "db-backup-*.sql.gz" | Format-Table Name, Length, LastWriteTime
Write-Host ""
Write-Host "提示:测试完成后可以删除测试目录:"
Write-Host " Remove-Item -Path $TestBackupDir -Recurse -Force"
Write-Host ""