Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql: move CI tests of *_owner, *_info, *_ping, *_query to separate targets #62500

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions test/integration/targets/postgresql/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ shippable/posix/group4
postgresql_db
postgresql_ext
postgresql_idx
postgresql_info
postgresql_lang
postgresql_membership
postgresql_owner
postgresql_pg_hba
postgresql_ping
postgresql_privs
postgresql_publication
postgresql_query
postgresql_schema
postgresql_sequence
postgresql_set
Expand Down
14 changes: 0 additions & 14 deletions test/integration/targets/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
# Test postgresql_idx module
- postgresql_idx.yml

# Test postgresql_query module
- postgresql_query.yml

# Test postgresql_tablespace module
- postgresql_tablespace.yml

Expand All @@ -49,9 +46,6 @@
# Test postgresql_privs
- postgresql_privs.yml

# Test postgresql_info module
- postgresql_info.yml

# Test postgresql_schema module
- postgresql_schema.yml

Expand All @@ -61,19 +55,11 @@
# Test postgresql_table module
- postgresql_table.yml

# Test postgresql_owner module
- postgresql_owner.yml

# Test postgres_pg_hba module
- postgresql_pg_hba.yml
loop_control:
loop_var: loop_item

# Test postgresql_ping module
- import_tasks: postgresql_ping.yml
vars:
db_name_nonexist: fake_db

# Test default_privs with target_role
- import_tasks: test_target_role.yml
when: postgres_version_resp.stdout is version('9.1', '>=')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/targets/postgresql_copy/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
dependencies:
- setup_postgresql_db
- setup_postgresql_db
2 changes: 1 addition & 1 deletion test/integration/targets/postgresql_copy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Initial CI test for postgresql_copy module
# Initial CI tests of postgresql_copy module
- import_tasks: postgresql_copy_initial.yml
when: postgres_version_resp.stdout is version('9.4', '>=')
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_info/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_info
skip/osx
2 changes: 2 additions & 0 deletions test/integration/targets/postgresql_info/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
db_default: postgres
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- setup_postgresql_db
2 changes: 2 additions & 0 deletions test/integration/targets/postgresql_info/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_info module
- import_tasks: postgresql_info_initial.yml
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_owner/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_owner
skip/osx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_tablespace_path: "/ssd"
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_owner/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- setup_postgresql_db
2 changes: 2 additions & 0 deletions test/integration/targets/postgresql_owner/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_owner module
- import_tasks: postgresql_owner_initial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,29 @@
query: "CREATE MATERIALIZED VIEW test_mat_view AS SELECT * FROM my_table"
when: postgres_version_resp.stdout is version('9.4', '>=')

# Create test tablespace:
- name: postgresql_owner - drop dir for test tablespace
become: yes
file:
path: "{{ test_tablespace_path }}"
state: absent
ignore_errors: yes

- name: postgresql_owner - disable selinux
become: yes
shell: setenforce 0
ignore_errors: yes

- name: postgresql_owner - create dir for test tablespace
become: yes
file:
path: "{{ test_tablespace_path }}"
state: directory
owner: "{{ pg_user }}"
group: "{{ pg_user }}"
mode: 0700
ignore_errors: yes

# Create test tablespace
- name: postgresql_owner - create a new tablespace called acme and set bob as an its owner
become_user: "{{ pg_user }}"
Expand All @@ -99,7 +122,7 @@
login_user: "{{ pg_user }}"
name: acme
owner: alice
location: /ssd
location: "{{ test_tablespace_path }}"

################
# Do main tests:
Expand Down
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_ping/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_ping
skip/osx
2 changes: 2 additions & 0 deletions test/integration/targets/postgresql_ping/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
db_default: postgres
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_ping/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- setup_postgresql_db
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_ping/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Initial CI tests of postgresql_ping module
- import_tasks: postgresql_ping_initial.yml
vars:
db_name_nonexist: fake_db
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_query/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_query
skip/osx
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_query/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- setup_postgresql_db
2 changes: 2 additions & 0 deletions test/integration/targets/postgresql_query/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_query module
- import_tasks: postgresql_query_initial.yml