Skip to content

Commit

Permalink
update mtrlogobserver.py
Browse files Browse the repository at this point in the history
* cosmetics (empty lines and such)
* removed dangerous parameter (logfiles={})
  • Loading branch information
Mikhail Sobolev committed Feb 21, 2015
1 parent 13a3fd3 commit 4927c83
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions master/buildbot/steps/mtrlogobserver.py
Expand Up @@ -127,12 +127,12 @@ def outLineReceived(self, line):

else:
m = self._line_re3.search(stripLine)

if m:
stuff = m.group(1)
self.closeTestFail()
testList = stuff.split(" ")
self.doCollectWarningTests(testList)

elif (self._line_re2.search(stripLine) or
self._line_re4.search(stripLine) or
self._line_re5.search(stripLine) or
Expand All @@ -141,7 +141,6 @@ def outLineReceived(self, line):
(stripLine.startswith("------------------------------------------------------------")
and self.testFail is not None)):
self.closeTestFail()

else:
self.addTestFailOutput(stripLine + "\n")

Expand Down Expand Up @@ -278,10 +277,13 @@ class MTR(Test):
def __init__(self, dbpool=None, test_type=None, test_info="",
description=None, descriptionDone=None,
autoCreateTables=False, textLimit=5, testNameLimit=16,
parallel=4, logfiles={}, lazylogfiles=True,
parallel=4, logfiles=None, lazylogfiles=True,
warningPattern="MTR's internal check of the test case '.*' failed",
mtr_subdir="mysql-test", **kwargs):

if logfiles is None:
logfiles = {}

if description is None:
description = ["testing"]
if test_type:
Expand Down Expand Up @@ -449,9 +451,10 @@ class MyMtrLogObserver(MtrLogObserver):
def collectTestFail(self, testname, variant, result, info, text):
# Insert asynchronously into database.
dbpool = self.step.dbpool
run_id = self.step.getProperty("mtr_id")
if dbpool is None:
return defer.succeed(None)

run_id = self.step.getProperty("mtr_id")
if variant is None:
variant = ""
d = self.step.runQueryWithRetry("""
Expand All @@ -467,6 +470,7 @@ def collectWarningTests(self, testList):
dbpool = self.step.dbpool
if dbpool is None:
return defer.succeed(None)

run_id = self.step.getProperty("mtr_id")
warn_id = self.step.getProperty("mtr_warn_id")
self.step.setProperty("mtr_warn_id", warn_id + 1)
Expand Down

0 comments on commit 4927c83

Please sign in to comment.