Skip to content

Commit a5a5659

Browse files
committed
Added the buildbot config file to the repository. Deployment path: /home/buildbot/masters/datatracker/master.cfg
- Legacy-Id: 9244
1 parent 70396be commit a5a5659

File tree

1 file changed

+132
-51
lines changed

1 file changed

+132
-51
lines changed

buildbot/masters/datatracker/master.cfg

Lines changed: 132 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# -*- python -*-
22
# ex: set syntax=python:
3+
from buildbot_passwords import *
34

4-
# This is a sample buildmaster config file. It must be installed as
5-
# 'master.cfg' in your buildmaster's base directory.
65

76
# This is the dictionary that the buildmaster pays attention to. We also use
87
# a shorter alias to save typing.
@@ -15,9 +14,10 @@ c = BuildmasterConfig = {}
1514
# slave name and password must be configured on the slave.
1615
from buildbot.buildslave import BuildSlave
1716
c['slaves'] = [
18-
BuildSlave("datatracker_py27_1", "yWQaUzdJk8oL"),
19-
BuildSlave("datatracker_py27_2", "nm+=+knVGycN"),
20-
BuildSlave("datatracker_py27_3", "WZgYahJ4twXR"),
17+
BuildSlave("datatracker_lin_py27_1", datatracker_lin_py27_1_pw),
18+
BuildSlave("datatracker_lin_py27_2", datatracker_lin_py27_2_pw),
19+
BuildSlave("datatracker_lin_py27_3", datatracker_lin_py27_3_pw),
20+
BuildSlave("datatracker_osx_py27_4", datatracker_osx_py27_4_pw),
2121
]
2222

2323
# 'protocols' contains information about protocols which master will use for
@@ -41,7 +41,7 @@ from buildbot.changes.pb import PBChangeSource
4141
# prefix = userinfo[user]["prefix"]
4242
# c.['change_source'].append(PBChangeSource(user=user, passwd="BRiR6XcT7x3$", prefix=prefix))
4343
c['change_source'] = [
44-
PBChangeSource(user="ietfdb", passwd="BRiR6XcT7x3$"),
44+
PBChangeSource(user="ietfdb", passwd=ietfdb_svn_hook_pw),
4545
]
4646

4747
####### SCHEDULERS
@@ -53,9 +53,10 @@ from buildbot.schedulers.basic import SingleBranchScheduler, AnyBranchScheduler
5353
from buildbot.schedulers.forcesched import ForceScheduler
5454
from buildbot.changes import filter
5555
c['schedulers'] = [
56-
AnyBranchScheduler(name="pyflakes", treeStableTimer=10, builderNames=["run_pyflakes"]),
57-
AnyBranchScheduler(name="test", treeStableTimer=60*10, builderNames=["run_tests"]),
58-
SingleBranchScheduler(name="crawler", treeStableTimer=60*60*4, builderNames=["run_crawler"],
56+
AnyBranchScheduler(name="pyflakes", treeStableTimer=10, builderNames=["Check PyFlakes"]),
57+
AnyBranchScheduler(name="lin_test", treeStableTimer=60*5, builderNames=["Test Suite"]),
58+
AnyBranchScheduler(name="osx_test", treeStableTimer=60*5, builderNames=["Test Suite (OS X)"]),
59+
SingleBranchScheduler(name="crawler", treeStableTimer=60*60*4, builderNames=["Test-Crawler"],
5960
change_filter=filter.ChangeFilter(branch='trunk')),
6061
]
6162

@@ -67,80 +68,160 @@ c['schedulers'] = [
6768

6869
from buildbot.process.factory import BuildFactory
6970
from buildbot.steps.source.svn import SVN
70-
from buildbot.steps.shell import ShellCommand
71+
from buildbot.steps.shell import ShellCommand, Test, WarningCountingShellCommand
7172
from buildbot.steps.python import PyFlakes
73+
from buildbot.steps.python_twisted import RemovePYCs
74+
#
7275
from buildbot.process.properties import Property, Interpolate
7376
from buildbot.config import BuilderConfig
7477

78+
#### Custom subclassed builder
79+
80+
class TestCrawlerShellCommand(WarningCountingShellCommand):
81+
name = "testcrawl"
82+
haltOnFailure = 1
83+
flunkOnFailure = 1
84+
descriptionDone = ["test crawler"]
85+
command=["bin/test-crawl"]
86+
warningPattern = '.* FAIL'
87+
88+
## Set up builders
7589

7690
c['builders'] = []
7791

78-
# Run pyflakes
92+
# --- Run pyflakes ---
7993
factory = BuildFactory()
8094
factory.addStep(SVN(
81-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
95+
username='buildbot@tools.ietf.org',
96+
descriptionDone="svn update",
97+
workdir=Interpolate('build/%(src::branch)s'),
98+
haltOnFailure=True,
8299
repourl=Interpolate('https://svn.tools.ietf.org/svn/tools/ietfdb/%(src::branch:~trunk)s'),
83100
descriptionSuffix=[Interpolate('%(src::branch)s %(src::revision)s')],
84101
))
102+
factory.addStep(RemovePYCs(workdir=Interpolate('build/%(src::branch)s')))
85103
factory.addStep(ShellCommand(
86-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
87-
command=["pip", "install", "-r", "requirements.txt"]))
104+
descriptionDone="install requirements",
105+
workdir=Interpolate('build/%(src::branch)s'),
106+
haltOnFailure=True,
107+
command=["pip", "install", "-r", "requirements.txt"],
108+
))
88109
factory.addStep(PyFlakes(
89-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
90-
command=["ietf/manage.py", "pyflakes", "--verbosity=0"]))
110+
workdir=Interpolate('build/%(src::branch)s'),
111+
haltOnFailure=True,
112+
command=["ietf/manage.py", "pyflakes", "--verbosity=0"],
113+
))
91114
# This should be the last action
92-
factory.addStep(ShellCommand(descriptionDone="mark as passed",
115+
factory.addStep(ShellCommand(
116+
descriptionDone="mark as passed",
93117
workdir=Interpolate('build/%(src::branch)s'),
94-
command=["svn", "--username=buildbot@tools.ietf.org", "--password=ax+u#ikxabx7",
95-
"--no-auth-cache", "--non-interactive",
96-
"propset", "--revprop", "-r", Property('got_revision'), "test:pyflakes", "passed" ]))
118+
command=["svn", "--username=buildbot@tools.ietf.org", "--non-interactive",
119+
"propset", "--revprop", "-r", Property('got_revision'), "test:pyflakes", "passed" ],
120+
))
97121

