Skip to content

Commit 4a38215

Browse files
committed
Write documentation for local testing
1 parent d09fb0b commit 4a38215

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

tests/README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,75 @@
1-
Find CI documents and instructions on running CI checks locally [here](https://clickhouse.com/docs/development/continuous-integration).
1+
# Local Testing
2+
3+
Upstream provides a utility `praktika`, which is used to run tests both locally and in CI.
4+
5+
## Stateless
6+
7+
### Suite
8+
9+
Fast Test is self-contained and can be run with no extra setup.
10+
```sh
11+
python -m ci.praktika run "Fast test"
12+
```
13+
14+
The stateless suites expect an executable `clickhouse` binary in `ci/tmp`
15+
I recommend not running suites with the `s3 storage` option as that requires extra setup.
16+
```sh
17+
python -m ci.praktika run "Stateless tests (amd_debug, sequential)"
18+
```
19+
20+
### One Test
21+
22+
Running a single test can be done with bare `clickhouse-test` or with the `praktika` utility.
23+
24+
#### clickhouse-test
25+
26+
https://clickhouse.com/docs/development/tests#running-a-test-locally
27+
28+
Start Clickhouse server,
29+
30+
```sh
31+
cd ci/tmp
32+
./clickhouse server
33+
```
34+
35+
then, in another window:
36+
37+
```sh
38+
tests/clickhouse-test -b ci/tmp/clickhouse 03222_pr_asan_index_granularity
39+
```
40+
41+
#### praktika
42+
43+
```sh
44+
python -m ci.praktika run "Stateless tests (amd_debug, sequential)" --test 01107_atomic_db_detach_attach
45+
```
46+
47+
You must specify the name of a job from the PR workflow to instruct praktika on the necessary configuration.
48+
49+
## Integration
50+
51+
### Suite
52+
53+
https://github.com/ClickHouse/ClickHouse/blob/master/tests/integration/README.md
54+
55+
> The runner searches in this order and uses the first found:
56+
> ./ci/tmp/clickhouse
57+
> ./build/programs/clickhouse
58+
> ./clickhouse
59+
60+
```sh
61+
python -m ci.praktika run "Integration tests (amd_binary, 4/5)"
62+
```
63+
64+
### One Test
65+
66+
```sh
67+
cd tests/integration
68+
./runner --docker-image-version 72c567235d2f7658765b --docker-compose-images-tags=altinityinfra/integration-test:9c789665fa1f2c3b60a8 --binary ../../ci/tmp/clickhouse 'test_storage_hudi/test.py::test_types'
69+
```
70+
71+
Docker images may or may not need to be specified. Get the tags by examining ci logs.
72+
Search logs for `integration-test`, look for `"altinityinfra/integration-tests-runner": "72c567235d2f7658765b"`
73+
and `"altinityinfra/integration-test": "9c789665fa1f2c3b60a8"`
74+
75+
Note: `runner` has been removed from 25.9 onwards.

0 commit comments

Comments
 (0)