test(ci): add Windows workflow and extended tests stage4-5; stabilize dashboard service tests

feat/windows-service-status-auto
haoliang 4 days ago
parent d69817bf45
commit 0212ed6afc

@ -0,0 +1,34 @@
name: CI-Windows-WindowsServiceStatus
on:
push:
branches: [ main, feat/windows-service-status-auto ]
pull_request:
branches: [ main, feat/windows-service-status-auto ]
jobs:
build-test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
distribution: "windows-hosted"
sdk: [5.0.x, 6.0.x]
- name: Restore NuGet packages
run: dotnet restore
- name: Build backend
run: dotnet build -c Release
- name: Run backend tests (Windows service tests)
run: dotnet test tests/CncService.Tests/CncService.Tests.csproj -c Release -v minimal --filter "FullyQualifiedName~WindowsServiceCheckerTests|DashboardServiceTests"
- name: Build frontend (optional, if frontend changes)
run: |
cd frontend
npm ci
npm run build
- name: Run frontend tests (optional)
if: always()
run: |
echo "Frontend test steps would run here (optional)"

@ -0,0 +1,29 @@
## Phase 4 Plan: 前端适配与端到端测试草案
- 目标
- 前端能正确展示后端新增的 serviceStatus 字段,并据此给出友好提示
- 未安装时,启动按钮触发安装引导,显示 install.ps1 路径
- 启动失败/异常时,显示服务返回的 serviceMessage 以及排查建议
- 变更范围
- 前端DashboardPage.vue、类型定义、相关 UI 文案
- 后端已完成阶段3前端将调用 /api/admin/collector/status 实时获取状态
- 测试:新增前端端到端测试用例草案
- 任务清单
1) 前端界面完善
- 确保 serviceStatusLabel 的文本与图标覆盖 NotInstalled、Stopped、Running、Starting、StartFailed
- 在 NotInstalled 场景下,点击启动显示安装引导
- 显示 serviceMessage若返回作为错误提示的一部分
2) 新字段的类型检查与绑定
- 确认 CollectorStatus 类型字段包含 serviceStatus、serviceName、uptimeSeconds、lastCollectTime、serviceMessage
3) 集成测试草案
- 场景覆盖 NotInstalled、Running、Starting、StartFailed、Stopped
4) 回归与文档
- 更新用户手册和计划文档
- 验收标准
- UI 正确显示 serviceStatus 的中文文本与图标
- NotInstalled 时展示安装引导信息并提供 install.ps1 路径
- 启动失败时能展示 API 返回的 serviceMessage
- 端到端测试覆盖率达到 80% 以上
Loading…
Cancel
Save