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 *_tablespace, *_membership, *_idx to separate targets #62575

Merged
merged 2 commits into from
Sep 19, 2019
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
3 changes: 0 additions & 3 deletions test/integration/targets/postgresql/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ destructive
shippable/posix/group4
postgresql_db
postgresql_ext
postgresql_idx
postgresql_lang
postgresql_membership
postgresql_pg_hba
postgresql_privs
postgresql_publication
Expand All @@ -13,6 +11,5 @@ postgresql_sequence
postgresql_set
postgresql_slot
postgresql_table
postgresql_tablespace
postgresql_user
skip/osx
9 changes: 0 additions & 9 deletions test/integration/targets/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
# Verify different session_role scenarios
- session_role.yml

# Test postgresql_idx module
- postgresql_idx.yml

# Test postgresql_tablespace module
- postgresql_tablespace.yml

# Test postgresql_db module, specific options
- postgresql_db.yml

Expand All @@ -49,9 +43,6 @@
# Test postgresql_schema module
- postgresql_schema.yml

# Test postgresql_membership module
- postgresql_membership.yml

# Test postgresql_table module
- postgresql_table.yml

Expand Down
32 changes: 28 additions & 4 deletions test/integration/targets/postgresql/tasks/postgresql_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,37 @@

# Start tablespace option tests:
block:
# create tablespace for tests
- name: postgresql_db_tablespace - Create tablespace
<<: *task_parameters
# Preparation for tests.
- name: postgresql_db - drop dir for test tablespace
become: yes
become_user: root
file:
path: "{{ tblspc_location }}"
state: absent
ignore_errors: yes

- name: postgresql_db - disable selinux
become: yes
become_user: root
shell: setenforce 0
ignore_errors: yes

- name: postgresql_db - create dir for test tablespace
become: yes
become_user: root
file:
path: "{{ tblspc_location }}"
state: directory
owner: "{{ pg_user }}"
group: "{{ pg_user }}"
mode: 0700

# Create tablespace:
- name: postgresql_db_ - create a new tablespace
postgresql_tablespace:
<<: *pg_parameters
login_db: postgres
name: "{{ db_tablespace }}"
name: "{{ db_tablespace }}"
location: "{{ tblspc_location }}"

# Check mode for DB creation with tablespace option:
Expand Down
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_idx/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_idx
skip/osx
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_idx/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_idx/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_idx module
- import_tasks: postgresql_idx_initial.yml
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_membership/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_membership
skip/osx
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_membership/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_membership/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_membership module
- import_tasks: postgresql_membership_initial.yml
4 changes: 4 additions & 0 deletions test/integration/targets/postgresql_tablespace/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
destructive
shippable/posix/group4
postgresql_tablespace
skip/osx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
test_tablespace_path: "/ssd"
3 changes: 3 additions & 0 deletions test/integration/targets/postgresql_tablespace/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_tablespace/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initial CI tests of postgresql_tablespace module
- import_tasks: postgresql_tablespace_initial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- name: postgresql_tablespace - drop dir for test tablespace
become: yes
file:
path: /ssd
path: "{{ test_tablespace_path }}"
state: absent
ignore_errors: yes

Expand All @@ -17,7 +17,7 @@
- name: postgresql_tablespace - create dir for test tablespace
become: yes
file:
path: /ssd
path: "{{ test_tablespace_path }}"
state: directory
owner: "{{ pg_user }}"
group: "{{ pg_user }}"
Expand Down