-
The following executables must be copied or generated or linked into these locations,
sync_diff_inspector
can be downloaded from tidb-community-toolkit,tidb-server
related binaries can be downloaded from tidb-community-server:bin/tidb-server
# version >= 4.0.0-rc.1bin/tikv-server
# version >= 4.0.0-rc.1bin/pd-server
# version >= 4.0.0-rc.1bin/pd-ctl
# version >= 4.0.0-rc.1bin/tiflash
# needs tiflash binary and some necessary so filesbin/sync_diff_inspector
- bin/go-ycsb
- bin/etcdctl
- bin/jq
- bin/minio
If you are running tests on MacOS, tidb related binaries can be downloaded from tiup mirrors, such as https://tiup-mirrors.pingcap.com/tidb-v4.0.2-darwin-amd64.tar.gz. And
sync_diff_inspector
can be compiled by yourself from source tidb-toolsAll Tiflash required files can be found in tidb-community-server packages. You should put
flash_cluster_manager
,libtiflash_proxy.so
andtiflash
intobin
directory in TiCDC code base. -
The following programs must be installed:
mysql
(the MySQL cli client, currently mysql client 8.0 is not supported)
-
The user used to execute the tests must have permission to create the folder /tmp/tidb_cdc_test. All test artifacts will be written into this folder.
- Unit test does not need any dependencies, just running
make unit_test
in root dir of source code, or cd into directory of a test case and run single case viaGO111MODULE=on go test -check.f TestXXX
.
-
Run
make integration_test_build
to generate TiCDC related binaries for integration test -
Run
make integration_test
to execute the integration tests. This command will- Check that all required executables exist.
- Execute
tests/run.sh
If want to run one integration test case only, just pass the CASE parameter, such as
make integration_test CASE=simple
.There exists some environment variables that you can set by yourself, variable details can be found in test_prepare.
MySQL sink
will be used by default, if you want to testKafka sink
, please run withmake integration_test CASE=simple kafka
-
After executing the tests, run
make coverage
to get a coverage report at/tmp/tidb_cdc_test/all_cov.html
.
New integration tests can be written as shell scripts in tests/TEST_NAME/run.sh
. The script should exit with a nonzero error code on failure.