mirror of https://github.com/tikv/pd.git
|
…
|
||
|---|---|---|
| .. | ||
| alloc | ||
| README.md | ||
| coverProfile.go | ||
| go-compile-without-link.sh | ||
| ut.go | ||
| ut_test.go | ||
| xprog.go | ||
README.md
pd-ut
pd-ut is a tool to run unit tests for PD.
Build
- Go Version 1.23 or later
- In the root directory of the PD project, use the
make pd-utcommand to compile and generatebin/pd-ut
Usage
This section describes how to use the pd-ut tool.
brief run all tests
make ut
run by pd-ut
- You should
make failpoint-enablebefore running the tests. - And after running the tests, you should
make failpoint-disableandmake clean-testto disable the failpoint and clean the environment.
Flags description
// run all tests
pd-ut
// show usage
pd-ut -h
// list all packages
pd-ut list
// list test cases of a single package
pd-ut list $package
// list test cases that match a pattern
pd-ut list $package 'r:$regex'
// run all tests
pd-ut run
// run test all cases of a single package
pd-ut run $package
// run test cases of a single package
pd-ut run $package $test
// run test cases that match a pattern
pd-ut run $package 'r:$regex'
// build all test package
pd-ut build
// build a test package
pd-ut build xxx
// write the junitfile
pd-ut run --junitfile xxx
// test with race flag
pd-ut run --race
// test with coverprofile
pd-ut run --coverprofile xxx
go tool cover --func=xxx