Skip to content

kviethp/TestPilot

Repository files navigation

TestPilot

AI-native toolkit để generate unit tests, explanation, và fix guidance cho source code dự án ngoài.

Tài liệu chính

  • README tiếng Việt: README.vi.md
  • Hướng dẫn extension VS Code: apps/extension-vscode/README.md
  • Release checklist: docs/RELEASE_CHECKLIST.md
  • CI / PR workflow: docs/CI_PR_WORKFLOW_M7.md

Cấu trúc repo

  • apps/cli: CLI entry
  • apps/extension-vscode: VS Code extension
  • packages/parser: parser contracts
  • packages/testgen: unit test generation contracts
  • packages/explain: explanation + fix-guide contracts
  • packages/quality-gate: quality rubric và logic GO/NO_GO
  • ops/state: state và log vận hành

Yêu cầu môi trường

  • Node.js >= 20
  • npm
  • mở terminal tại repo root (thư mục chứa file package.json)

Quick start

# chạy tại repo root
npm install

# Golden path (khuyến nghị): 1 lệnh -> output bundle + report
npm run -s tp:golden

# CLI dev entry
npm run dev:cli

Kết quả thường nằm tại:

  • artifacts/run-*/result.json
  • artifacts/run-*/report.md

Hướng dẫn nhanh cho người dùng CLI

# Demo mode với fixture có sẵn
node apps/cli/src/index.js --scenario pass

# Chạy trên file cụ thể
node apps/cli/src/index.js --file artifacts/m2-lane1-input.ts --framework jest

# Sinh test draft cạnh file nguồn
node apps/cli/src/index.js --file artifacts/m2-lane1-input.ts --write-test

# Sinh test draft vào path chỉ định
node apps/cli/src/index.js --file artifacts/m2-lane1-input.ts --write-test artifacts/generated/custom-output.test.ts

Hướng dẫn nhanh cho người dùng VS Code

  1. Mở repo này trong VS Code.
  2. Từ repo root, chạy npm run dev:ext để host extension ở local/mock mode.
  3. Mở Extension Host rồi mở một file mẫu như apps/cli/src/index.js.
  4. Mở Command Palette và chạy một trong các lệnh TestPilot: ....
  5. Xem kết quả ở output channel TestPilot.

Gợi ý vận hành an toàn

  • Ưu tiên path tương đối theo repo trong tài liệu, script, và output chia sẻ ra ngoài.
  • Không commit file *.vsix vào source tree; đây là build artifact.
  • Xem policy redaction tại docs/REDACTION_POLICY.md.

PR workflow automation

# Dùng git diff để chọn changed files
npm run m7:pr-workflow -- --base origin/main --head HEAD --framework vitest --scenario pass

# Dùng danh sách file thay đổi có sẵn
npm run m7:pr-workflow -- --changed-files artifacts/pr-changed-files.txt --framework vitest --scenario pass

Artifacts mặc định:

  • artifacts/pr-scan-output.json
  • artifacts/discovery-index-pr.json
  • artifacts/pr-workflow-report.md

Control Center UX

node scripts/export-m11-control-center.js

Artifacts mặc định:

  • artifacts/m11-lane1-control-center.json
  • artifacts/m11-lane1-control-center-quick.json
  • artifacts/m11-lane1-control-center-controlled.json
  • artifacts/m11-lane1-control-center-governed.json
  • artifacts/m11-lane1-control-center-action-queue.csv

Operating model

Xem thêm:

  • docs/ROADMAP_AI_SQUADS.md
  • docs/AGILE_OPERATING_MODEL.md

About

Auto Gen Unit Test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors