Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/github_issue/tasks/main.yml

raw
1 ####################################################################
2 # WARNING: These are designed specifically for Ansible tests #
3 # and should not be used as examples of how to write Ansible roles #
4 ####################################################################
5
6 # Test code for the github_issue module.
7 #
8 # Copyright (c) 2017-2018, Abhijeet Kasurde <[email protected]>
9 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
10 # SPDX-License-Identifier: GPL-3.0-or-later
11
12 - name: Check if GitHub issue is closed or not
13 github_issue:
14 organization: "{{ organization }}"
15 repo: "{{ repo }}"
16 issue: "{{ issue }}"
17 action: get_status
18 register: get_status_0002
19
20 - assert:
21 that:
22 - get_status_0002 is changed
23 - get_status_0002.issue_status == 'closed'
24
25 - name: Check if GitHub issue is closed or not
26 github_issue:
27 organization: "{{ organization }}"
28 repo: "{{ repo }}"
29 issue: "{{ non_existent_issue }}"
30 action: get_status
31 register: get_status_0003
32 ignore_errors: true
33
34 - assert:
35 that:
36 - get_status_0003 is not changed
37 - get_status_0003 is failed
38 - "'Failed' in get_status_0003.msg"