Gentoo Archives: gentoo-commits

From: Magnus Granberg <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: tbc/pym/
Date: Fri, 24 Jul 2015 00:26:30
Message-Id: 1437697535.63bc5f7ccb24c1d40ffeea6ccb9002f323e75a7b.zorry@gentoo
1 commit: 63bc5f7ccb24c1d40ffeea6ccb9002f323e75a7b
2 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 24 00:25:35 2015 +0000
4 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 24 00:25:35 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=63bc5f7c
7
8 fix repoman qa and error logning
9
10 tbc/pym/build_log.py | 22 +++++++++-------------
11 tbc/pym/db_mapping.py | 2 --
12 tbc/pym/package.py | 2 +-
13 tbc/pym/sqlquerys.py | 7 ++++++-
14 4 files changed, 16 insertions(+), 17 deletions(-)
15
16 diff --git a/tbc/pym/build_log.py b/tbc/pym/build_log.py
17 index ffa848a..8079443 100644
18 --- a/tbc/pym/build_log.py
19 +++ b/tbc/pym/build_log.py
20 @@ -193,14 +193,14 @@ def get_buildlog_info(session, settings, pkg, build_dict):
21 error_info_list = get_error_info_list(session)
22 for k, v in sorted(hilight_dict.items()):
23 if v['startline'] == v['endline']:
24 - error_log_list.append(logfile_text_dict[k ])
25 - if v['hilight_css_id'] == "3" or v['hilight_css_id'] == "4": # qa = 3 and 4
26 + error_log_list.append(logfile_text_dict[k])
27 + if v['hilight_css_id'] == 3: # qa = 3 and 4
28 qa_error_list.append(logfile_text_dict[k])
29 else:
30 i = k
31 while i != (v['endline'] + 1):
32 error_log_list.append(logfile_text_dict[i])
33 - if v['hilight_css_id'] == "3" or v['hilight_css_id'] == "4": # qa = 3 and 4
34 + if v['hilight_css_id'] == 3: # qa = 3 and 4
35 qa_error_list.append(logfile_text_dict[i])
36 i = i +1
37
38 @@ -208,14 +208,12 @@ def get_buildlog_info(session, settings, pkg, build_dict):
39 repoman_error_list = check_repoman(settings, myportdb, build_dict['cpv'], pkg.repo)
40 build_log_dict = {}
41 build_log_dict['fail'] = False
42 - build_log_dict['rmqa'] = False
43 - build_log_dict['others'] = False
44 if repoman_error_list:
45 - sum_build_log_list.append("1") # repoman = 1
46 - build_log_dict['rmqa'] = True
47 + sum_build_log_list.append(1) # repoman = 1
48 + build_log_dict['fail'] = True
49 if qa_error_list != []:
50 - sum_build_log_list.append("2") # qa = 2
51 - build_log_dict['rmqa'] = True
52 + sum_build_log_list.append(2) # qa = 2
53 + build_log_dict['fail'] = True
54 else:
55 qa_error_list = False
56 error_search_line = "^ \\* ERROR: "
57 @@ -299,7 +297,7 @@ def log_fail_queru(session, build_dict, settings):
58 build_log_dict = {}
59 error_log_list = []
60 sum_build_log_list = []
61 - sum_build_log_list.append("2")
62 + sum_build_log_list.append(3) # Others errors
63 error_log_list.append(build_dict['type_fail'])
64 build_log_dict['summary_error_list'] = sum_build_log_list
65 if build_dict['type_fail'] == 'merge fail':
66 @@ -335,8 +333,6 @@ def log_fail_queru(session, build_dict, settings):
67 build_log_dict['hilight_dict'] = {}
68 settings2, trees, tmp = load_emerge_config()
69 build_log_dict['emerge_info'] = get_emerge_info_id(settings2, trees, session, config_id)
70 - build_log_dict['others'] = True
71 - build_log_dict['rmqa'] = False
72 - build_log_dict['fail'] = False
73 + build_log_dict['fail'] = True
74 log_id = add_new_buildlog(session, build_dict, build_log_dict)
75 del_old_build_jobs(session, build_dict['build_job_id'])
76
77 diff --git a/tbc/pym/db_mapping.py b/tbc/pym/db_mapping.py
78 index 67c2d61..a296c2e 100644
79 --- a/tbc/pym/db_mapping.py
80 +++ b/tbc/pym/db_mapping.py
81 @@ -183,8 +183,6 @@ class BuildLogs(Base):
82 BuildLogId = Column('build_log_id', Integer, primary_key=True)
83 EbuildId = Column('ebuild_id', Integer, ForeignKey('ebuilds.ebuild_id'))
84 Fail = Column('fail', Boolean, default=False)
85 - RmQa = Column('rmqa', Boolean, default=False)
86 - Others = Column('others', Boolean, default=False)
87 SummeryText = Column('summery_text', Text)
88 LogHash = Column('log_hash', String(100))
89 BugId = Column('bug_id', Integer, default=0)
90
91 diff --git a/tbc/pym/package.py b/tbc/pym/package.py
92 index dc4ff3e..cc03f97 100644
93 --- a/tbc/pym/package.py
94 +++ b/tbc/pym/package.py
95 @@ -157,7 +157,7 @@ class tbc_package(object):
96 log_msg = "B %s:%s USE: %s Setup: %s" % (k, v['repo'], use_flagsDict, setup_id,)
97 add_logs(self._session, log_msg, "info", self._config_id)
98 i = i +1
99 - def get_changelog_text(self,pkgdir):
100 + def get_changelog_text(self, pkgdir):
101 changelog_text_dict, max_text_lines = get_log_text_dict(pkgdir + "/ChangeLog")
102 spec = 3
103 spec_tmp = 1
104
105 diff --git a/tbc/pym/sqlquerys.py b/tbc/pym/sqlquerys.py
106 index f7f5a97..8fdf901 100644
107 --- a/tbc/pym/sqlquerys.py
108 +++ b/tbc/pym/sqlquerys.py
109 @@ -229,7 +229,7 @@ def add_new_buildlog(session, build_dict, build_log_dict):
110 return None, False
111
112 def build_log_id_no_match(build_dict, build_log_dict):
113 - NewBuildLog = BuildLogs(EbuildId = build_dict['ebuild_id'], Fail = build_log_dict['fail'], RmQa = build_log_dict['rmqa'], Others = build_log_dict['others'], SummeryText = build_log_dict['build_error'], LogHash = build_log_dict['log_hash'])
114 + NewBuildLog = BuildLogs(EbuildId = build_dict['ebuild_id'], Fail = build_log_dict['fail'], SummeryText = build_log_dict['build_error'], LogHash = build_log_dict['log_hash'])
115 session.add(NewBuildLog)
116 session.flush()
117 build_log_id = NewBuildLog.BuildLogId
118 @@ -276,12 +276,17 @@ def add_new_buildlog(session, build_dict, build_log_dict):
119 def add_repoman_qa(session, build_log_dict, log_id):
120 repoman_error = ""
121 qa_error = ""
122 + error = False
123 if build_log_dict['repoman_error_list']:
124 for repoman_text in build_log_dict['repoman_error_list']:
125 repoman_error = repoman_error + repoman_text
126 + error = True
127 if build_log_dict['qa_error_list']:
128 for qa_text in build_log_dict['qa_error_list']:
129 qa_error = qa_error + qa_text
130 + error = True
131 + repoman_error = repoman_error + qa_error
132 + if error:
133 repoman_error = repoman_error + qa_error
134 NewBuildLogRepoman = BuildLogsRepomanQa(BuildLogId = log_id, SummeryText = repoman_error)
135 session.add(NewBuildLogRepoman)