Skip to content

Commit f79e550

Browse files
authored
Merge pull request #50 from Altinity/package-testing
Package testing
2 parents 1c007a6 + c1b010f commit f79e550

File tree

152 files changed

+1565
-1514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1565
-1514
lines changed

.github/upload_results_to_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"test_attributes": {
3838
"clickhouse_version": "version",
3939
"clickhouse_package": "package",
40-
"base_os": None,
40+
"base_os": "base_os",
4141
"architecture": "arch",
4242
"keeper_package": "keeper_binary_path",
4343
"zookeeper_version": "zookeeper_version",

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ You can run tests locally by passing `--local` and `--clickhouse-binary-path` to
250250
* `--clickhouse-binary-path` specifies the path to the ClickHouse binary on the host machine that will be used during the regression
251251
run. You can also use a docker image that should have `docker://` prefix.
252252
For example, `--clickhouse-binary-path docker://clickhouse/clickhouse-server:22.3.6.5-alpine`
253+
* `--base-os` specifies a docker image to install ClickHouse into when `--clickhouse-binary-path` is not a docker image.
254+
Supported distributions are `altinityinfra/clickhouse-regression-multiarch:2.0` (default), `ubuntu`, and `alpine`.
255+
There is experimental support for `fedora` and `redhat/ubi9`.
256+
253257
> [!NOTE]
254258
> You can pass the `-h` or `--help` argument to the `regression.py` to see a help message.
255259
>

alter/alter_env/clickhouse-service-different-versions.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.3'
1+
version: "2.3"
22

33
services:
44
clickhouse-different-versions:
@@ -17,7 +17,4 @@ services:
1717
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/ssl:/etc/clickhouse-server/ssl"
1818
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.xml:/etc/clickhouse-server/config.xml"
1919
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/users.xml:/etc/clickhouse-server/users.xml"
20-
- "${CLICKHOUSE_SPECIFIC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest}:/usr/bin/clickhouse"
21-
- "${CLICKHOUSE_SPECIFIC_ODBC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest_odbc_bridge}:/usr/bin/clickhouse-odbc-bridge"
22-
- "${CLICKHOUSE_TESTS_SERVER_BIN_PATH:-/usr/bin/clickhouse}:/usr/bin/clickhouse_main_version/clickhouse"
23-
- "${CLICKHOUSE_TESTS_ODBC_BRIDGE_BIN_PATH:-/usr/bin/clickhouse-odbc-bridge}:/usr/bin/clickhouse_main_version/clickhouse-odbc-bridge"
20+
- "${CLICKHOUSE_SPECIFIC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest}:/usr/bin/clickhouse_different_version/clickhouse"

alter/alter_env/clickhouse-service.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ services:
66
file: ../../docker-compose/clickhouse-service.yml
77
service: clickhouse
88
volumes:
9-
- "${CLICKHOUSE_TESTS_DIR}/../helpers/corrupt_file:/usr/bin/corrupt_file"
109
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/logs.xml:/etc/clickhouse-server/config.d/logs.xml"
1110
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/ports.xml:/etc/clickhouse-server/config.d/ports.xml"
1211
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/remote.xml:/etc/clickhouse-server/config.d/remote.xml"
@@ -16,5 +15,3 @@ services:
1615
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/ssl:/etc/clickhouse-server/ssl"
1716
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.xml:/etc/clickhouse-server/config.xml"
1817
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/users.xml:/etc/clickhouse-server/users.xml"
19-
- "${CLICKHOUSE_TESTS_SERVER_BIN_PATH:-/usr/bin/clickhouse}:/usr/bin/clickhouse"
20-
- "${CLICKHOUSE_TESTS_ODBC_BRIDGE_BIN_PATH:-/usr/bin/clickhouse-odbc-bridge}:/usr/bin/clickhouse-odbc-bridge"

alter/alter_env/docker-compose.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: '2.3'
22

33
volumes:
44
data1-1:
5-
bash-tools:
65

76
services:
87
zookeeper1:
@@ -24,13 +23,11 @@ services:
2423
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse1/database/:/var/lib/clickhouse/"
2524
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse1/logs/:/var/log/clickhouse-server/"
2625
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse1/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
27-
- bash-tools:/usr/bin/bash-tools
26+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
2827

2928
depends_on:
3029
zookeeper1:
3130
condition: service_healthy
32-
bash-tools:
33-
condition: service_started
3431

3532
clickhouse-different-versions:
3633
extends:
@@ -41,7 +38,7 @@ services:
4138
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse-different-versions/database/:/var/lib/clickhouse/"
4239
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse-different-versions/logs/:/var/log/clickhouse-server/"
4340
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse-different-versions/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
44-
- bash-tools:/usr/bin/bash-tools
41+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
4542
depends_on:
4643
zookeeper1:
4744
condition: service_healthy
@@ -55,7 +52,7 @@ services:
5552
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse2/database/:/var/lib/clickhouse/"
5653
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse2/logs/:/var/log/clickhouse-server/"
5754
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse2/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
58-
- bash-tools:/usr/bin/bash-tools
55+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
5956
depends_on:
6057
zookeeper1:
6158
condition: service_healthy
@@ -69,7 +66,7 @@ services:
6966
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse3/database/:/var/lib/clickhouse/"
7067
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse3/logs/:/var/log/clickhouse-server/"
7168
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse3/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
72-
- bash-tools:/usr/bin/bash-tools
69+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
7370
depends_on:
7471
zookeeper1:
7572
condition: service_healthy
@@ -93,7 +90,6 @@ services:
9390
ports:
9491
- "8080"
9592
tty: true
96-
init: true
9793
depends_on:
9894
- proxy1
9995
- proxy2
@@ -137,7 +133,7 @@ services:
137133
file: ../../docker-compose/bash-tools.yml
138134
service: bash-tools
139135
volumes:
140-
- bash-tools:/usr/bin
136+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
141137

142138
# dummy service which does nothing, but allows to postpone
143139
# 'docker-compose up -d' till all dependencies will go healthy

alter/alter_env_arm64/clickhouse-service-different-versions.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.3'
1+
version: "2.3"
22

33
services:
44
clickhouse-different-versions:
@@ -17,8 +17,4 @@ services:
1717
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/ssl:/etc/clickhouse-server/ssl"
1818
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.xml:/etc/clickhouse-server/config.xml"
1919
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/users.xml:/etc/clickhouse-server/users.xml"
20-
- "${CLICKHOUSE_SPECIFIC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest}:/usr/bin/clickhouse"
21-
- "${CLICKHOUSE_SPECIFIC_ODBC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest_odbc_bridge}:/usr/bin/clickhouse-odbc-bridge"
22-
- "${CLICKHOUSE_TESTS_SERVER_BIN_PATH:-/usr/bin/clickhouse}:/usr/bin/clickhouse_main_version/clickhouse"
23-
- "${CLICKHOUSE_TESTS_ODBC_BRIDGE_BIN_PATH:-/usr/bin/clickhouse-odbc-bridge}:/usr/bin/clickhouse_main_version/clickhouse-odbc-bridge"
24-
20+
- "${CLICKHOUSE_SPECIFIC_BINARY:-/tmp/clickhouse-server_23.3.13.7.altinitytest}:/usr/bin/clickhouse_different_version/clickhouse"

alter/alter_env_arm64/clickhouse-service.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services:
1111
- "9009"
1212
- "8123"
1313
volumes:
14-
- "${CLICKHOUSE_TESTS_DIR}/../helpers/corrupt_file:/usr/bin/corrupt_file"
1514
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/logs.xml:/etc/clickhouse-server/config.d/logs.xml"
1615
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/ports.xml:/etc/clickhouse-server/config.d/ports.xml"
1716
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse/config.d/remote.xml:/etc/clickhouse-server/config.d/remote.xml"

alter/alter_env_arm64/docker-compose.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: '2.3'
22

33
volumes:
44
data1-1:
5-
bash-tools:
65

76
services:
87
zookeeper1:
@@ -24,8 +23,7 @@ services:
2423
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse1/database/:/var/lib/clickhouse/"
2524
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse1/logs/:/var/log/clickhouse-server/"
2625
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse1/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
27-
- bash-tools:/usr/bin/bash-tools
28-
26+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
2927
depends_on:
3028
zookeeper1:
3129
condition: service_healthy
@@ -41,7 +39,7 @@ services:
4139
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse-different-versions/database/:/var/lib/clickhouse/"
4240
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse-different-versions/logs/:/var/log/clickhouse-server/"
4341
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse-different-versions/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
44-
- bash-tools:/usr/bin/bash-tools
42+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
4543
depends_on:
4644
zookeeper1:
4745
condition: service_healthy
@@ -55,7 +53,7 @@ services:
5553
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse2/database/:/var/lib/clickhouse/"
5654
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse2/logs/:/var/log/clickhouse-server/"
5755
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse2/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
58-
- bash-tools:/usr/bin/bash-tools
56+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
5957
depends_on:
6058
zookeeper1:
6159
condition: service_healthy
@@ -69,7 +67,7 @@ services:
6967
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse3/database/:/var/lib/clickhouse/"
7068
- "${CLICKHOUSE_TESTS_DIR}/_instances/clickhouse3/logs/:/var/log/clickhouse-server/"
7169
- "${CLICKHOUSE_TESTS_DIR}/configs/clickhouse3/config.d/macros.xml:/etc/clickhouse-server/config.d/macros.xml"
72-
- bash-tools:/usr/bin/bash-tools
70+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
7371
depends_on:
7472
zookeeper1:
7573
condition: service_healthy
@@ -93,7 +91,6 @@ services:
9391
ports:
9492
- "8080"
9593
tty: true
96-
init: true
9794
depends_on:
9895
- proxy1
9996
- proxy2
@@ -137,7 +134,7 @@ services:
137134
file: ../../docker-compose/bash-tools.yml
138135
service: bash-tools
139136
volumes:
140-
- bash-tools:/usr/bin
137+
- "${CLICKHOUSE_TESTS_DIR}/_instances/share:/share"
141138

142139
# dummy service which does nothing, but allows to postpone
143140
# 'docker-compose up -d' till all dependencies will go healthy

alter/table/attach_partition/corrupted_partitions.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@
2525
def corrupt_parts_on_table_partition(self, table_name, parts, bits_to_corrupt=1500000):
2626
"""Corrupt the selected part file."""
2727
node = self.context.node
28+
bash_tools = self.context.cluster.node("bash-tools")
2829

2930
with By(
3031
f"executing a corrupt_file script that will flip {bits_to_corrupt} bits on the {parts} part of the {table_name} table"
3132
):
3233
for part in parts:
34+
original_path = f"/var/lib/clickhouse/data/default/{table_name}/{part}/"
35+
temp_path = f"/share/corrupt_files/{table_name}/{part}/"
36+
3337
node.command(
34-
"/usr/bin/bash-tools/python3 /usr/bin/corrupt_file "
35-
f"/var/lib/clickhouse/data/default/{table_name}/{part}/data.bin {bits_to_corrupt}",
36-
message="Corrupted",
38+
f"mkdir -p {temp_path} && cp {original_path}data.bin {temp_path}"
3739
)
40+
bash_tools.command(f"corrupt_file {temp_path}data.bin {bits_to_corrupt}")
41+
node.command(f"cp {temp_path}data.bin {original_path}")
3842

3943

4044
@TestStep(When)
@@ -43,17 +47,23 @@ def corrupt_parts_on_table_partition_detached(
4347
):
4448
"""Corrupt the selected part file."""
4549
node = self.context.node
50+
bash_tools = self.context.cluster.node("bash-tools")
4651

4752
with By(
4853
f"executing a corrupt_file script that will flip {bits_to_corrupt} bits on the {parts} part of the {table_name} table"
4954
):
50-
55+
node.command("mkdir -p /share/corrupt_files/" + table_name)
5156
for part in parts:
57+
original_path = (
58+
f"/var/lib/clickhouse/data/default/{table_name}/detached/{part}/"
59+
)
60+
temp_path = f"/share/corrupt_files/{table_name}/detached/{part}/"
61+
5262
node.command(
53-
"/usr/bin/bash-tools/python3 /usr/bin/corrupt_file "
54-
f"/var/lib/clickhouse/data/default/{table_name}/detached/{part}/data.bin {bits_to_corrupt}",
55-
message="Corrupted",
63+
f"mkdir -p {temp_path} && cp {original_path}data.bin {temp_path}"
5664
)
65+
bash_tools.command(f"corrupt_file {temp_path}data.bin {bits_to_corrupt}")
66+
node.command(f"cp {temp_path}data.bin {original_path}")
5767

5868

5969
@TestCheck

alter/table/replace_partition/corrupted_partitions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616
def corrupt_parts_on_table_partition(self, table_name, parts, bits_to_corrupt=1500000):
1717
"""Corrupt the selected part file."""
1818
node = self.context.node
19+
bash_tools = self.context.cluster.node("bash-tools")
1920

2021
with By(
2122
f"executing a corrupt_file script that will flip {bits_to_corrupt} bits on the {parts} part of the {table_name} table"
2223
):
2324
for part in parts:
25+
original_path = f"/var/lib/clickhouse/data/default/{table_name}/{part}/"
26+
temp_path = f"/share/corrupt_files/{table_name}/{part}/"
27+
2428
node.command(
25-
"/usr/bin/bash-tools/python3 /usr/bin/corrupt_file "
26-
f"/var/lib/clickhouse/data/default/{table_name}/{part}/data.bin {bits_to_corrupt}",
27-
message="Corrupted",
29+
f"mkdir -p {temp_path} && cp {original_path}data.bin {temp_path}"
2830
)
31+
bash_tools.command(f"corrupt_file {temp_path}data.bin {bits_to_corrupt}")
32+
node.command(f"cp {temp_path}data.bin {original_path}")
2933

3034

3135
@TestCheck

0 commit comments

Comments
 (0)