docs/en/development/continuous-integration.md
When you submit a pull request, some automated checks are ran for your code by the ClickHouse continuous integration (CI) system.
This happens after a repository maintainer (someone from ClickHouse team) has screened your code and added the can be tested label to your pull request.
The results of the checks are listed on the GitHub pull request page as described in the GitHub checks documentation.
If a check is failing, you might be required to fix it.
This page gives an overview of checks you may encounter, and what you can do to fix them.
If it looks like the check failure is not related to your changes, it may be some transient failure or an infrastructure problem. Push an empty commit to the pull request to restart the CI checks:
git commit --allow-empty
git push
If you are not sure what to do, ask a maintainer for help.
Verifies that the PR can be merged to master.
If not, it will fail with a message Cannot fetch mergecommit.
To fix this check, resolve the conflict as described in the GitHub documentation, or merge the master branch to your pull request branch using git.
Tries to build the ClickHouse documentation website.
It can fail if you changed something in the documentation.
Most probable reason is that some cross-link in the documentation is wrong.
Go to the check report and look for ERROR and WARNING messages.
Check that the description of your pull request conforms to the template PULL_REQUEST_TEMPLATE.md. You have to specify a changelog category for your change (e.g., Bug Fix), and write a user-readable message describing the change for CHANGELOG.md
Builds the ClickHouse server and keeper Docker images to verify that they build correctly.
Runs the tests from the official Docker library to verify that the clickhouse/clickhouse-server Docker image works correctly.
To add new tests, create a directory ci/jobs/scripts/docker_server/tests/$test_name and the script run.sh there.
Additional details about the tests can be found in the CI jobs scripts documentation.
This check means that the CI system started to process the pull request. When it has 'pending' status, it means that not all checks have been started yet. After all checks have been started, it changes status to 'success'.
Performs various style checks on the code base.
Basic checks in the Style Check job:
Performs simple regex-based code style checks using the ci/jobs/scripts/check_style/check_cpp.sh script (which can also be run locally).
If it fails, fix the style issues according to the code style guide.
Check for grammatical mistakes and typos.
Performs static type checking for Python code.
The entire Style Check job can be run locally in a Docker container with:
python -m ci.praktika run "Style check"
To run a specific check (e.g., cpp check):
python -m ci.praktika run "Style check" --test cpp
These commands pull the clickhouse/style-test Docker image and run the job in a containerized environment.
No dependencies other than Python 3 and Docker are required.
A locally installed ClickHouse with default settings may work for specific test cases, but cannot run all test queries correctly. In CI, each job installs a specific ClickHouse configuration (e.g., S3 storage, Parallel Replicas) which can be cumbersome to reproduce manually. To avoid this, you can reproduce any CI job locally using the same orchestration as CI — no manual configuration needed.
Install Docker on Ubuntu if needed and re-login:
sudo apt-get update
sudo apt-get install docker.io
sudo usermod -aG docker "$USER"
sudo tee /etc/docker/daemon.json <<'EOF'
{
"ipv6": true,
"ip6tables": true
}
EOF
sudo systemctl restart docker
Pick any job name from a CI report and run it locally:
python -m ci.praktika run "<JOB_NAME>"
"Stateless tests (amd_debug, parallel)". This sets up the same ClickHouse configuration and runs the same tests as in CI.amd_debug) are CI-specific labels. When running locally, they have no effect — the job will use whatever binary you provide, on whatever architecture you are running. The job name only determines the ClickHouse configuration and the test set (unless overridden with --test)."Stateless tests (amd_debug, parallel)" and "Stateless tests (amd_debug, sequential)" together cover the entire scope: parallel-safe tests run concurrently, and the rest run sequentially. The split reduces total CI time by maximizing parallelism where possible. To reproduce the full test scope locally, run both batches."Fast test" CI job that runs a limited scope of functional tests to verify basic ClickHouse functionality — it uses a build without all optional modules and is the quickest way to catch regressions. You can run it locally the same way. Place your ClickHouse binary in one of the default search paths (./ci/tmp/clickhouse, ./build/programs/clickhouse, or ./clickhouse) — otherwise the job will attempt to build ClickHouse first:
python -m ci.praktika run "Fast test"
With --test, the job prepares an identical ClickHouse setup as used in CI but runs only the selected tests:
python -m ci.praktika run "Stateless tests (amd_debug, parallel)" \
--test 00001_select1
python -m ci.praktika run "Stateless tests (amd_debug, parallel)" \
--test 00001_select1 00002_log_and_exception_messages_formatting
functional instead of the full job name:
python -m ci.praktika run functional --test 00001_select1
--path PATH — custom path to the ClickHouse binary. By default, the runner searches in order: ./ci/tmp/clickhouse, ./build/programs/clickhouse, ./clickhouse.--count N — repeat each test N times.--workers N — override the automatic calculation of parallel workers derived from machine capacity.Builds ClickHouse in various configurations for use in further steps.
The build can be run locally in a CI-like environment using:
python -m ci.praktika run "<BUILD_JOB_NAME>"
No dependencies other than Python 3 and Docker are required.
The build job names are exactly as they appear in the CI Report:
AMD64 Builds:
Build (amd_debug) - Debug build with symbolsBuild (amd_release) - Optimized release buildBuild (amd_asan) - Address Sanitizer buildBuild (amd_tsan) - Thread Sanitizer buildBuild (amd_msan) - Memory Sanitizer buildBuild (amd_ubsan) - Undefined Behavior Sanitizer buildBuild (amd_binary) - Quick release build without Thin LTOBuild (amd_compat) - Compatibility build for older systemsBuild (amd_musl) - Build with musl libcBuild (amd_darwin) - macOS buildBuild (amd_freebsd) - FreeBSD buildARM64 Builds:
Build (arm_release) - ARM64 optimized release buildBuild (arm_asan) - ARM64 Address Sanitizer buildBuild (arm_coverage) - ARM64 build with coverage instrumentationBuild (arm_binary) - ARM64 Quick release build without Thin LTOBuild (arm_darwin) - macOS ARM64 buildBuild (arm_v80compat) - ARMv8.0 compatibility buildOther Architectures:
Build (ppc64le) - PowerPC 64-bit Little EndianBuild (riscv64) - RISC-V 64-bitBuild (s390x) - IBM System/390 64-bitBuild (loongarch64) - LoongArch 64-bitIf the job succeeds, build results will be available in the <repo_root>/ci/tmp/build directory.
Note: For builds not in the "Other Architectures" category (which use cross-compilation), your local machine architecture must match the build type to produce the build as requested by BUILD_JOB_NAME.
To run a local debug build:
python -m ci.praktika run "Build (amd_debug)"
If the above approach does not work for you, use the cmake options from the build log and follow the general build process.
Runs stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc. Look at the report to see which tests fail, then reproduce the failure locally as described here. Note that you have to use the correct build configuration to reproduce -- a test might fail under AddressSanitizer but pass in Debug. Download the binary from CI build checks page, or build it locally.
Runs integration tests.
Checks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch. This check is triggered when pull request has "pr-bugfix" label.
Runs stateless functional tests concurrently from several clients to detect concurrency-related errors. If it fails:
* Fix all other test failures first;
* Look at the report to find the server logs and check them for possible causes
of error.
Checks that clickhouse binary runs on distributions with old libc versions.
If it fails, ask a maintainer for help.
Runs randomly generated queries to catch program errors. If it fails, ask a maintainer for help.
Measure changes in query performance. This is the longest check that takes just below 6 hours to run. The performance test report is described in detail here.