commit: 0bff8de0077754ac80083c432210bdeb15ae4383
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 23 22:24:59 2021 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Sat Oct 23 22:24:59 2021 +0000
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=0bff8de0
Add ParserPkgCheckLog to parse_build_log
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
buildbot_gentoo_ci/steps/logs.py | 51 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/buildbot_gentoo_ci/steps/logs.py b/buildbot_gentoo_ci/steps/logs.py
index d86e208..08ec6ce 100644
--- a/buildbot_gentoo_ci/steps/logs.py
+++ b/buildbot_gentoo_ci/steps/logs.py
@@ -16,6 +16,7 @@ from buildbot.process.buildstep import BuildStep
from buildbot.process.results import SUCCESS
from buildbot.process.results import FAILURE
from buildbot.process.results import WARNINGS
+from buildbot.process.results import SKIPPED
from buildbot.plugins import steps
from buildbot_gentoo_ci.steps import minio
@@ -305,6 +306,56 @@ class Upload(BuildStep):
yield self.build.addStepsAfterCurrentStep(aftersteps_list)
return SUCCESS
+class ParserPkgCheckLog(BuildStep):
+
+ name = 'ParserPkgCheckLog'
+ description = 'Running'
+ descriptionDone = 'Ran'
+ descriptionSuffix = None
+ haltOnFailure = False
+ flunkOnWarnings = False
+ flunkOnFailure = False
+ warnOnWarnings = False
+
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+
+ @defer.inlineCallbacks
+ def run(self):
+ if self.getProperty("pkg_check_log_data") is None:
+ return SKIPPED
+ returnstatus = SUCCESS
+ error = False
+ warning = False
+ log = yield self.addLog('Pkgcheck')
+ print(self.getProperty("pkg_check_log_data"))
+ for a in self.getProperty("pkg_check_log_data"):
+ status = ''
+ print(a)
+ if isinstance(a, dict):
+ for k, i in a.items():
+ if k.startswith('_'):
+ if k == '_info':
+ status = 'INFO: '
+ if k == '_error':
+ status = 'ERROR: '
+ error = True
+ if k == '_warning':
+ status = 'WARNING: '
+ warning = True
+ if k == '_style':
+ status = 'STYLE: '
+ if isinstance(i, dict):
+ for b, c in i.items():
+ yield log.addStdout(status + b + c + '\n')
+ else:
+ yield log.addStdout(i + '\n')
+ if error:
+ returnstatus = FAILURE
+ if warning and not error:
+ returnstatus = WARNINGS
+ return returnstatus
+
class setBuildStatus(BuildStep):
name = 'setBuildStatus'