test(cache): 修复CacheConfigTest边界值测试
- 修改 shouldVerifyCacheManager_withMaximumIntegerTtl 为 shouldVerifyCacheManager_withMaximumAllowedTtl - 使用正确的最大TTL值(10080分钟,7天)而不是 Integer.MAX_VALUE - 新增 shouldThrowException_whenTtlExceedsMaximum 测试验证边界检查 - 所有1266个测试用例通过 - 覆盖率: 指令81.89%, 行88.48%, 分支51.55% docs: 添加项目状态报告 - 生成 PROJECT_STATUS_REPORT.md 详细记录项目当前状态 - 包含质量指标、已完成功能、待办事项和技术债务
This commit is contained in:
116
docs/plans/2026-01-27-regression-stabilization.md
Normal file
116
docs/plans/2026-01-27-regression-stabilization.md
Normal file
@@ -0,0 +1,116 @@
|
||||
# Regression Stabilization Implementation Plan
|
||||
|
||||
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
||||
|
||||
**Goal:** Stabilize the default `mvn -q verify` run by aligning integration tests to existing API paths and isolating long-running performance/journey tests from the default suite.
|
||||
|
||||
**Architecture:** Keep production code unchanged; update test endpoints to match current controllers, and tag long-running tests for opt-in execution via Surefire tags.
|
||||
|
||||
**Tech Stack:** Java 17, Spring Boot 3, JUnit 5, Maven Surefire
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Align SimpleApiIntegrationTest endpoints with `/api/v1`
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/test/java/com/mosquito/project/integration/SimpleApiIntegrationTest.java`
|
||||
- Test: `src/test/java/com/mosquito/project/integration/SimpleApiIntegrationTest.java`
|
||||
|
||||
**Step 1: Update endpoint paths**
|
||||
|
||||
```java
|
||||
restTemplate.postForEntity(
|
||||
"/api/v1/activities", entity, String.class);
|
||||
```
|
||||
|
||||
**Step 2: Run targeted test**
|
||||
|
||||
Run: `mvn -Dtest=SimpleApiIntegrationTest test`
|
||||
Expected: PASS
|
||||
|
||||
**Step 3: Verify no other `/api/activities` references remain**
|
||||
|
||||
Run: `rg -n "\/api\/activities" "src/test/java/com/mosquito/project/integration"`
|
||||
Expected: no matches
|
||||
|
||||
---
|
||||
|
||||
### Task 2: Tag user journey test as opt-in
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/test/java/com/mosquito/project/integration/UserOperationJourneyTest.java`
|
||||
- Test: `src/test/java/com/mosquito/project/integration/UserOperationJourneyTest.java`
|
||||
|
||||
**Step 1: Add `@Tag("journey")` to class**
|
||||
|
||||
```java
|
||||
@Tag("journey")
|
||||
public class UserOperationJourneyTest {
|
||||
```
|
||||
|
||||
**Step 2: Run a sanity check for tag presence**
|
||||
|
||||
Run: `rg -n "@Tag\(\"journey\"\)" "src/test/java/com/mosquito/project/integration/UserOperationJourneyTest.java"`
|
||||
Expected: single match at class definition
|
||||
|
||||
---
|
||||
|
||||
### Task 3: Tag performance tests as opt-in
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/test/java/com/mosquito/project/performance/ApiPerformanceTest.java`
|
||||
- Modify: `src/test/java/com/mosquito/project/performance/SimplePerformanceTest.java`
|
||||
|
||||
**Step 1: Add `@Tag("performance")` to each test class**
|
||||
|
||||
```java
|
||||
@Tag("performance")
|
||||
class ApiPerformanceTest extends AbstractPerformanceTest {
|
||||
```
|
||||
|
||||
```java
|
||||
@Tag("performance")
|
||||
class SimplePerformanceTest {
|
||||
```
|
||||
|
||||
**Step 2: Run a sanity check for tag presence**
|
||||
|
||||
Run: `rg -n "@Tag\(\"performance\"\)" "src/test/java/com/mosquito/project/performance"`
|
||||
Expected: matches in both performance test classes
|
||||
|
||||
---
|
||||
|
||||
### Task 4: Exclude opt-in tags from default Surefire run
|
||||
|
||||
**Files:**
|
||||
- Modify: `pom.xml`
|
||||
|
||||
**Step 1: Add Surefire plugin excludeTags configuration**
|
||||
|
||||
```xml
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludeTags>performance,journey</excludeTags>
|
||||
</configuration>
|
||||
</plugin>
|
||||
```
|
||||
|
||||
**Step 2: Verify Maven config builds**
|
||||
|
||||
Run: `mvn -q -DskipTests package`
|
||||
Expected: PASS
|
||||
|
||||
---
|
||||
|
||||
### Task 5: Re-run full verification
|
||||
|
||||
**Files:**
|
||||
- None
|
||||
|
||||
**Step 1: Full regression**
|
||||
|
||||
Run: `DOCKER_HOST="unix:///run/user/$(id -u)/podman/podman.sock" TESTCONTAINERS_RYUK_DISABLED="true" mvn -q verify`
|
||||
Expected: PASS
|
||||
|
||||
Reference in New Issue
Block a user