Skip to content

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

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-new-feature-to-project
Closed

feat: AI Agent-driven test infrastructure (Phase 1)#24084
Copilot wants to merge 2 commits intomainfrom
copilot/add-new-feature-to-project

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Foundational infrastructure for automated test planning from PR diffs: parse changed files → map to test categories → generate structured TestPlan → deduplicate SQL cases → execute via local runner. Phase 1 of agent-driven CI.

New packages (pkg/testinfra/)

  • types/ — Domain types: TestPlan, TestTask, DiffSummary, FileChange, priority/status enums, JSON round-trip
  • planner/ — Unified diff parser (files, packages, functions from hunk headers), 22 static path→test-category mapping rules (e.g. pkg/sql/plan/ → optimizer BVT, pkg/vm/engine/disttae/ → disttae UT), Planner combining diff + mapping into a prioritized TestPlan with SCA/UT/BVT tasks
  • executor/Executor interface + LocalExecutor wrapping go test/go vet/mo-tester, sequential ExecutePlan orchestrator
  • dedup/ — SQL fingerprinting (normalize case/whitespace/literals → SHA-256), .test file parser handling mo-tester tags (@bvt, @sortkey), batch dedup with duplicate-group reporting

CLI + CI

  • cmd/mo-testplan/git diff | mo-testplan --pr 42 --base main --format json|summary
  • .github/workflows/testplan.yaml — PR open/sync trigger → generate TestPlan → upload artifact → post summary comment

Usage

git diff origin/main...HEAD | go run ./cmd/mo-testplan --pr 42 --base main --head feature/x --format summary
# TestPlan for PR #42
# Files changed: 5, Tasks: 15 (UT: 2, BVT: 12, SCA: 1)
go test ./pkg/testinfra/...   # all 4 packages pass

Copilot AI and others added 2 commits April 8, 2026 03:06
Implement the foundation for an AI Agent-driven testing system:

- pkg/testinfra/types: Core types (TestPlan, TestTask, DiffSummary, etc.)
- pkg/testinfra/planner: PR diff analyzer, code path→test category mapping,
  and TestPlan generator
- pkg/testinfra/executor: Test execution interface wrapping existing optools
- pkg/testinfra/dedup: SQL fingerprinting and test case deduplication
- cmd/mo-testplan: CLI tool for generating TestPlans from git diffs
- .github/workflows/testplan.yaml: GitHub Action for automatic TestPlan
  generation on PRs

Agent-Logs-Url: https://github.com/matrixorigin/matrixone/sessions/259914fa-6e60-401c-b7f3-d78061d5ae7b

Co-authored-by: Ariznawlll <108530700+Ariznawlll@users.noreply.github.com>
@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.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Ariznawlll Ariznawlll closed this Apr 8, 2026
Copilot AI added a commit that referenced this pull request Apr 8, 2026
Cherry-picked from copilot/add-new-feature-to-project branch (PR #24084):
- pkg/testinfra/types/ — Domain types
- pkg/testinfra/planner/ — Diff parser + path→test mapping
- pkg/testinfra/executor/ — Test execution interface
- pkg/testinfra/dedup/ — SQL fingerprinting & dedup
- cmd/mo-testplan/ — CLI tool
- .github/workflows/testplan.yaml — CI workflow

Agent-Logs-Url: https://github.com/matrixorigin/matrixone/sessions/01a80fb2-03a5-4645-8d55-6b07eada549b

Co-authored-by: Ariznawlll <108530700+Ariznawlll@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants