|
@@ -37,11 +37,19 @@ export PATH=/bwydata/maven/bin:$PATH
|
|
|
|---|---|---|
|
|
|---|---|---|
|
|
|
| 编译 | `mvn clean compile -DskipTests` | 主代码必须 0 错误 |
|
|
| 编译 | `mvn clean compile -DskipTests` | 主代码必须 0 错误 |
|
|
|
| 测试编译 | `mvn test-compile` | 必须 exit 0 |
|
|
| 测试编译 | `mvn test-compile` | 必须 exit 0 |
|
|
|
-| 新增单测 | `mvn test -Dtest=<新增用例>` | 纯 Mockito,不碰 DB,可稳定通过 |
|
|
|
|
|
|
|
+| 新增单测 | `mvn test -DskipTests=false -Dtest=<新增用例>` | 纯 Mockito,不碰 DB,可稳定通过 |
|
|
|
| 前端 | `vue-check.js`(见下) | 真实 SFC 解析 + 模板编译 + script 语法检查 |
|
|
| 前端 | `vue-check.js`(见下) | 真实 SFC 解析 + 模板编译 + script 语法检查 |
|
|
|
|
|
|
|
|
**禁止**把 `mvn test` 全量 `BUILD SUCCESS` 当作验收标准。
|
|
**禁止**把 `mvn test` 全量 `BUILD SUCCESS` 当作验收标准。
|
|
|
|
|
|
|
|
|
|
+> ⚠️ **`-DskipTests=false` 不可省略(本计划实测踩坑)**
|
|
|
|
|
+>
|
|
|
|
|
+> `pom.xml:28` 定义了 `<skipTests>true</skipTests>`,且 surefire 在 `pom.xml:220` 以 `<skipTests>${skipTests}</skipTests>` 消费它。
|
|
|
|
|
+> 因此 **`mvn test` 默认根本不跑测试**,输出 `BUILD SUCCESS` + `[INFO] Tests are skipped.` + 不生成 `target/surefire-reports/`。
|
|
|
|
|
+> 这是「静默假通过」陷阱:不加开关时,单测即使全红也会报 BUILD SUCCESS。
|
|
|
|
|
+> 每次跑单测必须显式 `-DskipTests=false`,并确认输出含 `Tests run: N, Failures: 0, Errors: 0`。
|
|
|
|
|
+> 注意 `mvn test-compile` **不受**该开关影响(编译测试代码始终执行),故任务 0 的验证命令无需加开关。
|
|
|
|
|
+
|
|
|
### 前端验证脚本
|
|
### 前端验证脚本
|
|
|
|
|
|
|
|
`node --check` **无法解析 `.vue`**(`ERR_UNKNOWN_FILE_EXTENSION`),不可用作校验手段。本计划改用 `vue-template-compiler`(已在 `cfc-frontend/node_modules`)真实解析 SFC。
|
|
`node --check` **无法解析 `.vue`**(`ERR_UNKNOWN_FILE_EXTENSION`),不可用作校验手段。本计划改用 `vue-template-compiler`(已在 `cfc-frontend/node_modules`)真实解析 SFC。
|
|
@@ -370,7 +378,7 @@ class GuideFamilyAccessGuardTest {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyAccessGuardTest 2>&1 | grep -E "cannot find symbol|Tests run:|BUILD" | head -5
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyAccessGuardTest 2>&1 | grep -E "cannot find symbol|Tests run:|BUILD" | head -5
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`cannot find symbol: class GuideFamilyAccessGuard`。
|
|
预期:`cannot find symbol: class GuideFamilyAccessGuard`。
|
|
@@ -437,7 +445,7 @@ public class GuideFamilyAccessGuard {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyAccessGuardTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyAccessGuardTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 9, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 9, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -557,7 +565,7 @@ class GuideFamilyServiceBindTest {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyServiceBindTest 2>&1 | grep -E "重绑时应复活status|Tests run:|expected" | head -6
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyServiceBindTest 2>&1 | grep -E "重绑时应复活status|Tests run:|expected" | head -6
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`重绑时应复活status为binding` FAIL,实际 `"cancelled"` != `"binding"`。
|
|
预期:`重绑时应复活status为binding` FAIL,实际 `"cancelled"` != `"binding"`。
|
|
@@ -596,7 +604,7 @@ cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyServiceBindTest 2>&1 |
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyServiceBindTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyServiceBindTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 3, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 3, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -868,7 +876,7 @@ class HealthPlanReviewGuardTest {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "已发布方案不可再次驳回|cannot find symbol|Tests run:" | head -5
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "已发布方案不可再次驳回|cannot find symbol|Tests run:" | head -5
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`cannot find symbol: method getPlanForFamily`,且已发布方案驳回用例 FAIL。
|
|
预期:`cannot find symbol: method getPlanForFamily`,且已发布方案驳回用例 FAIL。
|
|
@@ -921,7 +929,7 @@ cd /sc-data/cfc/cfc-backend && mvn test -Dtest=HealthPlanReviewGuardTest 2>&1 |
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "Tests run:|BUILD" | head -3
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 8, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 8, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -1024,7 +1032,7 @@ public class PlanApproveResultDTO {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "cannot find symbol|incompatible types|Tests run:" | head -5
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "cannot find symbol|incompatible types|Tests run:" | head -5
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`cannot find symbol: class PlanApproveResultDTO`。
|
|
预期:`cannot find symbol: class PlanApproveResultDTO`。
|
|
@@ -1117,7 +1125,7 @@ import 区新增 `com.etotem.cfc.dto.PlanApproveResultDTO`。
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -8
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=HealthPlanReviewGuardTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -8
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 10, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 10, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -1271,7 +1279,7 @@ class GuidePlanReviewControllerAuthTest {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuidePlanReviewControllerAuthTest 2>&1 | grep -E "cannot find symbol|Tests run:" | head -4
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuidePlanReviewControllerAuthTest 2>&1 | grep -E "cannot find symbol|Tests run:" | head -4
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`cannot find symbol: class GuidePlanReviewController`。
|
|
预期:`cannot find symbol: class GuidePlanReviewController`。
|
|
@@ -1395,7 +1403,7 @@ public class GuidePlanReviewController {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuidePlanReviewControllerAuthTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -8
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuidePlanReviewControllerAuthTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -8
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 6, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 6, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -1648,7 +1656,7 @@ class GuideFamilyQueryServiceTest {
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyQueryServiceTest 2>&1 | grep -E "cannot find symbol|Tests run:" | head -4
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyQueryServiceTest 2>&1 | grep -E "cannot find symbol|Tests run:" | head -4
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`cannot find symbol: class GuideFamilyQueryService`。
|
|
预期:`cannot find symbol: class GuideFamilyQueryService`。
|
|
@@ -1657,7 +1665,7 @@ cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyQueryServiceTest 2>&1
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest=GuideFamilyQueryServiceTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -6
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest=GuideFamilyQueryServiceTest 2>&1 | grep -E "Tests run:|BUILD|ERROR.*\.java" | head -6
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:`Tests run: 4, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:`Tests run: 4, Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -1772,7 +1780,7 @@ cd /sc-data/cfc/cfc-backend && mvn test-compile -q 2>&1 | grep -c "ERROR.*\.java
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest='GuideFamilyAccessGuardTest,GuideFamilyServiceBindTest,HealthPlanReviewGuardTest,GuidePlanReviewControllerAuthTest,GuideFamilyQueryServiceTest' 2>&1 | grep -E "Tests run:|BUILD" | tail -8
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest='GuideFamilyAccessGuardTest,GuideFamilyServiceBindTest,HealthPlanReviewGuardTest,GuidePlanReviewControllerAuthTest,GuideFamilyQueryServiceTest' 2>&1 | grep -E "Tests run:|BUILD" | tail -8
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:全部 `Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:全部 `Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
@@ -2579,7 +2587,7 @@ cd /sc-data/cfc/cfc-backend && mvn clean test-compile -q 2>&1 | grep -c "ERROR.*
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
export PATH=/bwydata/maven/bin:$PATH
|
|
|
-cd /sc-data/cfc/cfc-backend && mvn test -Dtest='GuideFamilyAccessGuardTest,GuideFamilyServiceBindTest,HealthPlanReviewGuardTest,GuidePlanReviewControllerAuthTest,GuideFamilyQueryServiceTest' 2>&1 | grep -E "Tests run:.*Failures|BUILD" | tail -8
|
|
|
|
|
|
|
+cd /sc-data/cfc/cfc-backend && mvn test -DskipTests=false -Dtest='GuideFamilyAccessGuardTest,GuideFamilyServiceBindTest,HealthPlanReviewGuardTest,GuidePlanReviewControllerAuthTest,GuideFamilyQueryServiceTest' 2>&1 | grep -E "Tests run:.*Failures|BUILD" | tail -8
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
预期:全部 `Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|
|
预期:全部 `Failures: 0, Errors: 0` + `BUILD SUCCESS`。
|