Continuous Integration (CI)

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/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](/docs/development/tests#test-automation).
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](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-status-checks).
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[​](#merge-with-master "Direct link to 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](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github), or merge the `master` branch to your pull request branch using git.

## Docs check[​](#docs-check "Direct link to 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[​](#description-check "Direct link to Description check")

Check that the description of your pull request conforms to the template [PULL\_REQUEST\_TEMPLATE.md](https://github.com/ClickHouse/ClickHouse/blob/master/.github/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](/docs/whats-new/changelog)

## Docker image[​](#docker-image "Direct link to Docker image")

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

### Official docker library tests[​](#official-docker-library-tests "Direct link to Official docker library tests")

Runs the tests from the [official Docker library](https://github.com/docker-library/official-images/tree/master/test#alternate-config-files) 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](https://github.com/ClickHouse/ClickHouse/tree/master/ci/jobs/scripts/docker_server).

## Marker check[​](#marker-check "Direct link to 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[​](#style-check "Direct link to Style check")

Performs various style checks on the code base.

Basic checks in the Style Check job:

##### cpp[​](#cpp "Direct link to cpp")

Performs simple regex-based code style checks using the [`ci/jobs/scripts/check_style/check_cpp.sh`](https://github.com/ClickHouse/ClickHouse/blob/master/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](/docs/development/style).

##### codespell, aspell[​](#codespell "Direct link to codespell, aspell")

Check for grammatical mistakes and typos.

##### mypy[​](#mypy "Direct link to mypy")

Performs static type checking for Python code.

### Running the style check job locally[​](#running-style-check-locally "Direct link to 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[​](#running-stateless-tests "Direct link to 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[​](#ci-prerequisites "Direct link to 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[​](#run-ci-job-locally "Direct link to 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[​](#run-specific-tests-within-ci-job "Direct link to 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[​](#additional-customization-options "Direct link to Additional Customization Options")