Skip to content

Commit

Permalink
tests: Refine the README of running test cases (#9211)
Browse files Browse the repository at this point in the history
ref #6233

Refine the README of running test cases
  • Loading branch information
JaySon-Huang authored Jul 12, 2024
1 parent 02b61ea commit 81034bf
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
32 changes: 27 additions & 5 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@

For running intergration test cases (defined in `./fullstack-test`, `./fullstack-test-dt`, `./new_collation_fullstack`), you should define a TiDB cluster with TiFlash node (1 PD, 1 TiKV, 1 TiDB, 1 TiFlash at least).

1. Deploy a cluster using [tiup](https://tiup.io/)
2. Use `ti.sh x.ti prop` to ensure the ports of your cluster
3. Change the "storage_port", "tidb_port" in `./env.sh` to let it connect to your cluster
4. Run tests with `./run-test.sh fullstack-test/ddl`
1. Install [tiup](https://tiup.io/)
2. Use `tiup playground` (recommanded) or `tiup cluster` to start a tidb cluster

```bash
export TIDB_PORT=4000
export TIFLASH_PORT=9000

# Prepare a config file with `tcp_port` enabled
cat << EOF > tiflash.toml
tcp_port = ${TIFLASH_PORT}
# If you're deploying a testing cluster where the disk is not exclusively dedicated to TiFlash,
# it is necessary to set "capacity". Otherwise, PD will not add peers to TiFlash, making the
# tiflash replica can not be available.
capacity = 1000000000
[logger]
level = "debug"
EOF

# Start a tidb cluster with tiup playground
tiup playground nightly --tiflash 1 --tiflash.binpath /path/to/build/tiflash --db.port ${TIDB_PORT} --tiflash.config ./tiflash.toml

# Run tests with `./run-test.sh`, for example
tidb_port=${TIDB_PORT} storage_port=${TIFLASH_PORT} verbose=true ./run-test.sh fullstack-test/ddl
```

## How to run test cases in `delta-merge-test`

For running mock test cases (defined in `./delta-merge-test`), you should start a standalone tiflash that is not connected to tidb cluster
```

```bash
export TIFLASH_PORT=9000
./tiflash server -- --path /tmp/tiflash/data --tcp_port ${TIFLASH_PORT}
storage_port=${TIFLASH_PORT} verbose=true ./run-test.sh delta-merge-test
Expand Down
10 changes: 5 additions & 5 deletions tests/_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -z ${storage_bin+x} ]; then
fi

# Server address for connecting
export storage_server="127.0.0.1"
export storage_server=${storage_server:-"127.0.0.1"}

# Server port for connecting
export storage_port=${storage_port:-9000}
Expand All @@ -39,13 +39,13 @@ export storage_port=${storage_port:-9000}
export storage_db="system"

# TiDB address
export tidb_server="127.0.0.1"
export tidb_server=${tidb_server:-"127.0.0.1"}

# TiDB port
export tidb_port="4000"
export tidb_port=${tidb_port:-"4000"}

# TiDB status port
export tidb_status_port="10080"
export tidb_status_port=${tidb_status_port:-"10080"}

# TiDB default database
export tidb_db="test"
Expand All @@ -54,8 +54,8 @@ export tidb_db="test"
export tidb_table="t"

# Whether run scripts with verbose output
# "true" or "false"
export verbose=${verbose:-"false"}
# export verbose="true"

export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
4 changes: 0 additions & 4 deletions tests/docker/config/tiflash_dt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

[flash]
service_addr = "0.0.0.0:3930"
[flash.flash_cluster]
update_rule_interval = 5
[flash.proxy]
addr = "0.0.0.0:20170"
advertise-addr = "tiflash0:20170"
Expand Down
4 changes: 0 additions & 4 deletions tests/docker/config/tiflash_dt_disable_local_tunnel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

[flash]
tidb_status_addr = "tidb0:10080"
service_addr = "0.0.0.0:3930"
[flash.flash_cluster]
update_rule_interval = 5
[flash.proxy]
addr = "0.0.0.0:20170"
advertise-addr = "tiflash0:20170"
Expand Down
4 changes: 0 additions & 4 deletions tests/docker/config/tiflash_dt_force_enable_lm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 5368709120
minmax_index_cache_size = 5368709120
tcp_port = 9000
http_port = 8123

[flash]
tidb_status_addr = "tidb0:10080"
service_addr = "0.0.0.0:3930"
[flash.flash_cluster]
update_rule_interval = 5
[flash.proxy]
addr = "0.0.0.0:20170"
advertise-addr = "tiflash0:20170"
Expand Down
4 changes: 0 additions & 4 deletions tests/docker/config/tiflash_dt_sync_grpc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ tmp_path = "/tmp/tiflash/data/tmp"
path = "/tmp/tiflash/data/db"
capacity = "10737418240"

mark_cache_size = 1073741824
minmax_index_cache_size = 1073741824
tcp_port = 9000
http_port = 8123

[flash]
tidb_status_addr = "tidb0:10080"
service_addr = "0.0.0.0:3930"
[flash.flash_cluster]
update_rule_interval = 5
[flash.proxy]
addr = "0.0.0.0:20170"
advertise-addr = "tiflash0:20170"
Expand Down

0 comments on commit 81034bf

Please sign in to comment.