From: Junghyun Kim Date: Mon, 27 Feb 2017 00:31:29 +0000 (+0900) Subject: Update sr_stage table for testing X-Git-Tag: submit/trunk/20190927.012743~534^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F116511%2F1;p=services%2Fjenkins-scripts.git Update sr_stage table for testing Change-Id: Ia1aebaa766dc0aab52f4d62eac5964225277627d Signed-off-by: Junghyun Kim --- diff --git a/job_trbs_test_result_receiver.py b/job_trbs_test_result_receiver.py index add37cd..73d81fb 100644 --- a/job_trbs_test_result_receiver.py +++ b/job_trbs_test_result_receiver.py @@ -173,7 +173,7 @@ if __name__ == "__main__": "VALUES ( %(id)s, %(sr_status_id)s, %(ref_id)s, %(sr_name)s, %(snapshot_num)s, %(profile)s, %(plan_name)s, %(total)s, %(pass)s, %(fail)s, " "%(block)s, %(na)s, %(pcnt)s, %(time_start)s, %(time_end)s, %(build_id)s, %(device_id)s, %(device_model)s, %(device_name)s, " "%(device_host)s, %(manufacturer)s, %(tct_profile)s, %(tct_version)s, %(url)s )" ) - + try: value['sr_status_id'] = RESULT['sr_id'] @@ -334,7 +334,18 @@ if __name__ == "__main__": print "[Error] wrong data (", key, ") -", value + trbs_test_stage_id = 101 + cur_time = datetime.datetime.now() + insert_sr_stage_sql = "INSERT INTO sr_stage (sr_status_id, info_stage_id, stage_start_time, stage_end_time, stage_status, build_project_id) VALUES ( %s, %s, %s, %s, %s, %s)"; + insert_sr_stage_data = (RESULT['sr_id'], trbs_test_stage_id, cur_time, cur_time, 'S', RESULT['build_project_id'] ) + try: + query.execute(insert_sr_stage_sql, insert_sr_stage_data) + dbcon.commit(); + print "[Insert: sr_stage]" + str(insert_sr_stage_sql) + "\n" + str(insert_sr_stage_data) + except MySQLdb.IntegrityError: + print "[Error] " + str(insert_sr_stage_sql) + "\n" + str(insert_sr_stage_data) + # update sr_stage status. query.close() dbcon.close()