From: Igor Stoppa Date: Mon, 16 Jun 2014 10:51:33 +0000 (+0300) Subject: Create a tarball with the results of the testing. X-Git-Tag: 1.0~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4ee385b70383c613c872980c2020a1db6717f33;p=services%2Fjenkins-scripts.git Create a tarball with the results of the testing. Change-Id: Iebbbee94306e11a616fb3da2daa00fa3458eb968 --- diff --git a/job_test_build.py b/job_test_build.py index fb6c1e3..9187ecc 100755 --- a/job_test_build.py +++ b/job_test_build.py @@ -5,6 +5,7 @@ import os import sys import glob +import tarfile import subprocess from common.buildtrigger import trigger_info @@ -55,6 +56,20 @@ def test_image(image): dump_result(result, image) return result +def pack_results(results_folder): + """Creates a tarball containing the test results""" + if not results_folder: + return + print "Packing test results ... ", + try: + tar = tarfile.open("results.tar.gz", "w:gz") + tar.add(results_folder) + except (ValueError, OSError) as error: + print "failed." + print error + else: + print "done." + def main(): """The main body""" # Note: the script, by design, will not return errors @@ -68,7 +83,7 @@ def main(): return dump_result(test_image(image), image) - + pack_results(glob.glob("tztestrobot-results.*")[0]) if __name__ == "__main__": sys.exit(main())