Skip to content

Commit

Permalink
Extend a test for no_restart rules
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-zaitsev committed Feb 28, 2025
1 parent 7c4fac6 commit dd896d2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/e2e/manifests/chi/test-055-chopconf-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ spec:
clusters:
- name: default
files:
config.d/test.xml: |
<yandex>
config.d/test_no_restart.xml: |
<clickhouse>
<macros>
<test>test</test>
</macros>
</yandex>
</clickhouse>
19 changes: 19 additions & 0 deletions tests/e2e/manifests/chi/test-055-chopconf-4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"

metadata:
name: test-055-chopconf

spec:
useTemplates:
- name: clickhouse-version
configuration:
clusters:
- name: default
files:
config.d/test_restart.xml: |
<yandex>
<macros>
<test>test</test>
</macros>
</yandex>
12 changes: 11 additions & 1 deletion tests/e2e/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5289,12 +5289,22 @@ def test_055(self):
res = clickhouse.query_with_error(chi, "select count() from test_055")
assert res != "0"

with When(f"Add configuration file that SHOULD NOT be ignored by restart rules"):
with When(f"Add another configuration file that SHOULD be ignored by restart rules"):
kubectl.create_and_check(
manifest="manifests/chi/test-055-chopconf-3.yaml",
check={"do_not_delete": 1},
)

with Then("ClickHouse SHOULD NOT be restarted"):
new_start_time = kubectl.get_clickhouse_start(chi)
assert start_time == new_start_time

with When(f"Add configuration file that SHOULD NOT be ignored by restart rules"):
kubectl.create_and_check(
manifest="manifests/chi/test-055-chopconf-4.yaml",
check={"do_not_delete": 1},
)

with Then("ClickHouse SHOULD be restarted"):
new_start_time = kubectl.get_clickhouse_start(chi)
assert start_time != new_start_time
Expand Down

0 comments on commit dd896d2

Please sign in to comment.