From c4ef33baefde67d481f001e55b42eb4d3d01f2fc Mon Sep 17 00:00:00 2001 From: Igor Stoppa Date: Wed, 14 Jan 2015 12:40:46 +0200 Subject: [PATCH] Hack: add one empty test case to the empty results. Jenkins will not consider the empty results.xml if it is completely devoid of test results, so an empty test case is added. Change-Id: I58cddf30ae5207be24fb751c9b373ae5846d4ffb --- job_test_build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/job_test_build.py b/job_test_build.py index 5feed99..6f7e026 100755 --- a/job_test_build.py +++ b/job_test_build.py @@ -83,9 +83,15 @@ def create_empty_results(): try: os.makedirs(results_folder) with open(os.path.join(results_folder, "results.xml"), "w") as res: + # Note: XXX + # Jenkins will not accept a results.xml as valid JUnit file + # unless it contains at least one testcase, even if empty. + # Without it, the build will be marked as FAILED, which is + # incorrect in some cases, ex: unsupported image. res.write('\n' '\n' + '\n' '\n') except OSError: logging.critical("Cannot create empty directory: " + results_folder) -- 2.7.4