#164 testing-farm-run-test: fix result logic
Merged by zuul. Opened by efedin.
efedin/fedora-zuul-jobs fix-testing-farm-run-test  into  master

Download 164.patch
no initial comment

Build succeeded.

Build succeeded.

The patch fixes the case of failed tests due to error in repository or tests marked as passed. No tmt case is now marked as failed. Also, it changes the end of playbook, so in case of unknown issue, the playbook fails as well.
Examples:

== Bad case (Repository has no tmt tests)
PLAY [tesst] ********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
ok: [localhost]
TASK [Test] *********************************************************************************************************
TASK [testing-farm-run-test : trigger a Testing Farm test] **********************************************************
ok: [localhost]
TASK [testing-farm-run-test : debug] ********************************************************************************
ok: [localhost] => {
    "msg": "Request URL: <TRUNCATED>"
}
TASK [testing-farm-run-test : wait until the state is complete or error] ********************************************
FAILED - RETRYING: [localhost]: wait until the state is complete or error (720 retries left).
ok: [localhost]
TASK [testing-farm-run-test : Testing Farm API request response] ****************************************************
ok: [localhost] => {
    "response": {
<TRUNCATED>
}
TASK [testing-farm-run-test : Testing Farm artifacts] ***************************************************************
ok: [localhost] => {
    "msg": "See <TRUNCATED> for detailed results"
}
TASK [testing-farm-run-test : Check the result for timeout] *********************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check the result for error] ***********************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check the result for testing error] ***************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Testing Farm unable to test artifacts. Failed to list plans, TMT metadata are absent or corrupted."}
PLAY RECAP **********************************************************************************************************
localhost                  : ok=6    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0
== Good case
PLAY [tesst] ********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
ok: [localhost]
TASK [Test] *********************************************************************************************************
TASK [testing-farm-run-test : trigger a Testing Farm test] **********************************************************
ok: [localhost]
TASK [testing-farm-run-test : debug] ********************************************************************************
ok: [localhost] => {
    "msg": "Request URL: <TRUNCATED>"
}
TASK [testing-farm-run-test : wait until the state is complete or error] ********************************************
ok: [localhost]
TASK [testing-farm-run-test : Testing Farm API request response] ****************************************************
ok: [localhost] => {
    "response": {
<TRUNCATED>
}
TASK [testing-farm-run-test : Testing Farm artifacts] ***************************************************************
ok: [localhost] => {
    "msg": "See <TRUNCATED> for detailed results"
}
TASK [testing-farm-run-test : Check the result for timeout] *********************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check the result for error] ***********************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check the result for testing error] ***************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check the result for failure] *********************************************************
skipping: [localhost]
TASK [testing-farm-run-test : Check if testing passed] **************************************************************
ok: [localhost] => {
    "msg": "Tests have passed"
}
TASK [testing-farm-run-test : Check for unknown state] **************************************************************
skipping: [localhost]
PLAY RECAP **********************************************************************************************************
localhost                  : ok=7    changed=0    unreachable=0    failed=0    skipped=5    rescued=0    ignored=0

rebased onto e98ade7733b95869d6c889232ea401e977b2275a

Build succeeded.

@efedin, unable to test artifacts sounds weird to me personally. In theory there might not be any artifacts, just the repo with tmt metadata.

What about:

Invalid repository content. {{ response.json.result.summary }}"

rebased onto 67102cc25b7d0526dc32bf0ad5289de93266da8d

@mvadkert thanks, fixed

Build succeeded.

Metadata Update from @mvadkert:
- Request assigned

Metadata Update from @mvadkert:
- Request assigned

Metadata Update from @mvadkert:
- Pull-request tagged with: gateit

Build succeeded (gate pipeline).

Pull-Request has been merged by zuul

Metadata