-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for checking build status before deleting envs
- Loading branch information
1 parent
78cc6fe
commit 5fbca51
Showing
7 changed files
with
110 additions
and
2 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
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,19 @@ | ||
query environmentByKubernetesNamespaceName { | ||
environmentByKubernetesNamespaceName( | ||
kubernetesNamespaceName: "{{ namespace }}" | ||
){ | ||
deployments(limit: 1){ | ||
id | ||
name | ||
status | ||
bulkId | ||
bulkName | ||
priority | ||
started | ||
created | ||
completed | ||
sourceUser | ||
sourceType | ||
} | ||
} | ||
} |
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,53 @@ | ||
- name: "{{ testname }} - Verify that status are correct" | ||
block: | ||
- ansible.builtin.include_tasks: admin-token.yaml | ||
- name: "{{ testname }} - POST api check latest deployment {{ graphql_url }}" | ||
uri: | ||
url: "{{ graphql_url }}" | ||
method: POST | ||
headers: | ||
Authorization: "Bearer {{ admin_token }}" | ||
body_format: json | ||
body: | ||
query: '{{ lookup("template", "./get-latest-deployment-status.gql") }}' | ||
register: apiresponse | ||
until: | ||
- apiresponse.json.data.environmentByKubernetesNamespaceName.deployments[0].status is defined | ||
retries: 30 | ||
delay: 10 | ||
|
||
- ansible.builtin.include_tasks: admin-token.yaml | ||
- name: "{{ testname }} - POST api check latest deployment {{ graphql_url }}" | ||
uri: | ||
url: "{{ graphql_url }}" | ||
method: POST | ||
headers: | ||
Authorization: "Bearer {{ admin_token }}" | ||
body_format: json | ||
body: | ||
query: '{{ lookup("template", "./get-latest-deployment-status.gql") }}' | ||
register: apiresponse | ||
|
||
- name: "{{ testname }} - POST api check response {{ graphql_url }}" | ||
debug: | ||
msg: "api response: {{ apiresponse.json }}" | ||
|
||
- ansible.builtin.include_tasks: admin-token.yaml | ||
- name: "{{ testname }} - POST api check latest deployment status are correct {{ graphql_url }}" | ||
uri: | ||
url: "{{ graphql_url }}" | ||
method: POST | ||
headers: | ||
Authorization: "Bearer {{ admin_token }}" | ||
body_format: json | ||
body: | ||
query: '{{ lookup("template", "./get-latest-deployment-status.gql") }}' | ||
register: apiresponse | ||
until: | ||
- apiresponse.json.data.environmentByKubernetesNamespaceName.deployments[0].status == buildStatus | ||
retries: 60 | ||
delay: 10 | ||
|
||
- name: "{{ testname }} - POST api check response {{ graphql_url }}" | ||
debug: | ||
msg: "api response: {{ apiresponse.json }}" |
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
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
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
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