Skip to content

Commit 9bb6d08

Browse files
committed
Now using a refined buildbot plugin which counts and separates the different types of URL failures and displays them in the waterfall status box.
- Legacy-Id: 293
1 parent c89000f commit 9bb6d08

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

test/buildbot/master/ietfdb/buildbot_plugins.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
from StringIO import StringIO
1010

1111
class DjangoTest(ShellCommand):
12-
name = "django test"
12+
name = "django-test"
1313
command = ["python", "manage.py", "test"]
14-
description = ["running django test"]
15-
descriptionDone = ["django test"]
14+
description = ["running django-test"]
15+
descriptionDone = ["django-test"]
1616
flunkOnFailure = False
1717
flunkingIssues = ["exception", "failure"] # any pyflakes lines like this cause FAILURE
1818

19-
msgtypes = ("exception", "failure", "skipped", "diffs", "ok")
19+
msgtypes = ("exceptions", "failures", "skipped", "diffs", "pass")
2020

2121
def createSummary(self, log):
2222
summaries = {}
2323
typelist = {}
2424
counts = {}
25+
m = None
2526
def count(m):
2627
if not m in counts:
2728
counts[m] = 0
@@ -38,27 +39,28 @@ def count(m):
3839
count(m)
3940
if re.search("^Fail \d+ ", line):
4041
m = "fail_%s" % line.split()[1]
41-
typelist["failure"].add(m)
42+
typelist["failures"].add(m)
4243
count(m)
4344
if re.search("^Skipping ", line):
4445
m = "skipped"
4546
typelist["skipped"].add(m)
4647
count(m)
47-
if re.search("^Diff: .* ", line):
48-
m = "diff_%s" % line.skip()[1]
48+
if re.search("^Diff: .*", line):
49+
m = "diff_%s" % line.split()[1]
4950
typelist["diffs"].add(m)
5051
count(m)
51-
if re.search("^OK (\d+) ", line):
52+
if re.search("^OK \d+ ", line):
5253
m = "pass_%s" % line.split()[1]
5354
typelist["pass"].add(m)
5455
count(m)
55-
if re.search("^Pass (\d+) ", line):
56+
if re.search("^Pass \d+ ", line):
5657
m = "pass_%s" % line.split()[1]
5758
typelist["pass"].add(m)
5859
count(m)
59-
if not m in summaries:
60-
summaries[m] = []
61-
summaries[m].append(line)
60+
if m:
61+
if not m in summaries:
62+
summaries[m] = []
63+
summaries[m].append(line)
6264

6365
self.descriptionDone = self.descriptionDone[:]
6466
for type in self.msgtypes:
@@ -67,14 +69,17 @@ def count(m):
6769
self.descriptionDone.append("%s=%d" % (msg, counts[msg]))
6870
self.addCompleteLog(msg, "".join(summaries[msg]))
6971
self.setProperty("urltest-%s" % type, sum([counts[msg] for msg in typelist[type]]))
70-
self.setProperty("urltest-total", sum(counts.values()))
72+
self.setProperty("urltest-total", sum([counts[msg] for msg in counts if msg not in typelist["pass"]]))
7173

7274
def evaluateCommand(self, cmd):
7375
if cmd.rc != 0:
7476
return FAILURE
7577
for type in self.flunkingIssues:
76-
if self.getProperty("urltest-%s" % type):
77-
return FAILURE
78+
try:
79+
if self.getProperty("urltest-%s" % type):
80+
return FAILURE
81+
except KeyError:
82+
pass
7883
if self.getProperty("urltest-total"):
7984
return WARNINGS
8085
return SUCCESS

test/buildbot/master/ietfdb/master.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ from buildbot.steps.source import SVN
9494
from buildbot.steps.dummy import Dummy
9595
from buildbot.steps.python import PyFlakes
9696
from buildbot.steps.shell import ShellCommand, Test
97-
from buildbot_plugins import UrlTest
97+
from buildbot_plugins import DjangoTest
9898

9999
f1 = factory.BuildFactory()
100100
f1.addStep(SVN, svnurl="http://svn.tools.ietf.org/svn/tools/ietfdb/trunk/", username="buildbot@tools.ietf.org", password="U64#GUxr")
101101
f1.addStep(ShellCommand, name="test-setup", command=["test/test-setup"])
102102
f1.addStep(PyFlakes, command=["test/run-pyflakes", "ietf"], warnOnFailure=True)
103-
f1.addStep(Test, name="django-tests", command=["python", "ietf/manage.py", "test"], env={'PYTHONPATH': ["test/lib",]} )
103+
f1.addStep(DjangoTest, command=["python", "ietf/manage.py", "test"], env={'PYTHONPATH': ["test/lib",]} )
104104
f1.addStep(ShellCommand, name="test-teardown", command=["test/test-teardown"])
105105

106106
b1 = {'name': "merlot-builder-1",

0 commit comments

Comments
 (0)