Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Refine the README of running integration tests #9390

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,44 +304,7 @@ TSAN_OPTIONS="suppressions=tests/sanitize/tsan.suppression" ./dbms/gtests_dbms .

## Run Integration Tests

1. Build your own TiFlash binary using debug profile:

```shell
cd cmake-build-debug
cmake .. -GNinja -DCMAKE_BUILD_TYPE=DEBUG
ninja tiflash
```

2. Start a local TiDB cluster with your own TiFlash binary using TiUP:

```shell
cd cmake-build-debug
tiup playground nightly --tiflash.binpath ./dbms/src/Server/tiflash

# Or using a more stable cluster version:
# tiup playground v6.1.0 --tiflash.binpath ./dbms/src/Server/tiflash
```

[TiUP](https://tiup.io) is the TiDB component manager. If you don't have one, you can install it via:

```shell
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
```

If you are not running the cluster using the default port (for example, you run multiple clusters), make sure that the port and build directory in `tests/_env.sh` are correct.

3. Run integration tests:

```shell
# In the TiFlash repository root:
cd tests
./run-test.sh

# Or run specific integration test:
# ./run-test.sh fullstack-test2/ddl
```

Note: some integration tests (namely, tests under `delta-merge-test`) requires a standalone TiFlash service without a TiDB cluster, otherwise they will fail. To run these integration tests: TBD
Check out the [Integration Test Guide](/tests/README.md) for more details.

## Run MicroBenchmark Tests

Expand Down Expand Up @@ -386,7 +349,7 @@ See [TiFlash Development Guide](/docs/DEVELOPMENT.md) and [TiFlash Design docume

Before submitting a pull request, please resolve clang-tidy errors and use [format-diff.py](format-diff.py) to format source code, otherwise CI build may raise error.

> **NOTE**: It is required to use clang-format 12.0.0+.
> **NOTE**: It is required to use clang-format 17.0.0+.

```shell
# In the TiFlash repository root:
Expand Down
61 changes: 36 additions & 25 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,42 @@

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. 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
```
1. Build your own TiFlash binary using debug profile:

```bash
# In the TiFlash repository root:
cmake --workflow --preset dev
```

2. Install [tiup](https://tiup.io/)
3. 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
```

4. Run test cases

```bash
# 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`

Expand Down