Background
We want to transform our test infrastructure so that it can be fully scheduled and utilized by AI Agents, covering two core capabilities: automated test case generation and test execution orchestration.
Goal
The ideal workflow after a PR is submitted:
- TestPlan Generation — Automatically generate a structured test plan from PR diffs, mapping code changes to relevant test categories
- Automatic Case Addition — Automatically generate relevant test cases (SQL cases) based on code changes, and deduplicate against existing cases to avoid redundancy
- Execution Orchestration — Agent automatically orchestrates and schedules test task execution (UT / BVT / SCA)
- Observability & Control — Support viewing test progress and results via WeCom (Enterprise WeChat), with controls such as cancel and re-run
Phased Plan
Phase 1: Infrastructure Foundation ✅
Phase 2: Automatic Case Generation & Deduplication
Phase 3: Agent Execution Orchestration
Phase 4: WeCom Integration
Architecture
PR Submitted
│
▼
┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Diff Parser │────▶│ Planner/Mapper │────▶│ TestPlan (JSON) │
└─────────────┘ └──────────────────┘ └────────┬────────┘
│
┌──────────────────┐ │
│ Case Generator │◀──────────────┤
│ + Dedup Engine │ │
└──────────────────┘ │
▼
┌─────────────────┐
│ Executor / │
│ Orchestrator │
└────────┬────────┘
│
▼
┌─────────────────┐
│ WeCom Notify / │
│ Control │
└─────────────────┘
Key Packages
| Package |
Description |
pkg/testinfra/types |
Domain types: TestPlan, TestTask, DiffSummary, FileChange |
pkg/testinfra/planner |
Diff parser + path-to-category mapping + plan generation |
pkg/testinfra/dedup |
SQL fingerprinting and deduplication |
pkg/testinfra/executor |
Test task execution interface and implementations |
cmd/mo-testplan |
CLI entry point |
Background
We want to transform our test infrastructure so that it can be fully scheduled and utilized by AI Agents, covering two core capabilities: automated test case generation and test execution orchestration.
Goal
The ideal workflow after a PR is submitted:
Phased Plan
Phase 1: Infrastructure Foundation ✅
.testfile parsermo-testplanPhase 2: Automatic Case Generation & Deduplication
test/distributed/cases/Phase 3: Agent Execution Orchestration
Phase 4: WeCom Integration
Architecture
Key Packages
pkg/testinfra/typespkg/testinfra/plannerpkg/testinfra/deduppkg/testinfra/executorcmd/mo-testplan