Commit 4d58768c6e56f1dc1c5c8015d29e87c8d960c23f
1 parent
94c341f2
chore(module_usr): add local test-gate evidence
scripts/test.sh 从 ./mvnw 改为系统 mvn(与 docs/07 一致;backend 未带 maven wrapper)。test.sh 6 个 stage 全绿,201/0。
Showing
2 changed files
with
39 additions
and
3 deletions
docs/superpowers/module-reports/module_usr-test-gate.md
0 → 100644
| 1 | +## Local test gate — module_usr | ||
| 2 | + | ||
| 3 | +执行时间: 2026-05-15T10:33:28+08:00 | ||
| 4 | + | ||
| 5 | +### scripts/test.sh (subagent) | ||
| 6 | +- 子会话: a9aa7d814ffd7dd13 | ||
| 7 | +- 命令: `cd /Users/reporkey/Desktop/test5 && set -a && . ./.env.local && set +a && ./scripts/test.sh` | ||
| 8 | +- 退出码: 0 | ||
| 9 | +- 通过: 201 / 失败: 0 | ||
| 10 | +- 关键 stdout (≤30 行): | ||
| 11 | + | ||
| 12 | +``` | ||
| 13 | +[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.746 s -- in com.xly.erp.common.exception.GlobalExceptionHandlerTest | ||
| 14 | +[INFO] | ||
| 15 | +[INFO] Results: | ||
| 16 | +[INFO] | ||
| 17 | +[INFO] Tests run: 201, Failures: 0, Errors: 0, Skipped: 0 | ||
| 18 | +[INFO] | ||
| 19 | +[INFO] ------------------------------------------------------------------------ | ||
| 20 | +[INFO] BUILD SUCCESS | ||
| 21 | +[INFO] ------------------------------------------------------------------------ | ||
| 22 | +[INFO] Total time: 02:32 min | ||
| 23 | +[INFO] Finished at: 2026-05-15T10:33:28+08:00 | ||
| 24 | +[test.sh] skip frontend test | ||
| 25 | +[test.sh] 5/6 E2E | ||
| 26 | +[test.sh] e2e 略 (no frontend) | ||
| 27 | +[test.sh] 6/6 reset test db | ||
| 28 | +[setup-test-db] done — schema will be applied by Flyway when Spring Boot starts | ||
| 29 | +[test.sh] GREEN | ||
| 30 | +``` | ||
| 31 | + | ||
| 32 | +### 备注 | ||
| 33 | + | ||
| 34 | +首次运行 test-gate 时 `scripts/test.sh` 在 stage 2/6 build 失败,因为脚本调用 `./mvnw` 而 backend 没有 Maven Wrapper。修复:把 `./mvnw` 全部替换为系统 `mvn`(与 docs/07 § 一 声明的 Maven 3.9.x 依赖一致)。修后 6 个 stage 全部 GREEN。 | ||
| 35 | + | ||
| 36 | +结论: green |
scripts/test.sh
| @@ -20,15 +20,15 @@ echo "[test.sh] 1/6 setup test db" | @@ -20,15 +20,15 @@ echo "[test.sh] 1/6 setup test db" | ||
| 20 | ./scripts/setup-test-db.sh | 20 | ./scripts/setup-test-db.sh |
| 21 | 21 | ||
| 22 | echo "[test.sh] 2/6 build" | 22 | echo "[test.sh] 2/6 build" |
| 23 | -if [ $HAS_BACKEND -eq 1 ]; then (cd backend && ./mvnw -B -DskipTests clean package); else echo "[test.sh] skip backend build"; fi | 23 | +if [ $HAS_BACKEND -eq 1 ]; then (cd backend && mvn -B -DskipTests clean package); else echo "[test.sh] skip backend build"; fi |
| 24 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm ci && npm run build); else echo "[test.sh] skip frontend build"; fi | 24 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm ci && npm run build); else echo "[test.sh] skip frontend build"; fi |
| 25 | 25 | ||
| 26 | echo "[test.sh] 3/6 lint" | 26 | echo "[test.sh] 3/6 lint" |
| 27 | -if [ $HAS_BACKEND -eq 1 ]; then (cd backend && ./mvnw -B -q checkstyle:check || ./mvnw -B -q spotless:check || echo "[test.sh] backend lint skipped (no plugin configured)"); else echo "[test.sh] skip backend lint"; fi | 27 | +if [ $HAS_BACKEND -eq 1 ]; then (cd backend && mvn -B -q checkstyle:check || mvn -B -q spotless:check || echo "[test.sh] backend lint skipped (no plugin configured)"); else echo "[test.sh] skip backend lint"; fi |
| 28 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm run lint); else echo "[test.sh] skip frontend lint"; fi | 28 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm run lint); else echo "[test.sh] skip frontend lint"; fi |
| 29 | 29 | ||
| 30 | echo "[test.sh] 4/6 unit + integration" | 30 | echo "[test.sh] 4/6 unit + integration" |
| 31 | -if [ $HAS_BACKEND -eq 1 ]; then (cd backend && ./mvnw -B test); else echo "[test.sh] skip backend test"; fi | 31 | +if [ $HAS_BACKEND -eq 1 ]; then (cd backend && mvn -B test); else echo "[test.sh] skip backend test"; fi |
| 32 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm run test -- --run); else echo "[test.sh] skip frontend test"; fi | 32 | if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm run test -- --run); else echo "[test.sh] skip frontend test"; fi |
| 33 | 33 | ||
| 34 | echo "[test.sh] 5/6 E2E" | 34 | echo "[test.sh] 5/6 E2E" |