-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
component/testgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Brief Motivation
This issue tracks the efforts to restructure TiDB tests, focusing on unit tests and integration tests, especially on separating integration_test.go as well as unifying test infrastructure in testify.
For the detailed design, see also:
Join force
We are currently on the first phase on the effort and focus on migrating tests to testify. If you want to participant the movement, you can directly comment under any open issues below without assignee to require assignment.
You can take a look at #26375 as an example to do the migration.
Note
Before writing code, please take a look at PRs merged already and keep consistent code style.
- parallel
- As mentioned in test: make all the tests run in serial #30692, we decided to run all tests in serial.
Keep test cases as parallel as possible.When some test cases should be run in serial, take use of go testing subtests (t.Run(name string, f func(t *T))) and parallel the parent test only. In this way, test cases in the same subtests set run in serial.Tracking issue for restructure tests #26022 (comment)When test cases should be run in serial at top level, move them intoxxx_serial_test.gofile.
- Avoid using suite of testify as discussed errno: migrate test-infra to testify #26082 (comment) and migrate test-infra to testify for
br/pkg#27178 (comment) - Make use of testify checkers when the original code writes plain go testing cases.
c.Assertis almostrequire.Xxx
Migration
- Introduce testify dependency #26025
- migrate test-infra to testify for
bindinfopkg #27177 - migrate test-infra to testify for
br/pkg#27178 - migrate test-infra to testify for
cmdpkg #27844 - migrate test-infra to testify for
configpkg #27179 - migrate test-infra to testify for
ddlpkg #27180 - migrate test-infra to testify for
distsqlpkg #26156 - migrate test-infra to testify for
domainpkg #26306 - migrate test-infra to testify for
domain/infosyncpkg #26155 - migrate test-infra to testify for
errnopkg #26081 - migrate test-infra to testify for
executor#26854 - migrate test-infra to testify for
expression#26855 - migrate test-infra to testify for
infoschema#28319 - migrate test-infra to testify for
infoschema/perfschemapkg #26436 - migrate test-infra to testify for
kvpkg #26100 - migrate test-infra to testify for
metapkg #26740 - migrate test-infra to testify for
meta/autoidpkg #26741 - migrate test-infra to testify for
metricspkg #26742 - migrate test-infra to testify for
ownerpkg #26743 - migrate test-infra to testify for
parser#28887 - migrate test-infra to testify for
planner/cascades#26856 - migrate test-infra to testify for
planner/core#26857 - migrate test-infra to testify for
planner/implementation#26858 - migrate test-infra to testify for
planner/memo#26860 - migrate test-infra to testify for
planner/property#26861 - migrate test-infra to testify for
planner/util#26862 - migrate test-infra to testify for
pluginpkg #26744 - migrate test-infra to testify for
plugin/conn_ip_example_test.go#26745 - migrate test-infra to testify for
privilege/privilegespkg #26746 - migrate test-infra to testify for
server#26863 - migrate test-infra to testify for
session#26864 - migrate test-infra to testify for
sessionctx#27140 - migrate test-infra to testify for
statistics#27141 - migrate test-infra to testify for
store#27142 - migrate test-infra to testify for
testsfolder #27874 - migrate test-infra to testify for
tidb-binlog/driver/readerpkg #33461 - migrate test-infra to testify for
tidb-binlog/nodepkg #33462 - migrate test-infra to testify for
tidb-binlog/pump_clientpkg #33463 - migrate test-infra to testify for
tidb-server#27143 - migrate test-infra to testify for
structure#27139 - migrate test-infra to testify for
table#26865 - migrate test-infra to testify for
table/tables#26866 - migrate test-infra to testify for
tablecodec#26867 - migrate test-infra to testify for
telemetrypkg #26537 - migrate test-infra to testify for
typespkg #26747 - migrate test-infra to testify for
types/jsonpkg #26374 - migrate test-infra to testify for
types/driverpkg #26521 - migrate test-infra to testify for
utilfolder #33453
Kits
- Implement flags bridge to workaround tests fail with undefined flags #26106
- Adopt go.uber.org/goleak for leak tests #26107
- Implement testkits for server tests #26108
- limit the time of a single unit test case #26289
Reference
- testify suffers from parallelizing tests in suite Running Parallel Tests in Suite stretchr/testify#187
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component/testgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.