Skip to content

feat: AI Agent-driven test infrastructure (Phase 1)#24087

Open
Ariznawlll wants to merge 10 commits intomatrixorigin:mainfrom
Ariznawlll:feat/testinfra-phase1
Open

feat: AI Agent-driven test infrastructure (Phase 1)#24087
Ariznawlll wants to merge 10 commits intomatrixorigin:mainfrom
Ariznawlll:feat/testinfra-phase1

Conversation

@Ariznawlll
Copy link
Copy Markdown
Contributor

@Ariznawlll Ariznawlll commented Apr 8, 2026

Foundational infrastructure for automated test planning from PR diffs:

  • pkg/testinfra/types: Domain types (TestPlan, TestTask, DiffSummary, FileChange, priority/status enums)
  • pkg/testinfra/planner: Unified diff parser, 22 static path→test-category mapping rules, Planner combining diff + mapping into prioritized TestPlan
  • pkg/testinfra/executor: Executor interface + LocalExecutor wrapping go test/go vet/mo-tester
  • pkg/testinfra/dedup: SQL fingerprinting (normalize case/whitespace/literals → SHA-256), .test file parser, batch dedup
  • cmd/mo-testplan: CLI tool for generating TestPlan from git diff
  • .github/workflows/testplan.yaml: PR trigger → generate TestPlan → upload artifact → post summary comment

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

A PR may generate a test plan, then automatically add related cases, and can eliminate duplicates with the current case. At the execution level, it can be arranged and scheduled by agents, and can be viewed and controlled through Enterprise WeChat.

issue ##24086

What this PR does / why we need it:

A PR may generate a test plan, then automatically add related cases, and can eliminate duplicates with the current case. At the execution level, it can be arranged and scheduled by agents, and can be viewed and controlled through Enterprise WeChat.

Foundational infrastructure for automated test planning from PR diffs:
- pkg/testinfra/types: Domain types (TestPlan, TestTask, DiffSummary, FileChange, priority/status enums)
- pkg/testinfra/planner: Unified diff parser, 22 static path→test-category mapping rules, Planner combining diff + mapping into prioritized TestPlan
- pkg/testinfra/executor: Executor interface + LocalExecutor wrapping go test/go vet/mo-tester
- pkg/testinfra/dedup: SQL fingerprinting (normalize case/whitespace/literals → SHA-256), .test file parser, batch dedup
- cmd/mo-testplan: CLI tool for generating TestPlan from git diff
- .github/workflows/testplan.yaml: PR trigger → generate TestPlan → upload artifact → post summary comment
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ariznawl@163.com seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mergify mergify bot added the kind/feature label Apr 8, 2026
Ariznawl@163.com added 4 commits April 8, 2026 19:10
- 6 test types: BVT, stability, chaos, bigdata, PITR, snapshot
- LLM-powered analysis via GitHub Models API (gpt-4o-mini)
- Smart category inference from changed file paths
- Sample case loading for LLM format learning
- SQL deduplication against existing test files (>50% overlap filter)
- Precise targeting: only generates cases for types that truly need coverage
- Writer module for auto-writing cases to correct locations
- CLI: mo-testplan --pr N [--write] [--create-pr] [--json]
- Expanded testing-guide.md with real formats for all 6 test types
- 35+ unit tests across 6 packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/wip kind/feature size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants