feat: 添加性能和安全测试,完善部署文档

阶段五:性能和安全测试
- 创建负载测试脚本:模拟正常用户访问模式
- 创建压力测试脚本:测试系统极限性能
- 创建SQL注入测试脚本:验证SQL注入防护
- 创建XSS防护测试脚本:验证XSS防护
- 添加测试脚本到package.json

阶段六:文档和培训
- 更新README.md:添加监控和告警文档
- 添加性能测试文档和命令
- 添加安全测试文档和命令
- 添加Docker部署文档
- 添加生产环境配置文档
- 添加备份和恢复文档
This commit is contained in:
张翔
2026-03-09 11:12:26 +08:00
parent 4897c6e11c
commit 261c45b4d9
7 changed files with 603 additions and 2 deletions
+6
View File
@@ -13,6 +13,11 @@
"test:e2e": "cd e2e && npm test",
"test:smoke": "playwright test --grep @smoke",
"test:report": "allure generate test-results/allure-results && allure open",
"test:performance": "k6 run tests/performance/load-test.js",
"test:stress": "k6 run tests/performance/stress-test.js",
"test:security": "k6 run tests/security/sql-injection-test.js && k6 run tests/security/xss-test.js",
"test:sql-injection": "k6 run tests/security/sql-injection-test.js",
"test:xss": "k6 run tests/security/xss-test.js",
"check:contrast": "tsx scripts/check-color-contrast.ts",
"check:headings": "tsx scripts/check-heading-hierarchy.ts",
"audit:performance": "node scripts/performance-audit.js",
@@ -72,6 +77,7 @@
"drizzle-kit": "^0.31.9",
"eslint": "^10.0.2",
"eslint-config-next": "^0.2.4",
"k6": "^0.0.0",
"lighthouse": "^13.0.3",
"tailwindcss": "^4",
"tsx": "^4.21.0",