Skip to content

Commit

Permalink
randomize short description
Browse files Browse the repository at this point in the history
  • Loading branch information
tupyy committed Apr 11, 2024
1 parent ad0fba8 commit 8e09e5a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tests/integration/targets/change_request_task/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
- change_request_result.record.risk == "low"
- change_request_result.record.impact == "low"

- ansible.builtin.set_fact:
prefix: "{{ lookup('password', '/dev/null chars=ascii_letters,digit length=8') | lower }}"

- name: Create test change_request_task - check mode
servicenow.itsm.change_request_task: &create-change_request_task
change_request_number: "{{ change_request_result.record.number }}"
type: planning
state: pending
short_description: "Implement collision avoidance"
short_description: "{{ prefix }} Implement collision avoidance"
description: "Implement collision avoidance based on the newly installed TOF sensor arrays."
other:
approval: approved
Expand All @@ -43,7 +45,7 @@
- result.record.change_request == change_request_result.record.sys_id
- result.record.change_task_type == "planning"
- result.record.state == "pending"
- result.record.short_description == "Implement collision avoidance"
- prefix in result.record.short_description
- result.record.description == "Implement collision avoidance based on the newly installed TOF sensor arrays."
- result.record.approval == "approved"

Expand All @@ -69,7 +71,7 @@
- result.records[0].change_request == change_request_result.record.sys_id
- result.records[0].change_task_type == "planning"
- result.records[0].state == "pending"
- result.records[0].short_description == "Implement collision avoidance"
- prefix in result.records[0].short_description
- result.records[0].description == "Implement collision avoidance based on the newly installed TOF sensor arrays."
- result.records[0].approval == "approved"

Expand Down Expand Up @@ -124,7 +126,7 @@
- ansible.builtin.assert: &update-change_request_task-result
that:
- result is changed
- result.record.short_description == "Implement collision avoidance"
- prefix in result.record.short_description
- result.record.state == "in_progress"
- result.record.description == "Something changed"
- result.record.change_task_type == "planning"
Expand All @@ -143,7 +145,7 @@

- ansible.builtin.assert:
that:
- result.records[0].short_description == "Implement collision avoidance"
- prefix in result.records[0].short_description
- result.records[0].state == "in_progress"
- result.records[0].description == "Something changed"
- result.records[0].change_task_type == "planning"
Expand Down Expand Up @@ -332,12 +334,13 @@
- name: Get change_request_task info by sysparm query - short_description
servicenow.itsm.change_request_task_info:
query:
- short_description: LIKE Implement
- short_description: "LIKE {{ prefix }}"
register: result


- ansible.builtin.assert:
that:
- "'Implement collision' in result.records[0].short_description"
- prefix in result.records[0].short_description

- name: Test bad parameter combinator (number + query)
servicenow.itsm.change_request_task_info:
Expand Down Expand Up @@ -425,13 +428,16 @@
register: change_request_result


- ansible.builtin.set_fact:
prefix: "{{ lookup('password', '/dev/null chars=ascii_letters,digit length=8') | lower }}"

- name: Create test change_request_task
servicenow.itsm.change_request_task:
change_request_number: "{{ change_request_result.record.number }}"
type: planning
state: open
assignment_group: Network
short_description: "Implement collision avoidance"
short_description: "{{ prefix }} Implement collision avoidance"
description: "Implement collision avoidance based on the newly installed TOF sensor arrays."
other:
approval: approved
Expand All @@ -440,7 +446,6 @@
- ansible.builtin.debug:
var: change_request_task


- name: Make sure change_request_task exists
servicenow.itsm.change_request_task_info:
number: "{{ change_request_task.record.number }}"
Expand Down

0 comments on commit 8e09e5a

Please sign in to comment.