Chuyển đến nội dung
Skillpedia
Kiểm thử40k · #7416

scaffolding-oracle-to-postgres-migration-test-project

Skill này làm gì

Công cụ này tạo cấu trúc cơ bản cho các test tích hợp trong một dự án .NET. Nó thiết lập môi trường để kiểm tra kết nối đến cơ sở dữ liệu Oracle, đảm bảo các test không làm thay đổi dữ liệu vĩnh viễn.

Khi nào nên dùng

  • ✓Trước khi bạn bắt đầu viết test tích hợp cho Oracle.
  • ✓Khi bạn cần một mẫu để quản lý dữ liệu test.
  • ✓Khi thiết lập một dự án để chuyển từ Oracle sang PostgreSQL.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/scaffolding-oracle-to-postgres-migration-test-project/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/scaffolding-oracle-to-postgres-migration-test-project/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một dự án test tích hợp cho dự án chính của tôi, được cấu hình cho Oracle.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tạo một dự án test mới kết nối đến cơ sở dữ liệu Oracle. Nó cũng thiết lập một hệ thống tự động bắt đầu và hoàn tác các giao dịch sau mỗi test, cùng một trình quản lý để nạp dữ liệu test.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Scaffolding an Integration Test Project for Oracle-to-PostgreSQL Migration

Creates a compilable, empty xUnit test project with transaction management and seed data infrastructure for a single target project. Run once per project before writing tests.

Workflow

Progress:
- [ ] Step 1: Inspect the target project
- [ ] Step 2: Create the xUnit test project
- [ ] Step 3: Implement transaction-rollback base class
- [ ] Step 4: Implement seed data manager
- [ ] Step 5: Verify the project compiles

Step 1: Inspect the target project

Read the target project's .csproj to determine the .NET version and existing package references. Match these versions exactly — do not upgrade.

Step 2: Create the xUnit test project

  • Target the same .NET version as the application under test.
  • Add NuGet packages for Oracle database connectivity (Oracle.ManagedDataAccess.Core) and xUnit.
  • Add a project reference to the target project only — no other application projects.
  • Add an appsettings.json configured for Oracle database connectivity.

Step 3: Implement transaction-rollback base class

  • Create a base test class that opens a transaction before each test and rolls it back after.
  • Catch and handle all exceptions to guarantee rollback.
  • Make the pattern inheritable by all downstream test classes.

Step 4: Implement seed data manager

  • Create a global seed manager for loading test data within the transaction scope.
  • Do not commit seed data — transactions roll back after each test.
  • Do not use TRUNCATE TABLE — preserve existing database data.
  • Establish a naming convention for seed file location that downstream test creation will follow.

Step 5: Verify the project compiles

Build the test project and confirm it compiles with zero errors before finishing.

Key Constraints

  • Phase 3 only — this skill scaffolds the Oracle-targeting test project. The PostgreSQL test project (Phase 6) is created by copying and migrating this project; do not run this skill again at that point.
  • Oracle is the golden behavior source — scaffold for Oracle only, not PostgreSQL.
  • Keep to existing .NET and C# versions; do not introduce newer language or runtime features.
  • Output is an empty test project with infrastructure only — no test cases.
Câu hỏi thường gặp

Vì sao tôi không nên dùng công cụ này ở Giai đoạn 6?

Ở Giai đoạn 6, bạn sẽ chuyển dự án test hiện có sang PostgreSQL. Sao chép và điều chỉnh dự án đã tạo ở Giai đoạn 3 là cách đúng, chứ không chạy lại công cụ này.

“Seed data” là gì?

“Seed data” là dữ liệu khởi tạo bạn nạp vào cơ sở dữ liệu để các test có thể chạy. Dữ liệu này tự động bị xóa sau mỗi test.

“Transaction-rollback” là gì?

Đây là cách đảm bảo các thay đổi dữ liệu trong cơ sở dữ liệu khi chạy test sẽ tự động được hoàn tác khi test kết thúc. Nhờ vậy dữ liệu gốc của bạn được giữ an toàn.

Chi tiết

Mô tả gốc của tác giả

Scaffolds an xUnit integration test project targeting Oracle in .NET solutions. Creates the test project, transaction-rollback base class, and seed data manager. Use only during Phase 3, before writing Oracle baseline integration tests. Do not invoke during Phase 6 — the PostgreSQL test project is produced by migrating this project, not by running this skill again.

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7416
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự