Skip to content

Commit

Permalink
Added integration testing against more versions of ClickHouse (ansibl…
Browse files Browse the repository at this point in the history
…e-collections#22)

* Added integration testing against more versions of ClickHouse

* Fixing tests based on different versions

* Fixing errors when running tests

* Fixing errors when running tests

---------

Co-authored-by: aleksvagachev <aleksvagachev@yandex.ru>
  • Loading branch information
aleksvagachev and aleksvagachev authored Feb 8, 2024
1 parent 56f7e51 commit 9ea2763
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ansible-test-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
schedule:
- cron: '0 6 * * *'

env:
clickhouse_version_file: "./ansible_collections/community/clickhouse/tests/integration/targets/setup_clickhouse/vars/main.yml"
clickhouse_test_info_file: "./ansible_collections/community/clickhouse/tests/integration/targets/clickhouse_info/tasks/initial.yml"

jobs:
sanity:
name: "Sanity (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }})"
Expand Down Expand Up @@ -97,6 +101,10 @@ jobs:
#- stable-2.15
#- stable-2.16
#- devel
clickhouse:
- 21.8.15.7
- 22.8.9.24
- 23.8.9.54
python:
- "3.10"
steps:
Expand All @@ -114,6 +122,13 @@ jobs:
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Set Clickhouse version (${{ matrix.clickhouse }})
run: "sed -i 's/^clickhouse_version:.*/clickhouse_version: \"${{ matrix.clickhouse }}\"/g' ${{ env.clickhouse_version_file }}"

- name: Set Clickhouse version (${{ matrix.clickhouse }})
run: "sed -i 's/test_shard_localhost/default/g' ${{ env.clickhouse_test_info_file }}"
if: ${{ matrix.clickhouse == '23.8.9.54' }}

- name: Run integration tests
run: ansible-test integration --docker ubuntu2204 -v --color --retry-on-error --continue-on-error --python ${{ matrix.python }} --diff --coverage
working-directory: ./ansible_collections/community/clickhouse
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/targets/setup_clickhouse/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
- name: Install clickhouse
ansible.builtin.apt:
name:
- "clickhouse-server={{ server_version }}"
- "clickhouse-client={{ server_version }}"
- "clickhouse-common-static={{ server_version }}"
- "clickhouse-server={{ clickhouse_version }}"
- "clickhouse-client={{ clickhouse_version }}"
- "clickhouse-common-static={{ clickhouse_version }}"
state: present

- name: Copy settings for default user
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/setup_clickhouse/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
server_version: 21.8.15.7
clickhouse_version: 21.8.15.7

0 comments on commit 9ea2763

Please sign in to comment.