[qe-pipelines] improve handling when testing-farm returns error due to Failed to get list of plans

Currently we report pass on request submit job, but in the report results we fail, because there is no results.xml to parse.

As this problem could happen due to some infra issue on testing-farm side I think we could just retry the submit job if it errors due to result.summary: Failed to discover tests, TMT metadata are absent or corrupted

https://gitlab.com/redhat/red-hat-ci-tools/kernel/qe-pipelines/kernel-ci-pipelines/-/jobs/10808927419

reporting results of testing farm request e1bd847f-04f4-4542-b802-471d42ffe442
+ curl --retry 50 https://api.dev.testing-farm.io/v0.1/requests/e1bd847f-04f4-4542-b802-471d42ffe442
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2236  100  2236    0     0  17218      0 --:--:-- --:--:-- --:--:-- 17333
++ jq -r .result.xunit_url
+ xunit_url=null
+ [[ null == \n\u\l\l ]]
++ jq -r .run.artifacts
+ xunit_url=https://artifacts.osci.redhat.com/testing-farm/e1bd847f-04f4-4542-b802-471d42ffe442
+ [[ https://artifacts.osci.redhat.com/testing-farm/e1bd847f-04f4-4542-b802-471d42ffe442 == \n\u\l\l ]]
+ xunit_url=https://artifacts.osci.redhat.com/testing-farm/e1bd847f-04f4-4542-b802-471d42ffe442/results.xml
+ sleep 60
+ curl --retry 50 https://artifacts.osci.redhat.com/testing-farm/e1bd847f-04f4-4542-b802-471d42ffe442/results.xml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   196  100   196    0     0   9498      0 --:--:-- --:--:-- --:--:--  9800
++ eval echo kernel-qe-ci-gate-rhel-10-1-1945338912
+++ echo kernel-qe-ci-gate-rhel-10-1-1945338912
+ DW_CHECKOUT=kernel-qe-ci-gate-rhel-10-1-1945338912
+ contacts=()
+ for contact in ${JOB_NOTIFY}
+ contacts+=(--contact "${contact}"@redhat.com)
+ build_issuer=()
+ build_report_rules=()
+ build_taskid=()
+ [[ -z '' ]]
+ [[ '' == \1 ]]
+ koji --noauth --server https://brewhub.engineering.redhat.com/brewhub call --json-output getBuild kernel-6.12.0-113.el10
+ [[ -f build.json ]]
+ [[ '' == \1 ]]
++ jq -r .task_id
+ taskid=68388930
+ build_taskid+=(--brew-task-id "${taskid}")
+ kcidb_tool_params=(create --arch "${TEST_ARCH:?}" --builds-origin "${TEST_JOB_NAME:?}" --checkout "${DW_CHECKOUT}" --checkout-origin "${TEST_JOB_NAME:?}" --distro "${OS_DISTRO:?}" --input results.xml --nvr "${TEST_PACKAGE_NVR}" --output output.json --source testing-farm --src-nvr "${TEST_SOURCE_PACKAGE_NVR}" "${contacts[@]}" --tests-origin "${TEST_JOB_NAME:?}" --tests-provisioner-url "${CI_PIPELINE_URL:?}" "${build_issuer[@]}" "${build_report_rules[@]}" "${build_taskid[@]}")
+ kcidb_tool create --arch aarch64 --builds-origin kernel_tier1 --checkout kernel-qe-ci-gate-rhel-10-1-1945338912 --checkout-origin kernel_tier1 --distro rhel-10.1 --input results.xml --nvr kernel-rt-64k-debug-6.12.0-113.el10 --output output.json --source testing-farm --src-nvr kernel-6.12.0-113.el10 --contact bgoncalv@redhat.com --tests-origin kernel_tier1 --tests-provisioner-url https://gitlab.com/redhat/red-hat-ci-tools/kernel/qe-pipelines/kernel-ci-pipelines/-/pipelines/1945339346 --brew-task-id 68388930
Traceback (most recent call last):
  File "/usr/local/bin/kcidb_tool", line 33, in <module>
    sys.exit(load_entry_point('kernel-qe-tools', 'console_scripts', 'kcidb_tool')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/code/kernel_qe_tools/kcidb_tool/cli.py", line 63, in main
    function(*function_args)
    ~~~~~~~~^^^^^^^^^^^^^^^^
  File "/code/kernel_qe_tools/kcidb_tool/cmd_create.py", line 197, in main
    parser = TestingFarmParser(beaker_content, external_arguments)
  File "/code/kernel_qe_tools/kcidb_tool/testing_farm/parser.py", line 28, in __init__
    super().__init__(testing_farm_content, args)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/kernel_qe_tools/kcidb_tool/parser.py", line 26, in __init__
    self.root = ET.fromstring(test_runner_content)
                ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/xml/etree/ElementTree.py", line 1342, in XML
    parser.feed(text)
    ~~~~~~~~~~~^^^^^^
xml.etree.ElementTree.ParseError: syntax error: line 1, column 49

Jira: CKI-6449

Edited by CKI Bot