-
Hi, I'm trying to create a custom reporter (currently just a dummy), but am running into an issue and can't find the solution: Custom Reporter: from twisted.internet import defer
from twisted.python import log as twlog
from buildbot import config
from buildbot.process.results import statusToString, SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION, RETRY, CANCELLED
from buildbot.reporters import utils
from buildbot.reporters.base import ReporterBase
class TestReporter(ReporterBase):
name = "TestReporter"
@defer.inlineCallbacks
def sendMessage(self, reports):
report = reports[0]
build = reports[0]['builds'][0]
description = report.get('body', None)
if build['complete']:
state = {
SUCCESS: False,
WARNINGS: True,
FAILURE: True,
SKIPPED: False,
EXCEPTION: True,
RETRY: True,
CANCELLED: True
}.get(build['results'], True)
else:
state = False
twlog.msg("TestReporter")
twlog.msg(reports) In my master.cfg: import testreporter as tr
#.....
genTr = reporters.BuildStatusGenerator(mode='all', builders=["builder1"])
thisTr = tr.TestReporter(generators=[genTr])
c['services'].append(thisTr) And when I run it, I get this:
It looks like I need to register my reporter with the database, but I can't seem to find documentation on how to do that. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Answered by
npmitche
Oct 13, 2021
Replies: 1 comment 1 reply
-
I found a stray |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
npmitche
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found a stray
,
in my code and when I removed it, the error disappeared. 🤦🏼♂️