1
0

chore: streamline workspace make workflows

Clarify product-level server and desktop commands while moving backend-only maintenance tasks into backend/Makefile. This keeps root automation focused on core flows and aligns the main OpenSpec specs with the new command boundaries.
This commit is contained in:
2026-04-28 17:44:23 +08:00
parent a9972360c2
commit 2c401f7ae6
8 changed files with 411 additions and 266 deletions

View File

@@ -157,26 +157,33 @@
### Requirement: 集成到构建流程
测试 SHALL 集成到构建流程中。
测试 SHALL 同时集成到根目录公共流程和 backend 局部流程中。
#### Scenario: 运行测试命令
- **WHEN** 执行 `make test` 命令
- **THEN** SHALL 运行所有单元测试和集成测试
- **THEN** SHALL 运行 backend 核心测试、frontend 的 Vitest 单元/组件测试和 desktop 专属测试
- **THEN** SHALL NOT 运行 MySQL 专项测试和 frontend E2E 测试
- **THEN** SHALL 显示测试结果
- **THEN** SHALL 在测试失败时返回非零退出码
#### Scenario: 运行 backend 局部测试命令
- **WHEN** 在 `backend/` 目录执行 `make test` 命令
- **THEN** SHALL 运行 backend 核心测试
- **THEN** SHALL NOT 运行 frontend 的 Vitest 单元/组件测试、desktop 专属测试、MySQL 专项测试或 frontend E2E 测试
#### Scenario: 分类测试命令
- **WHEN** 执行 `make test-unit` 命令
- **WHEN** `backend/` 目录执行 `make test-unit` 命令
- **THEN** SHALL 仅运行 `./internal/...``./pkg/...` 下的单元测试
- **WHEN** 执行 `make test-integration` 命令
- **WHEN** `backend/` 目录执行 `make test-integration` 命令
- **THEN** SHALL 仅运行 `./tests/...` 下的集成测试
#### Scenario: 覆盖率检查命令
- **WHEN** 执行 `make test-coverage` 命令
- **WHEN** `backend/` 目录执行 `make test-coverage` 命令
- **THEN** SHALL 运行测试并生成覆盖率报告
- **THEN** SHALL 检查覆盖率是否达标
- **THEN** SHALL 在覆盖率不足时返回非零退出码