pingcap / pingcap/tidb

tests: add reusable failpoint-enabled go test script for local workflow

Open
#67,317 0 comments 0 reactions 0 assignees View on GitHub
component/test type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

The current failpoint-enabled unit test guidance in `docs/agents/testing-flow.md` uses an inline shell block. That makes the workflow harder to reuse and awkward to parameterize when a developer needs to pass additional `go test` flags or a different tag set such as `nextgen`.

### Proposed change

- add a reusable script under `tools/check/` to wrap `make failpoint-enable`, `go test`, and `make failpoint-disable`
- accept the package path plus arbitrary `go test` arguments
- default to `-tags=intest,deadlock` when `-tags` is omitted
- allow callers to override tags explicitly, for example `-tags=intest,deadlock,nextgen`
- update `docs/agents/testing-flow.md` to reference the script instead of duplicating the subshell inline

### Benefit

This keeps the failpoint workflow consistent, reduces copy/paste errors, and makes ad hoc local test runs easier to execute.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.