Skip to content

Commit 0cf341d

Browse files
committed
Avoid malformed results xml
In case there are no results, the xml files get malformed. The malformed xml is then refused by polarion. This edits the code the way the xml and html results will be generated only in the case when the subunit was generated with 0 return code (successfull operation). https://issues.redhat.com/browse/OSPRH-9242
1 parent 3addfef commit 0cf341d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

container-images/tcib/base/os/tempest/run_tempest.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,10 @@ function generate_test_results {
364364
TEMPEST_LOGS_DIR=${TEMPEST_PATH}${TEMPEST_WORKFLOW_STEP_DIR_NAME}/
365365
mkdir -p ${TEMPEST_LOGS_DIR}
366366

367-
echo "Generate subunit"
368-
stestr last --subunit > ${TEMPEST_LOGS_DIR}testrepository.subunit || true
369-
370-
echo "Generate subunit xml file"
371-
subunit2junitxml ${TEMPEST_LOGS_DIR}testrepository.subunit > ${TEMPEST_LOGS_DIR}tempest_results.xml || true
372-
373-
echo "Generate html result"
374-
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html || true
367+
echo "Generate subunit, then xml and html results"
368+
stestr last --subunit > ${TEMPEST_LOGS_DIR}testrepository.subunit \
369+
&& (subunit2junitxml ${TEMPEST_LOGS_DIR}testrepository.subunit > ${TEMPEST_LOGS_DIR}tempest_results.xml || true) \
370+
&& subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html || true
375371

376372
# NOTE: Remove cirros image before copying of the logs.
377373
rm ${TEMPEST_DIR}/etc/*.img

0 commit comments

Comments
 (0)