|
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 | +Logs can be found in `ci/tmp` and `ci/tmp/var/log/clickhouse-server`. |
| 21 | + |
| 22 | +### One Test |
| 23 | + |
| 24 | +Running a single test can be done with bare `clickhouse-test` or with the `praktika` utility. |
| 25 | + |
| 26 | +#### clickhouse-test |
| 27 | + |
| 28 | +https://clickhouse.com/docs/development/tests#running-a-test-locally |
| 29 | + |
| 30 | +Start Clickhouse server, |
| 31 | + |
| 32 | +```sh |
| 33 | +cd ci/tmp |
| 34 | +./clickhouse server |
| 35 | +``` |
| 36 | + |
| 37 | +then, in another window: |
| 38 | + |
| 39 | +```sh |
| 40 | +tests/clickhouse-test -b ci/tmp/clickhouse 03222_pr_asan_index_granularity |
| 41 | +``` |
| 42 | + |
| 43 | +Logs will get written into the `tests/queries/0_stateless` folder. |
| 44 | + |
| 45 | +#### praktika |
| 46 | + |
| 47 | +```sh |
| 48 | +python -m ci.praktika run "Stateless tests (amd_debug, sequential)" --test 01107_atomic_db_detach_attach |
| 49 | +``` |
| 50 | + |
| 51 | +You must specify the name of a job from the PR workflow to instruct praktika on the necessary configuration. |
| 52 | + |
| 53 | +## Integration |
| 54 | + |
| 55 | +### Suite |
| 56 | + |
| 57 | +https://github.com/ClickHouse/ClickHouse/blob/master/tests/integration/README.md |
| 58 | + |
| 59 | +> The runner searches in this order and uses the first found: |
| 60 | +> ./ci/tmp/clickhouse |
| 61 | +> ./build/programs/clickhouse |
| 62 | +> ./clickhouse |
| 63 | +
|
| 64 | +```sh |
| 65 | +python -m ci.praktika run "Integration tests (amd_binary, 4/5)" |
| 66 | +``` |
| 67 | + |
| 68 | +Logs can be found in `ci/tmp` and `ci/tmp/var/log/clickhouse-server`. |
| 69 | + |
| 70 | +### One Test |
| 71 | + |
| 72 | +```sh |
| 73 | +cd tests/integration |
| 74 | +./runner --docker-image-version 72c567235d2f7658765b --docker-compose-images-tags=altinityinfra/integration-test:9c789665fa1f2c3b60a8 --binary ../../ci/tmp/clickhouse 'test_storage_hudi/test.py::test_types' |
| 75 | +``` |
| 76 | + |
| 77 | +Docker images may or may not need to be specified. Get the tags by examining ci logs. |
| 78 | +Search logs for `integration-test`, look for `"altinityinfra/integration-tests-runner": "72c567235d2f7658765b"` |
| 79 | +and `"altinityinfra/integration-test": "9c789665fa1f2c3b60a8"` |
| 80 | + |
| 81 | +Logs are written to the local dir, which is `tests/integration` in this example. |
| 82 | + |
| 83 | +Note: `runner` has been removed from 25.9 onwards. |
0 commit comments