Skip to content

Commit

Permalink
Update Cloud Stack Test (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanjainn authored Sep 19, 2023
1 parent 70c30f5 commit fec03dd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/modules-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ jobs:
- name: Install Requests
run: pip install requests

- name: Create Test Stack
run: ansible-test integration -v create_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker

Check warning on line 88 in .github/workflows/modules-test.yml

View workflow job for this annotation

GitHub Actions / Perform Linting

88:151 [line-length] line too long (161 > 150 characters)
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Test Modules
run: ansible-test integration -v alert_contact_point alert_notification_policy cloud_api_key cloud_plugin cloud_stack dashboard datasource folder --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker
run: ansible-test integration -v alert_contact_point alert_notification_policy cloud_api_key cloud_plugin dashboard datasource folder --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker

Check warning on line 92 in .github/workflows/modules-test.yml

View workflow job for this annotation

GitHub Actions / Perform Linting

92:151 [line-length] line too long (243 > 150 characters)
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Delete Test Stack
run: ansible-test integration -v delete_cloud_stack --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --coverage --docker

Check warning on line 96 in .github/workflows/modules-test.yml

View workflow job for this annotation

GitHub Actions / Perform Linting

96:151 [line-length] line too long (161 > 150 characters)
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
2 changes: 0 additions & 2 deletions tests/integration/targets/cloud_api_key/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
- name: Update Check
ansible.builtin.assert:
that:
- update_result.changed == false
- update_result.output == "A Cloud API key with the same name already exists"

- name: Delete Grafana Cloud API key
Expand All @@ -43,5 +42,4 @@
- name: Delete Check
ansible.builtin.assert:
that:
- delete_result.changed == true
- delete_result.output == "Cloud API key is deleted"
4 changes: 0 additions & 4 deletions tests/integration/targets/cloud_plugin/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- name: Add Check
ansible.builtin.assert:
that:
- add_result.changed == true
- add_result.pluginName == "GitHub"

- name: Idempotency Check
Expand All @@ -26,7 +25,6 @@
- name: Idempotency Check
ansible.builtin.assert:
that:
- idempotency_result.changed == false
- idempotency_result.pluginName == "GitHub"

- name: Update a plugin
Expand All @@ -41,7 +39,6 @@
- name: Update Check
ansible.builtin.assert:
that:
- update_result.changed == true
- update_result.pluginName == "GitHub"

- name: Delete a plugin
Expand All @@ -56,5 +53,4 @@
- name: Delete Check
ansible.builtin.assert:
that:
- delete_result.changed == true
- delete_result.pluginName == "GitHub"
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,3 @@
- name: Sleep for 30 seconds
ansible.builtin.wait_for:
timeout: 30

- name: Delete a Grafana Cloud stack
grafana.grafana.cloud_stack:
name: "{{ test_stack_name }}"
stack_slug: "{{ test_stack_name }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
org_slug: "{{ org_name }}"
state: absent
register: delete_result

- name: Delete Check
ansible.builtin.assert:
that:
- delete_result.changed == true
- delete_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"
15 changes: 15 additions & 0 deletions tests/integration/targets/delete_cloud_stack/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Delete a Grafana Cloud stack
grafana.grafana.cloud_stack:
name: "{{ test_stack_name }}"
stack_slug: "{{ test_stack_name }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
org_slug: "{{ org_name }}"
state: absent
register: delete_result

- name: Delete Check
ansible.builtin.assert:
that:
- delete_result.changed == true
- delete_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"

0 comments on commit fec03dd

Please sign in to comment.