98-
c['builders'].append(BuilderConfig(name="run_pyflakes", factory=factory,
99-
slavenames=["datatracker_py27_1", "datatracker_py27_2", "datatracker_py27_3"]))
122+
c['builders'].append(BuilderConfig(name="Check PyFlakes", factory=factory,
123+
slavenames=["datatracker_lin_py27_1", "datatracker_lin_py27_2", "datatracker_lin_py27_3"]))
100124

101-
# Run tests
125+
# --- Run tests ---
102126
factory = BuildFactory()
103127
factory.addStep(SVN(
104-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
128+
username='buildbot@tools.ietf.org',
129+
descriptionDone="svn update",
130+
workdir=Interpolate('build/%(src::branch)s'),
131+
haltOnFailure=True,
105132
repourl=Interpolate('https://svn.tools.ietf.org/svn/tools/ietfdb/%(src::branch:~trunk)s'),
106133
descriptionSuffix=[Interpolate('%(src::branch)s %(src::revision)s')],
107134
))
135+
factory.addStep(RemovePYCs(workdir=Interpolate('build/%(src::branch)s')))
108136
factory.addStep(ShellCommand(
109-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
110-
command=["pip", "install", "-r", "requirements.txt"]))
111-
factory.addStep(ShellCommand(
112-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
113-
command=["ietf/manage.py", "test", "--settings=settings_sqlitetest"]))
137+
descriptionDone="install requirements",
138+
workdir=Interpolate('build/%(src::branch)s'),
139+
haltOnFailure=True,
140+
command=["pip", "install", "-r", "requirements.txt"],
141+
))
142+
factory.addStep(Test(
143+
workdir=Interpolate('build/%(src::branch)s'),
144+
haltOnFailure=True,
145+
command=["ietf/manage.py", "test", "--settings=settings_sqlitetest"],
146+
))
114147
# This should be the last action
115-
factory.addStep(ShellCommand(descriptionDone="mark as passed",
148+
factory.addStep(ShellCommand(
149+
descriptionDone="mark as passed",
116150
workdir=Interpolate('build/%(src::branch)s'),
117-
command=["svn", "--username=buildbot@tools.ietf.org", "--password=ax+u#ikxabx7",
118-
"--no-auth-cache", "--non-interactive",
119-
"propset", "--revprop", "-r", Property('got_revision'), "test:unittest", "passed" ]))
151+
command=["svn", "--username=buildbot@tools.ietf.org", "--non-interactive",
152+
"propset", "--revprop", "-r", Property('got_revision'), "test:unittest", "passed" ],
153+
))
120154

121-
c['builders'].append(BuilderConfig(name="run_tests", factory=factory,
122-
slavenames=["datatracker_py27_1", "datatracker_py27_2", "datatracker_py27_3"]))
155+
c['builders'].append(BuilderConfig(name="Test Suite", factory=factory,
156+
slavenames=["datatracker_lin_py27_1", "datatracker_lin_py27_2", "datatracker_lin_py27_3"]))
123157

