tidb-test-guidelines

Provide guidelines for writing and placing tests in the TiDB codebase.

40.4k|6.2k|Updated Sep 6, 2015
One-click install
npx skills add https://github.com/pingcap/tidb --skill tidb-test-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tidb-test-guidelines
Source: https://github.com/pingcap/tidb/tree/main/.agents/skills/tidb-test-guidelines
Command: npx skills add https://github.com/pingcap/tidb --skill tidb-test-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides clear guidelines for where and how to write tests for TiDB, ensuring consistency, maintainability, and efficient code reviews.

Core Features & Use Cases

  • Test Placement: Guides on organizing tests within the codebase.
  • Writing Conventions: Rules for naming tests, using table-driven tests, and managing test data.
  • Shard Count Limits: Helps adhere to limits for test execution speed.
  • Use Case: When you need to add a new test for a TiDB feature, consult this Skill to understand the best practices for placement, naming, and structure.

Quick Start

Use the tidb-test-guidelines skill to understand where to place new tests for the pkg/planner package.

Frequently Asked Questions about tidb-test-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for organizing tests in the TiDB codebase?

Best practices for organizing tests in the TiDB codebase involve following specific placement rules for different test types to ensure maintainability and efficient code reviews. Guidelines cover test count limits and directory structure.

How do I name tests and use table-driven tests for TiDB?

To name tests and use table-driven tests for TiDB, apply the provided writing conventions which standardize naming formats and manage test data usage, ensuring consistency across the project for better maintainability.

When do I need to consider test count limits when writing tests for TiDB?

Test count limits must be considered when adding new tests to the TiDB codebase to control execution speed. Adhering to these shard count limits ensures efficient test processing during continuous integration.

Where should I place new tests for the pkg/planner package in TiDB?

Placement of new tests for the pkg/planner package in TiDB follows standardized guidelines that dictate exact locations within the codebase, ensuring structural consistency and streamlining the code review process.

Does TiDB have specific guidelines for managing test data in unit tests?

TiDB has specific guidelines for managing test data in unit tests, which help developers structure table-driven tests efficiently and maintain data consistency, directly supporting the codebase's overall maintainability standards.