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('<?xml version="1.0" encoding="utf-8"?>\n'
'<testsuite errors="0" failures="0" '
'name="none" skips="0" tests="0" time="0">\n'
+ '<testcase />\n'
'</testsuite>\n')
except OSError:
logging.critical("Cannot create empty directory: " + results_folder)