124-
# Run test-crawler
158+
159+
# --- Run tests on os-x ---
125160
factory = BuildFactory()
126161
factory.addStep(SVN(
127-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
128-
repourl=Interpolate('https://svn.tools.ietf.org/svn/tools/ietfdb/%(src::branch:~trunk)s')))
162+
username='buildbot@tools.ietf.org',
163+
descriptionDone="svn update",
164+
workdir=Interpolate('build/%(src::branch)s'),
165+
haltOnFailure=True,
166+
repourl=Interpolate('https://svn.tools.ietf.org/svn/tools/ietfdb/%(src::branch:~trunk)s'),
167+
descriptionSuffix=[Interpolate('%(src::branch)s %(src::revision)s')],
168+
))
169+
factory.addStep(RemovePYCs(workdir=Interpolate('build/%(src::branch)s')))
129170
factory.addStep(ShellCommand(
130-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
131-
command=["pip", "install", "-r", "requirements.txt"]))
171+
descriptionDone="install requirements",
172+
workdir=Interpolate('build/%(src::branch)s'),
173+
haltOnFailure=True,
174+
command=["pip", "install", "-r", "requirements.txt"],
175+
))
176+
factory.addStep(Test(
177+
workdir=Interpolate('build/%(src::branch)s'),
178+
haltOnFailure=True,
179+
command=["ietf/manage.py", "test", "--settings=settings_sqlitetest"],
180+
))
181+
# This should be the last action
182+
factory.addStep(ShellCommand(
183+
descriptionDone="mark as passed",
184+
workdir=Interpolate('build/%(src::branch)s'),
185+
command=["svn", "--username=buildbot@tools.ietf.org", "--non-interactive",
186+
"propset", "--revprop", "-r", Property('got_revision'), "test:unittest", "passed" ],
187+
))
188+
189+
c['builders'].append(BuilderConfig(name="Test Suite (OS X)", factory=factory,
190+
slavenames=["datatracker_osx_py27_4"]))
191+
192+
193+
# --- Run test-crawler ---
194+
factory = BuildFactory()
195+
factory.addStep(SVN(
196+
username='buildbot@tools.ietf.org',
197+
descriptionDone="svn update",
198+
workdir=Interpolate('build/%(src::branch)s'),
199+
haltOnFailure=True,
200+
repourl=Interpolate('https://svn.tools.ietf.org/svn/tools/ietfdb/%(src::branch:~trunk)s'),
201+
descriptionSuffix=[Interpolate('%(src::branch)s %(src::revision)s')],
202+
))
203+
factory.addStep(RemovePYCs(workdir=Interpolate('build/%(src::branch)s')))
132204
factory.addStep(ShellCommand(
133-
workdir=Interpolate('build/%(src::branch)s'), haltOnFailure=True,
134-
command=["bin/test-crawl", "--settings=ietf.settings_testcrawl"]))
205+
descriptionDone="install requirements",
206+
workdir=Interpolate('build/%(src::branch)s'),
207+
haltOnFailure=True,
208+
command=["pip", "install", "-r", "requirements.txt"],
209+
))
210+
factory.addStep(TestCrawlerShellCommand(
211+
workdir=Interpolate('build/%(src::branch)s'),
212+
haltOnFailure=True,
213+
command=["bin/test-crawl", "--settings=ietf.settings_testcrawl"],
214+
))
135215
# This should be the last action
136-
factory.addStep(ShellCommand(descriptionDone="mark as passed",
216+
factory.addStep(ShellCommand(
217+
descriptionDone="mark as passed",
137218
workdir=Interpolate('build/%(src::branch)s'),
138-
command=["svn", "--username=buildbot@tools.ietf.org", "--password=ax+u#ikxabx7",
139-
"--no-auth-cache", "--non-interactive",
140-
"propset", "--revprop", "-r", Property('got_revision'), "test:crawler", "passed" ]))
219+
command=["svn", "--username=buildbot@tools.ietf.org", "--non-interactive",
220+
"propset", "--revprop", "-r", Property('got_revision'), "test:crawler", "passed" ],
221+
))
141222

142-
c['builders'].append(BuilderConfig(name="run_crawler", factory=factory,
143-
slavenames=["datatracker_py27_1"]))
223+
c['builders'].append(BuilderConfig(name="Test-Crawler", factory=factory,
224+
slavenames=["datatracker_lin_py27_1", ]))
144225

145226

146227
####### STATUS TARGETS
@@ -157,14 +238,14 @@ from buildbot.status.web import authz, auth
157238
authz_cfg=authz.Authz(
158239
# change any of these to True to enable; see the manual for more
159240
# options
160-
auth.BasicAuth([("ietfdb","ietfdb")]),
241+
auth=auth.BasicAuth([("ietfdb","ietfdb")]),
161242
gracefulShutdown = False,
162243
forceBuild = 'auth', # use this to test your slave once it is set up
163244
forceAllBuilds = False,
164245
pingBuilder = False,
165-
stopBuild = False,
246+
stopBuild = 'auth',
166247
stopAllBuilds = False,
167-
cancelPendingBuild = False,
248+
cancelPendingBuild = 'auth',
168249
)
169250
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
170251

0 commit comments

Comments
 (0)