annotate autobot/projects/autobot/__init__.py @ 258:8ed63380052e

use test bot and dont try to connect to irc when testing
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 28 Dec 2011 16:44:07 -0800
parents 44ca3474d03d
children aa36f82313f1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
71
a1568668175c make the autobot project possibly do something
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
1 from autobot.process.factory import PythonSourceFactory
74
d94fbaac7c2c stub out being able to find scripts cross-platform in a virtualenv
Jeff Hammel <jhammel@mozilla.com>
parents: 71
diff changeset
2 from buildbot.steps.shell import ShellCommand
d94fbaac7c2c stub out being able to find scripts cross-platform in a virtualenv
Jeff Hammel <jhammel@mozilla.com>
parents: 71
diff changeset
3 from buildbot.steps.shell import WithProperties
33
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
71
a1568668175c make the autobot project possibly do something
Jeff Hammel <jhammel@mozilla.com>
parents: 33
diff changeset
5 class TestAutobotFactory(PythonSourceFactory):
33
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 """
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 factory to test autobot
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 """
134
a67fb62c04a6 start adding sources to the master.mfg
Jeff Hammel <jhammel@mozilla.com>
parents: 131
diff changeset
9
139
a0866ad63d93 fix another syntax error andadd the error handling to detect it
Jeff Hammel <jhammel@mozilla.com>
parents: 134
diff changeset
10 sources = {'hg': ['http://k0s.org/mozilla/hg/autobot']}
134
a67fb62c04a6 start adding sources to the master.mfg
Jeff Hammel <jhammel@mozilla.com>
parents: 131
diff changeset
11
234
44ca3474d03d update to allow source
Jeff Hammel <jhammel@mozilla.com>
parents: 189
diff changeset
12 def __init__(self, platform=None, slaveport=7357, htmlport=7358, hg=None):
33
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 # setup the environment
234
44ca3474d03d update to allow source
Jeff Hammel <jhammel@mozilla.com>
parents: 189
diff changeset
15 PythonSourceFactory.__init__(self, platform=platform, name='autobot', hg=hg)
33
cbeca1aea406 stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
17 # find the necessary scripts
77
7493ba72cce7 * use absolute paths for finding (works in unix bash)
Jeff Hammel <jhammel@mozilla.com>
parents: 74
diff changeset
18 self.findScript('create-autobot')
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
19 self.findScript('buildbot')
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
20 self.findScript('buildslave')
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
21
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
22 # make sure the template creator actually does something
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
23 self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
24 '--list-factories'],
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
25 description='create-autobot --list-factories'))
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
26
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
27 # make a master, slave pair
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
28 self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
29 '-f', '-', # all factories,
258
8ed63380052e use test bot and dont try to connect to irc when testing
Jeff Hammel <jhammel@mozilla.com>
parents: 234
diff changeset
30 '--ircChannels', '', # no channels
129
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
31 '--slaveport', str(slaveport),
131
a14d466c843b fix syntax error and note import errors in projects
Jeff Hammel <jhammel@mozilla.com>
parents: 129
diff changeset
32 '--htmlport', str(htmlport),
95
4ed9a96dbb82 fix some test harnesses
Jeff Hammel <jhammel@mozilla.com>
parents: 92
diff changeset
33 'bot'],
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
34 description="make an autobot",
129
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
35 workdir=WithProperties('%(virtualenv)s'),
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
36 haltOnFailure=True))
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
37
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
38
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
39 # make sure they start
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
40 self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
41 'start', 'master'],
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
42 workdir=WithProperties('%(virtualenv)s/bot'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
43 description='start build master'))
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
44 self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
45 'start', 'slave'],
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
46 workdir=WithProperties('%(virtualenv)s/bot'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
47 description='start build slave'))
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
48
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
49
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
50 # try to access the waterfall
129
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
51 self.addStep(ShellCommand(command=['curl',
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
52 'http://localhost:%s/' % htmlport]))
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
53
129
a622d6b4db4a use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents: 95
diff changeset
54 # could try to actually build, but we won't here
92
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
55
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
56 # stop them!
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
57 self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
58 'stop', 'master'],
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
59 workdir=WithProperties('%(virtualenv)s/bot'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
60 description='stop build master'))
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
61 self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
62 'stop', 'slave'],
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
63 workdir=WithProperties('%(virtualenv)s/bot'),
1a0110f00e7e basic test for autobot
Jeff Hammel <jhammel@mozilla.com>
parents: 79
diff changeset
64 description='stop build slave'))