From: SungHun Hwang Date: Mon, 27 Feb 2017 00:07:23 +0000 (+0900) Subject: [BuildMonitor] clear the code after changing the build fail check method X-Git-Tag: submit/trunk/20190927.012743~536^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=549779ecc56e1a60ab4c43425ecf8598cc3e6424;p=services%2Fjenkins-scripts.git [BuildMonitor] clear the code after changing the build fail check method Change-Id: I8885c51ef937e0d069ce0ec4f2f74f3a9f68ae97 Signed-off-by: SungHun Hwang --- diff --git a/job_buildmonitor.py b/job_buildmonitor.py index 2765dd3..dc6a7af 100644 --- a/job_buildmonitor.py +++ b/job_buildmonitor.py @@ -330,49 +330,6 @@ def update_fail_status_for_sr_stage(project, bm_git_tag): query_data = ('F', curr_sr_status_id, info_stage_id, curr_build_project_id) buildmonitor_db.do_query(query, query_data) -def num_failed_packages_except_aggregate(build_project_id): - query = "SELECT bt.repository, bt.arch, ipa.package_name, bpa.build_status "\ - "FROM build_project bp, build_target bt, build_package bpa, info_package ipa "\ - "WHERE bp.id = bt.build_project_id " \ - "AND bt.id = bpa.build_target_id " \ - "AND ipa.id = bpa.info_package_id " \ - "AND bp.id = %s " \ - "ORDER BY bpa.id " - query_data = build_project_id - multi_build_status = buildmonitor_db.get_multi_values_from_query_data(query, query_data) - - build_status = {} - # Save the final build status for each package. - # This is required because a package can be build several times and - # only the last build status is meaningful in this case. - for each_build_status in multi_build_status: - repo = each_build_status[0] - arch = each_build_status[1] - pkg = each_build_status[2] - status = each_build_status[3] - - if repo not in build_status: - build_status[repo] = {} - if arch not in build_status[repo]: - build_status[repo][arch] = {} - build_status[repo][arch][pkg] = status.lower() - - failed_packages_cnt = 0 - # Count the number of failed packages except *_aggregate packages. - for repo in build_status.keys(): - for arch in build_status[repo].keys(): - for pkg in build_status[repo][arch].keys(): - if not re.match(".*_aggregate", pkg): - #print '[%s] repo(%s), arch(%s), pkg(%s), build_status(%s)\n' \ - # % (__file__, repo, arch, pkg, build_status[repo][arch][pkg]) - if build_status[repo][arch][pkg] == 'failed' or \ - build_status[repo][arch][pkg] == 'broken' or \ - build_status[repo][arch][pkg] == 'unresolvable': - failed_packages_cnt += 1 - - # return the number of failed packages except *_aggregate packages. - return failed_packages_cnt - def start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail): print '[%s] enter start_pre_create_snapshot_for_sr_stage\n' % (__file__) @@ -1382,38 +1339,6 @@ def TRBS_start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_da query_data = (curr_info_project_id,) curr_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data) - ''' - # << 1st >> - # get multi_build_status from build_target - query = "SELECT status FROM build_target WHERE build_project_id = %s " \ - "AND last_flag = %s" - query_data = (curr_build_project_id, 'Y') - multi_build_status = buildmonitor_db.get_multi_values_from_query_data(query, query_data) - print '[%s] multi_build_status(%s)\n' % (__file__, multi_build_status) - - # default 'S' - info_stage_status = 'S' - for each_build_status in multi_build_status: - #print '[%s] each_build_status(%s)\n' % (__file__, each_build_status) - if each_build_status[0] == 'F': - info_stage_status = 'F' - #print '[%s] failed!! info_stage_status(%s)\n' % (__file__, info_stage_status) - - # << 2nd >> - # get curr_build_project_status - query = "SELECT status FROM build_project WHERE info_project_id = %s" - query_data = (curr_info_project_id,) - curr_build_project_status = buildmonitor_db.get_value_from_query_data(query, query_data) - print '[%s] curr_build_project_status(%s)\n' % (__file__, curr_build_project_status) - - # [16_1208] change the build fail check method from build_target status to build_project status - if curr_build_project_status == 'F': - info_stage_status = 'F' - else: - info_stage_status = 'S' - ''' - - # << 3rd >> print '[%s] bBuildFail(%s)\n' % (__file__, bBuildFail) if bBuildFail == True: info_stage_status = 'F'