|
|
3 mesiacov pred | |
|---|---|---|
| .. | ||
| api_tests | 3 mesiacov pred | |
| auto_tests | 3 mesiacov pred | |
| performance_tests | 3 mesiacov pred | |
| unit_tests | 3 mesiacov pred | |
| README.md | 3 mesiacov pred | |
| 提交结构说明.md | 3 mesiacov pred | |
| 测试结果汇总.md | 3 mesiacov pred | |
本目录按课程作业和历史实训提交方式拆分为四类测试单元。每个测试单元均包含测试说明、脚本入口和结果证据,便于分别提交、分别说明测试结果。
tests/
├─ unit_tests/ # 单元测试脚本
├─ api_tests/ # 接口测试脚本
├─ auto_tests/ # 自动化测试脚本与页面截图
└─ performance_tests/ # Locust 性能测试脚本
提交结构说明见:tests/提交结构说明.md
位置:tests/unit_tests
覆盖内容:
运行命令:
cd E:\软测\ServicePilot\tests\unit_tests
powershell -ExecutionPolicy Bypass -File .\run_unit_tests.ps1
结果输出:
tests/unit_tests/reports/unit_test_log.txt
tests/unit_tests/reports/unit_test_summary.txt
位置:tests/api_tests
覆盖内容:
/api/health/api/config/parse运行命令:
cd E:\软测\ServicePilot\tests\api_tests
powershell -ExecutionPolicy Bypass -File .\run_api_tests.ps1
结果输出:
tests/api_tests/reports/api_test_log.txt
tests/api_tests/reports/api_test_summary.txt
位置:tests/auto_tests
覆盖内容:
运行前先启动前端或静态预览:
cd E:\软测\ServicePilot\project\frontend
npm.cmd run build
D:\nodejs\node.exe scripts\static-preview.cjs
再执行:
cd E:\软测\ServicePilot\tests\auto_tests
powershell -ExecutionPolicy Bypass -File .\run_auto_tests.ps1
结果输出:
tests/auto_tests/reports/auto_test_log.txt
tests/auto_tests/reports/auto_test_summary.txt
tests/auto_tests/artifacts/*.png
tests/auto_tests/artifacts/auto-test-result.json
位置:tests/performance_tests
覆盖内容:
需要安装 Locust:
cd E:\软测\ServicePilot\tests\performance_tests
pip install -r requirements.txt
运行后端接口性能测试:
cd E:\软测\ServicePilot\tests\performance_tests
powershell -ExecutionPolicy Bypass -File .\run_backend_performance.ps1
运行前端页面性能测试:
cd E:\软测\ServicePilot\tests\performance_tests
powershell -ExecutionPolicy Bypass -File .\run_frontend_performance.ps1
结果输出:
tests/performance_tests/性能测试报告.md
tests/performance_tests/reports/backend-performance-report.html
tests/performance_tests/reports/backend-performance_*.csv
tests/performance_tests/reports/frontend-performance-report.html
tests/performance_tests/reports/frontend-performance_*.csv
当前环境如未安装 Locust,脚本会生成 reports/*_performance_pending.txt,不伪造性能结果。