117 lines
3.0 KiB
Markdown
117 lines
3.0 KiB
Markdown
|
|
# 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
|
||
|
|
|