message: update tests to check the task status
diff: headers:
  Authorization: "Bearer {{ token }}"
  body_format: json
  - body: '{ "query": "mutation($projectName: String!) {deployActiveStandby(input:{project:{name:$projectName}})}", "variables": {"projectName":"{{ project }}"}}'
  + body: '{ "query": "mutation($projectName: String!) {deployActiveStandby(input:{project:{name:$projectName}}){id, remoteId}}", "variables": {"projectName":"{{ project }}"}}'
  register: apiresponse
  + until:
  - name: "{{ testname }} - POST api deployActiveStandby with target project {{ project }} (no sha) to {{ lookup('env','API_PROTOCOL') }}://{{ lookup('env','API_HOST') }}:{{ lookup('env','API_PORT') }}/graphql"
  debug:
  msg: "api response: {{ apiresponse.json }}"
  - - name: "{{ testname }} - pause"
  - pause:
  - seconds: 30
  \ No newline at end of file
  + - name: "{{ testname }} - POST api taskByRemoteId with remoteID {{ apiresponse.json.data.deployActiveStandby.remoteId }} for migration status to {{ lookup('env','API_PROTOCOL') }}://{{ lookup('env','API_HOST') }}:{{ lookup('env','API_PORT') }}/graphql"
  + uri:
  + url: "{{ lookup('env','API_PROTOCOL') }}://{{ lookup('env','API_HOST') }}:{{ lookup('env','API_PORT') }}/graphql"
  + method: POST
  + headers:
  + Authorization: "Bearer {{ token }}"
  + body_format: json
  + body: '{ "query": "query($remoteId: String!) {taskByRemoteId(id: $remoteId){status}}", "variables": {"remoteId":"{{ apiresponse.json.data.deployActiveStandby.remoteId }}"}}'
  + register: taskresult
  + until: taskresult.json.data.taskByRemoteId.status == "succeeded" or taskresult.json.data.taskByRemoteId.status == "failed"
  + retries: 10
  + delay: 5
  + - name: "{{ testname }} - fail if task fails"
  + fail:
  + msg: "The route migration failed for some reason"
  + when: taskresult.json.data.taskByRemoteId.status == "failed"
  \ No newline at end of file
  