Skip to main content
Skip to main content

Continuous Integration (CI)

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.

Merge with master

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.

Docs check

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.

Description check

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

Docker image

Builds the ClickHouse server and keeper Docker images to verify that they build correctly.

Official docker library tests

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.

Marker check

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'.

Style check

Performs various style checks on the code base.

Basic checks in the Style Check job:

cpp

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.

codespell, aspell

Check for grammatical mistakes and typos.

mypy

Performs static type checking for Python code.

Running the style check job locally

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.

Running stateless tests

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.

Prerequisites

  • Python 3 (standard library only)
  • Docker

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

Run a CI Job Locally

Pick any job name from a CI report and run it locally:

python -m ci.praktika run "<JOB_NAME>"
  • Always quote the job name exactly as it appears in the CI report (it may contain spaces and commas), e.g.: "Stateless tests (amd_debug, parallel)". This sets up the same ClickHouse configuration and runs the same tests as in CI.
  • The architecture and build type in the job name (e.g., 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).
  • In CI, functional tests are split into batches for better resource utilization. For example, "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.
  • There is also a "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"
    

Run Specific Tests Within a CI Job

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
  • You can pass multiple test names:
    python -m ci.praktika run "Stateless tests (amd_debug, parallel)" \
      --test 00001_select1 00002_log_and_exception_messages_formatting
    
  • Tip: If any ClickHouse configuration is acceptable and you just need to run specific tests, use the alias functional instead of the full job name:
    python -m ci.praktika run functional --test 00001_select1
    

Additional Customization Options

  • --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.

Build check

Builds ClickHouse in various configurations for use in further steps.

Running Builds Locally

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.

Available Build Jobs

The build job names are exactly as they appear in the CI Report:

AMD64 Builds:

  • Build (amd_debug) - Debug build with symbols
  • Build (amd_release) - Optimized release build
  • Build (amd_asan) - Address Sanitizer build
  • Build (amd_tsan) - Thread Sanitizer build
  • Build (amd_msan) - Memory Sanitizer build
  • Build (amd_ubsan) - Undefined Behavior Sanitizer build
  • Build (amd_binary) - Quick release build without Thin LTO
  • Build (amd_compat) - Compatibility build for older systems
  • Build (amd_musl) - Build with musl libc
  • Build (amd_darwin) - macOS build
  • Build (amd_freebsd) - FreeBSD build

ARM64 Builds:

  • Build (arm_release) - ARM64 optimized release build
  • Build (arm_asan) - ARM64 Address Sanitizer build
  • Build (arm_coverage) - ARM64 build with coverage instrumentation
  • Build (arm_binary) - ARM64 Quick release build without Thin LTO
  • Build (arm_darwin) - macOS ARM64 build
  • Build (arm_v80compat) - ARMv8.0 compatibility build

Other Architectures:

  • Build (ppc64le) - PowerPC 64-bit Little Endian
  • Build (riscv64) - RISC-V 64-bit
  • Build (s390x) - IBM System/390 64-bit
  • Build (loongarch64) - LoongArch 64-bit

If 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.

Example

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.

Functional stateless tests

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.

Integration tests

Runs integration tests.

Bugfix validate check

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.

Stress test

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.

Compatibility check

Checks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help.

AST fuzzer

Runs randomly generated queries to catch program errors. If it fails, ask a maintainer for help.

Performance tests

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.