generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for
digital_ocean_database_info
(#290)
- Loading branch information
Showing
4 changed files
with
22 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 @@ | ||
minor_changes: | ||
- integration tests - add a dedicated integration test for C(digital_ocean_database_info) (https://github.com/ansible-collections/community.digitalocean/issues/289). |
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions
20
tests/integration/targets/digital_ocean_database_info/tasks/main.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,20 @@ | ||
--- | ||
- block: | ||
|
||
- name: Ensure API key is provided | ||
ansible.builtin.fail: | ||
msg: do_api_key should be defined in tests/integration/integration_config.yml | ||
when: | ||
- do_api_key is not defined | ||
- do_api_key | length == 0 | ||
|
||
- name: Fetch all databases | ||
community.digitalocean.digital_ocean_database_info: | ||
oauth_token: "{{ do_api_key }}" | ||
register: result | ||
|
||
- name: Ensure all databases found | ||
ansible.builtin.assert: | ||
that: | ||
- not result.changed | ||
- result.data is defined |