コード例 #1
0
    def get_issue_yanshou_yesterday(self):
        '''
        获取昨天 测试类别为 验收;由 open 变为 resolved ; 且解决结果为 fiexed 与 Pendings的问题
        :return:
        '''
        zero_yesterday = CommonUtils.get_date_time_others_zero(-1)
        last_yesterday = CommonUtils.get_date_time_others_last(-1)

        sql_preuser2sw = 'select issueid from changegroup where ID in (select groupid from changeitem where \
                         OLDSTRING="Open" and NEWSTRING="Resolved") and CREATED between %s and %s'

        issues = MysqlUtils.find_data_dic_2args(sql_preuser2sw, zero_yesterday,
                                                last_yesterday)
        issues_list = []  # 列表元素为字典, 每个字典是检索到的issue的具体信息,用于以后操作
        issues_list_use = []

        if issues:
            for item in issues:
                try:
                    issue_key = str(item['issueid'])
                    issues_list.append({'id': issue_key})
                    i = len(issues_list) - 1  # 获取当前列表的长度
                    issues_list[i]['project'] = self.get_issue_project(
                        issue_key)
                    issues_list[i]['summary'] = self.get_issue_summary(
                        issue_key)
                    issues_list[i]['description'] = self.get_issue_description(
                        issue_key)
                    issues_list[i]['type'] = self.get_issue_type(issue_key)
                    issues_list[i]['priority'] = self.get_issue_priority(
                        issue_key)
                    issues_list[i]['status'] = self.get_issue_status(issue_key)
                    issues_list[i]['probability'] = self.get_issue_probability(
                        issue_key)
                    issues_list[i][
                        'test_category'] = self.get_issue_test_category(
                            issue_key)
                    issues_list[i]['key'] = self.get_issue_key(issue_key)
                    issues_list[i]['result'] = self.get_issue_result(issue_key)
                except:
                    # 有异常时不去考虑,继续下一个
                    continue

            #  遍历列表,筛选出 版本号为6开头的
            for item in issues_list:
                if ('test_category' in item):
                    if (item['test_category'] == "验收Acceptance"
                            or item['test_category']
                            == "市场反馈") and (item['result'] == "Fixed"
                                            or item['result'] == "Pending"):
                        issues_list_use.append(item)
        else:
            issues_list_use = []

        return issues_list_use
コード例 #2
0
    def get_issue_preuser2sw_yesterday(self):
        zero_yesterday = CommonUtils.get_date_time_others_zero(-1)
        last_yesterday = CommonUtils.get_date_time_others_last(-1)

        sql_preuser2sw = 'select issueid from changegroup where ID in (select groupid from changeitem where \
                         OLDSTRING="PreUser Bug" and NEWSTRING="SW Bug") and CREATED between %s and %s'

        issues = MysqlUtils.find_data_dic_2args(sql_preuser2sw, zero_yesterday,
                                                last_yesterday)
        issues_list = []  # 列表元素为字典, 每个字典是检索到的issue的具体信息,用于以后操作
        issues_list_use = []

        if issues:
            for item in issues:
                issue_key = str(item['issueid'])
                issues_list.append({'id': issue_key})
                i = len(issues_list) - 1  # 获取当前列表的长度
                issues_list[i]['project'] = self.get_issue_project(issue_key)
                issues_list[i]['summary'] = self.get_issue_summary(issue_key)
                issues_list[i]['description'] = self.get_issue_description(
                    issue_key)
                issues_list[i]['type'] = self.get_issue_type(issue_key)
                issues_list[i]['priority'] = self.get_issue_priority(issue_key)
                issues_list[i]['status'] = self.get_issue_status(issue_key)
                issues_list[i]['source'] = self.get_issue_source(issue_key)
                issues_list[i]['probability'] = self.get_issue_probability(
                    issue_key)
                issues_list[i]['versions'] = self.get_issue_versions(issue_key)
                issues_list[i]['key'] = self.get_issue_key(issue_key)

            #  遍历列表,筛选出 版本号为6开头的
            for item in issues_list:
                if (ReUtils.bool_version_6(item['versions'])):
                    issues_list_use.append(item)
        else:
            issues_list_use = []

        return issues_list_use