From b1ff7ca373016a152e6490d0ebbb8a3f000b2e03 Mon Sep 17 00:00:00 2001 From: SungHun Hwang Date: Mon, 17 Apr 2017 14:25:18 +0900 Subject: [PATCH] Add image status check code to avoid unnecessary testing process If any image fails then skip test trigger Change-Id: I93c6077a40f45219ca74d7c5600959854501a490 Signed-off-by: SungHun Hwang --- job_post_image.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/job_post_image.py b/job_post_image.py index 736e8b7..cd9a888 100755 --- a/job_post_image.py +++ b/job_post_image.py @@ -107,7 +107,18 @@ def main(): if after_update_img_cnt == target_img_cnt: print '[%s] reached the target_img_cnt(%s)!! trigger BUILD-MONITOR(Post_Image)\n' \ % (__file__, target_img_cnt) - trigger_next("TEST-TRIGGER-INFO-UPDATE", checkinfo) + + # check whether the image status is failed or not + skip_test_trigger = False + for each_item in checkinfo["images"]: + if each_item["status"] == "failed": + skip_test_trigger = True + print 'name:%s, status:%s' % (each_item["name"], each_item["status"]) + + if not skip_test_trigger: + trigger_next("TEST-TRIGGER-INFO-UPDATE", checkinfo) + else: + print 'skip_test_trigger!!\n' if buildmonitor_enabled: #buildmonitor.end_create_image_for_sr_stage(bm_start_datetime, -- 2.7.4