From 4a38215b7e5addc4210d33143e1d1e68294ab9d8 Mon Sep 17 00:00:00 2001 From: strtgbb <146047128+strtgbb@users.noreply.github.com> Date: Thu, 20 Nov 2025 10:51:38 -0500 Subject: [PATCH 1/2] Write documentation for local testing --- tests/README.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 65985e8a87f2..5448b31a8939 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1 +1,75 @@ -Find CI documents and instructions on running CI checks locally [here](https://clickhouse.com/docs/development/continuous-integration). +# Local Testing + +Upstream provides a utility `praktika`, which is used to run tests both locally and in CI. + +## Stateless + +### Suite + +Fast Test is self-contained and can be run with no extra setup. +```sh +python -m ci.praktika run "Fast test" +``` + +The stateless suites expect an executable `clickhouse` binary in `ci/tmp` +I recommend not running suites with the `s3 storage` option as that requires extra setup. +```sh +python -m ci.praktika run "Stateless tests (amd_debug, sequential)" +``` + +### One Test + +Running a single test can be done with bare `clickhouse-test` or with the `praktika` utility. + +#### clickhouse-test + +https://clickhouse.com/docs/development/tests#running-a-test-locally + +Start Clickhouse server, + +```sh +cd ci/tmp +./clickhouse server +``` + +then, in another window: + +```sh +tests/clickhouse-test -b ci/tmp/clickhouse 03222_pr_asan_index_granularity +``` + +#### praktika + +```sh +python -m ci.praktika run "Stateless tests (amd_debug, sequential)" --test 01107_atomic_db_detach_attach +``` + +You must specify the name of a job from the PR workflow to instruct praktika on the necessary configuration. + +## Integration + +### Suite + +https://github.com/ClickHouse/ClickHouse/blob/master/tests/integration/README.md + +> The runner searches in this order and uses the first found: +> ./ci/tmp/clickhouse +> ./build/programs/clickhouse +> ./clickhouse + +```sh +python -m ci.praktika run "Integration tests (amd_binary, 4/5)" +``` + +### One Test + +```sh +cd tests/integration +./runner --docker-image-version 72c567235d2f7658765b --docker-compose-images-tags=altinityinfra/integration-test:9c789665fa1f2c3b60a8 --binary ../../ci/tmp/clickhouse 'test_storage_hudi/test.py::test_types' +``` + +Docker images may or may not need to be specified. Get the tags by examining ci logs. +Search logs for `integration-test`, look for `"altinityinfra/integration-tests-runner": "72c567235d2f7658765b"` +and `"altinityinfra/integration-test": "9c789665fa1f2c3b60a8"` + +Note: `runner` has been removed from 25.9 onwards. From ad25f91a3fdc2f3d7a3f1e8bf1134075526aa464 Mon Sep 17 00:00:00 2001 From: strtgbb <146047128+strtgbb@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:28:44 -0500 Subject: [PATCH 2/2] Add hints about where to find test logs --- tests/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/README.md b/tests/README.md index 5448b31a8939..8b59a8211814 100644 --- a/tests/README.md +++ b/tests/README.md @@ -17,6 +17,8 @@ I recommend not running suites with the `s3 storage` option as that requires ext python -m ci.praktika run "Stateless tests (amd_debug, sequential)" ``` +Logs can be found in `ci/tmp` and `ci/tmp/var/log/clickhouse-server`. + ### One Test Running a single test can be done with bare `clickhouse-test` or with the `praktika` utility. @@ -38,6 +40,8 @@ then, in another window: tests/clickhouse-test -b ci/tmp/clickhouse 03222_pr_asan_index_granularity ``` +Logs will get written into the `tests/queries/0_stateless` folder. + #### praktika ```sh @@ -61,6 +65,8 @@ https://github.com/ClickHouse/ClickHouse/blob/master/tests/integration/README.md python -m ci.praktika run "Integration tests (amd_binary, 4/5)" ``` +Logs can be found in `ci/tmp` and `ci/tmp/var/log/clickhouse-server`. + ### One Test ```sh @@ -72,4 +78,6 @@ Docker images may or may not need to be specified. Get the tags by examining ci Search logs for `integration-test`, look for `"altinityinfra/integration-tests-runner": "72c567235d2f7658765b"` and `"altinityinfra/integration-test": "9c789665fa1f2c3b60a8"` +Logs are written to the local dir, which is `tests/integration` in this example. + Note: `runner` has been removed from 25.9 onwards.