From 916604213b2f9bf0a80cadf539234f9a6a57981d Mon Sep 17 00:00:00 2001 From: Octobug Date: Tue, 13 Jun 2023 19:07:06 +0800 Subject: [PATCH 1/2] get-started: update command of running all unit tests The 'gotest' makefile target was removed by pingcap/tidb#36530 due to issue pingcap/tidb#36493 --- src/get-started/write-and-run-unit-tests.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/get-started/write-and-run-unit-tests.md b/src/get-started/write-and-run-unit-tests.md index ea6334a4..7b8f018f 100644 --- a/src/get-started/write-and-run-unit-tests.md +++ b/src/get-started/write-and-run-unit-tests.md @@ -127,10 +127,10 @@ When you write complex unit tests, you may take a look at what test kits we have ### Running all tests -You can always run all tests by executing the `gotest` target in Makefile: +You can always run all tests by executing the `ut` (stands for **unit test**) target in Makefile: -``` -make gotest +```sh +make ut ``` This is almost equivalent to `go test ./...` but it enables and disables fail points before and after running tests. @@ -139,9 +139,9 @@ This is almost equivalent to `go test ./...` but it enables and disables fail po ### Running a single test -To run a single test, you can manually repeat what `make gotest` does and narrow the scope in one test or one package: +To run a single test, you can manually repeat what `make ut` does and narrow the scope in one test or one package: -``` +```sh make failpoint-enable cd domain go test -v -run TestSchemaValidator # or with any other test flags @@ -151,7 +151,7 @@ make failpoint-disable or if it is an older test not using testify -``` +```sh make failpoint-enable (cd planner/core ; go test -v -run "^TestT$" -check.f TestBinaryOpFunction ) make failpoint-disable From 6b74880c31bb3a9b52ae225c74af9b5b356ce78a Mon Sep 17 00:00:00 2001 From: Octobug Date: Tue, 13 Jun 2023 19:07:41 +0800 Subject: [PATCH 2/2] get-started: fix a typo in 'Write and run unit tests' --- src/get-started/write-and-run-unit-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get-started/write-and-run-unit-tests.md b/src/get-started/write-and-run-unit-tests.md index 7b8f018f..ed295675 100644 --- a/src/get-started/write-and-run-unit-tests.md +++ b/src/get-started/write-and-run-unit-tests.md @@ -181,7 +181,7 @@ As shown above, you can run tests of the whole package, of a test, or of a file. Before you merge a pull request, it must pass all tests. -Generally, continuous integration (CI) runs the tests for you; however, if you want to run tests with conditions or rerun tests on failure, you should know how to do that, the the rerun guide comment will be sent when the CI tests failed. +Generally, continuous integration (CI) runs the tests for you; however, if you want to run tests with conditions or rerun tests on failure, you should know how to do that, the rerun guide comment will be sent when the CI tests failed. #### `/retest`