forked from ansible-collections/community.clickhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bbd6c5
commit 3b98b1c
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dependencies: | ||
- setup_clickhouse |
48 changes: 48 additions & 0 deletions
48
tests/integration/targets/clickhouse_grants/tasks/initial.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#################################################################### | ||
# WARNING: These are designed specifically for Ansible tests # | ||
# and should not be used as examples of how to write Ansible roles # | ||
#################################################################### | ||
|
||
- name: Create a test dabase | ||
community.clickhouse.clickhouse_client: | ||
execute: CREATE DATABASE foo | ||
|
||
- name: Create a test table | ||
register: result | ||
community.clickhouse.clickhouse_client: | ||
login_host: localhost | ||
client_kwargs: | ||
connect_timeout: 20 | ||
execute: > | ||
CREATE TABLE IF NOT EXISTS foo.test_table_1 | ||
(id UInt64, x String) ENGINE = Memory | ||
execute_kwargs: | ||
types_check: false | ||
|
||
- name: Insert into test table using named args | ||
register: result | ||
community.clickhouse.clickhouse_client: | ||
execute: "INSERT INTO test_table_1 (x) VALUES (%(a)s), (%(b)s), (%(c)s)" | ||
execute_kwargs: | ||
params: | ||
a: one | ||
b: two | ||
c: three | ||
|
||
- name: Create a test user | ||
community.clickhouse.clickhouse_user: | ||
state: present | ||
name: alice | ||
password: querty | ||
|
||
- name: Check the user exists | ||
register: result | ||
community.clickhouse.clickhouse_info: | ||
login_host: localhost | ||
client_kwargs: | ||
connect_timeout: 20 | ||
|
||
- name: Check user's attributes | ||
ansible.builtin.assert: | ||
that: | ||
- result["users"]["alice"] != {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#################################################################### | ||
# WARNING: These are designed specifically for Ansible tests # | ||
# and should not be used as examples of how to write Ansible roles # | ||
#################################################################### | ||
|
||
# Initial CI tests of clickhouse_grants module | ||
- import_tasks: initial.yml |