diff --git a/changelogs/fragments/rds_cluster_split_functional_tests.yaml b/changelogs/fragments/rds_cluster_split_functional_tests.yaml new file mode 100644 index 00000000000..ebe82f334a7 --- /dev/null +++ b/changelogs/fragments/rds_cluster_split_functional_tests.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: +- "rds_cluster - Split up the functional tests in smaller targets (https://github.com/ansible-collections/amazon.aws/pull/1175)." diff --git a/tests/integration/targets/rds_cluster/inventory b/tests/integration/targets/rds_cluster/inventory deleted file mode 100644 index 1acd8642050..00000000000 --- a/tests/integration/targets/rds_cluster/inventory +++ /dev/null @@ -1,23 +0,0 @@ -[tests] -# basic rds_cluster cretion tests -create - -# restore cluster tests -restore - -# TODO: Cannot be tested in the CI because: -# An error occurred (InvalidParameterValue) when calling the CreateDBCluster operation: Replication from cluster in same region is not supported -# promote - -# security groups db tests -create_sgs - -# basic modify operations applied on the rds cluster -modify - -# tag rds cluster test -tag - -[all:vars] -ansible_connection=local -ansible_python_interpreter="{{ ansible_playbook_python }}" diff --git a/tests/integration/targets/rds_cluster/main.yml b/tests/integration/targets/rds_cluster/main.yml deleted file mode 100644 index 2674f426818..00000000000 --- a/tests/integration/targets/rds_cluster/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/rds_cluster/tasks/ - -- hosts: all - gather_facts: no - strategy: free - serial: 6 - roles: - - rds_cluster diff --git a/tests/integration/targets/rds_cluster/meta/main.yml b/tests/integration/targets/rds_cluster/meta/main.yml deleted file mode 100644 index 32cf5dda7ed..00000000000 --- a/tests/integration/targets/rds_cluster/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml deleted file mode 100644 index 73b314ff7c7..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- \ No newline at end of file diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml deleted file mode 100644 index 55f8a551e02..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: rds_cluster integration tests - module_defaults: - group/aws: - region: '{{ aws_region }}' - aws_access_key: '{{ aws_access_key }}' - aws_secret_key: '{{ aws_secret_key }}' - security_token: '{{ security_token | default(omit) }}' - - block: - - include: ./test_{{ inventory_hostname }}.yml diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml deleted file mode 100644 index ed97d539c09..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/tests/integration/targets/rds_cluster/runme.sh b/tests/integration/targets/rds_cluster/runme.sh deleted file mode 100755 index 21720b263e1..00000000000 --- a/tests/integration/targets/rds_cluster/runme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/rds_cluster/tasks/ - - -set -eux - -export ANSIBLE_ROLES_PATH=../ - -ansible-playbook main.yml -i inventory "$@" diff --git a/tests/integration/targets/rds_cluster/aliases b/tests/integration/targets/rds_cluster_create/aliases similarity index 56% rename from tests/integration/targets/rds_cluster/aliases rename to tests/integration/targets/rds_cluster_create/aliases index 6e9f239e073..7896bb85374 100644 --- a/tests/integration/targets/rds_cluster/aliases +++ b/tests/integration/targets/rds_cluster_create/aliases @@ -1,5 +1,4 @@ -time=10m - +time=20m cloud/aws - +rds_cluster rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_create/defaults/main.yml b/tests/integration/targets/rds_cluster_create/defaults/main.yml new file mode 100644 index 00000000000..bd2dbf8c39a --- /dev/null +++ b/tests/integration/targets/rds_cluster_create/defaults/main.yml @@ -0,0 +1,11 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-cluster-{{ tiny_prefix }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml b/tests/integration/targets/rds_cluster_create/tasks/main.yaml similarity index 94% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml rename to tests/integration/targets/rds_cluster_create/tasks/main.yaml index 54b3143ffd4..ce507cb8e68 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml +++ b/tests/integration/targets/rds_cluster_create/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_create_sgs/aliases b/tests/integration/targets/rds_cluster_create_sgs/aliases new file mode 100644 index 00000000000..7896bb85374 --- /dev/null +++ b/tests/integration/targets/rds_cluster_create_sgs/aliases @@ -0,0 +1,4 @@ +time=20m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/defaults/main.yml b/tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml similarity index 57% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/defaults/main.yml rename to tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml index 173425336e8..a773a635f7a 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/defaults/main.yml +++ b/tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml @@ -1,26 +1,11 @@ # defaults file for rds_cluster # Create cluster -cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix - }} +cluster_id: ansible-test-cluster-{{ tiny_prefix }} username: testrdsusername password: test-rds_password engine: aurora port: 3306 -tags_create: - Name: ansible-test-cluster-{{ tiny_prefix }} - Created_By: Ansible_rds_cluster_integration_test - -# Modify cluster -new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new -new_port: 1155 -new_password: test-rds_password-new -new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new - -# Tag cluster -tags_patch: - Name: '{{ tiny_prefix }}-new' - Created_by: Ansible rds_cluster integration tests # Create cluster in a VPC vpc_name: ansible-test-vpc-{{ tiny_prefix }} diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml similarity index 97% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml rename to tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml index c2479e112e8..996bc6c1481 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml +++ b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_modify/aliases b/tests/integration/targets/rds_cluster_modify/aliases new file mode 100644 index 00000000000..7896bb85374 --- /dev/null +++ b/tests/integration/targets/rds_cluster_modify/aliases @@ -0,0 +1,4 @@ +time=20m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_modify/defaults/main.yml b/tests/integration/targets/rds_cluster_modify/defaults/main.yml new file mode 100644 index 00000000000..073f7a4c000 --- /dev/null +++ b/tests/integration/targets/rds_cluster_modify/defaults/main.yml @@ -0,0 +1,14 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-cluster-{{ tiny_prefix }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml similarity index 98% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml rename to tests/integration/targets/rds_cluster_modify/tasks/main.yaml index cfec27ab554..428bb4d450a 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml +++ b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_promote/aliases b/tests/integration/targets/rds_cluster_promote/aliases new file mode 100644 index 00000000000..dd7b70052c6 --- /dev/null +++ b/tests/integration/targets/rds_cluster_promote/aliases @@ -0,0 +1,7 @@ +# TODO: Cannot be tested in the CI because: +# An error occurred (InvalidParameterValue) when calling the CreateDBCluster operation: Replication from cluster in same region is not supported +disabled +time=20m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_promote/defaults/main.yml b/tests/integration/targets/rds_cluster_promote/defaults/main.yml new file mode 100644 index 00000000000..3d0bd924ea7 --- /dev/null +++ b/tests/integration/targets/rds_cluster_promote/defaults/main.yml @@ -0,0 +1,8 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-cluster-{{ tiny_prefix }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml similarity index 96% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml rename to tests/integration/targets/rds_cluster_promote/tasks/main.yaml index 8443063add8..1d57aac5e63 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml +++ b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_restore/aliases b/tests/integration/targets/rds_cluster_restore/aliases new file mode 100644 index 00000000000..7896bb85374 --- /dev/null +++ b/tests/integration/targets/rds_cluster_restore/aliases @@ -0,0 +1,4 @@ +time=20m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_restore/defaults/main.yml b/tests/integration/targets/rds_cluster_restore/defaults/main.yml new file mode 100644 index 00000000000..3d0bd924ea7 --- /dev/null +++ b/tests/integration/targets/rds_cluster_restore/defaults/main.yml @@ -0,0 +1,8 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-cluster-{{ tiny_prefix }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml similarity index 97% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml rename to tests/integration/targets/rds_cluster_restore/tasks/main.yaml index b991a457baf..b1934f3223b 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml +++ b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml index a105044d9ca..43f4cebc0b3 100644 --- a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml +++ b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml @@ -7,7 +7,6 @@ security_token: "{{ security_token | default(omit) }}" collections: - amazon.aws - block: - name: Create a source DB cluster rds_cluster: @@ -89,7 +88,7 @@ - "'engine' in _result_cluster_snapshot" - _result_cluster_snapshot.engine == "{{ engine }}" # - "'engine_mode' in _result_cluster_snapshot" - # - _result_cluster_snapshot.engine_mode == "provisioned" + # - _result_cluster_snapshot.engine_mode == "serverless" - "'engine_version' in _result_cluster_snapshot" - "'iam_database_authentication_enabled' in _result_cluster_snapshot" - "'license_model' in _result_cluster_snapshot" @@ -181,7 +180,7 @@ - "'engine' in _result_cluster_snapshot" - _result_cluster_snapshot.engine == "{{ engine }}" # - "'engine_mode' in _result_cluster_snapshot" - # - _result_cluster_snapshot.engine_mode == "provisioned" + # - _result_cluster_snapshot.engine_mode == "serverless" - "'engine_version' in _result_cluster_snapshot" - "'iam_database_authentication_enabled' in _result_cluster_snapshot" - "'license_model' in _result_cluster_snapshot" @@ -259,7 +258,7 @@ - "'engine' in _result_cluster_snapshot" - _result_cluster_snapshot.engine == "{{ engine }}" # - "'engine_mode' in _result_cluster_snapshot" - # - _result_cluster_snapshot.engine_mode == "provisioned" + # - _result_cluster_snapshot.engine_mode == "serverless" - "'engine_version' in _result_cluster_snapshot" - "'iam_database_authentication_enabled' in _result_cluster_snapshot" - "'license_model' in _result_cluster_snapshot" @@ -314,7 +313,7 @@ - "'engine' in _result_cluster_snapshot" - _result_cluster_snapshot.engine == "{{ engine }}" # - "'engine_mode' in _result_cluster_snapshot" - # - _result_cluster_snapshot.engine_mode == "provisioned" + # - _result_cluster_snapshot.engine_mode == "serverless" - "'engine_version' in _result_cluster_snapshot" - "'iam_database_authentication_enabled' in _result_cluster_snapshot" - "'license_model' in _result_cluster_snapshot" @@ -354,7 +353,7 @@ - "'engine' in _result_cluster_snapshot" - _result_cluster_snapshot.engine == "{{ engine }}" # - "'engine_mode' in _result_cluster_snapshot" - # - _result_cluster_snapshot.engine_mode == "provisioned" + # - _result_cluster_snapshot.engine_mode == "serverless" - "'engine_version' in _result_cluster_snapshot" - "'iam_database_authentication_enabled' in _result_cluster_snapshot" - "'license_model' in _result_cluster_snapshot" diff --git a/tests/integration/targets/rds_cluster_tag/aliases b/tests/integration/targets/rds_cluster_tag/aliases new file mode 100644 index 00000000000..7896bb85374 --- /dev/null +++ b/tests/integration/targets/rds_cluster_tag/aliases @@ -0,0 +1,4 @@ +time=20m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_tag/defaults/main.yml b/tests/integration/targets/rds_cluster_tag/defaults/main.yml new file mode 100644 index 00000000000..4469db9eb81 --- /dev/null +++ b/tests/integration/targets/rds_cluster_tag/defaults/main.yml @@ -0,0 +1,17 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-cluster-{{ tiny_prefix }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test +new_password: test-rds_password-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml similarity index 98% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml rename to tests/integration/targets/rds_cluster_tag/tasks/main.yaml index be0fa3ee385..70d84ada78d 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml +++ b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}'