[pypy-svn] r58208 - in pypy/build/bot2: . pypybuildbot
pedronis at codespeak.net
pedronis at codespeak.net
Wed Sep 17 19:07:41 CEST 2008
Author: pedronis
Date: Wed Sep 17 19:07:39 2008
New Revision: 58208
Added:
pypy/build/bot2/pypybuildbot/steps.py (contents, props changed)
Modified:
pypy/build/bot2/master.cfg
pypy/build/bot2/pypybuildbot/master.py
Log:
(iko, pedronis)
- start of supporting windows setup
- svnwcrevert invocation
Modified: pypy/build/bot2/master.cfg
==============================================================================
--- pypy/build/bot2/master.cfg (original)
+++ pypy/build/bot2/master.cfg Wed Sep 17 19:07:39 2008
@@ -4,7 +4,9 @@
httpPortNumber = 8099
# slavename -> password
-from slaveinfo import passwords
+import slaveinfo
+reload(slaveinfo)
+passwords = slaveinfo.passwords
# checkout bot2 in the home dir of the master
sys.path.append(os.path.expanduser('~/bot2/'))
Modified: pypy/build/bot2/pypybuildbot/master.py
==============================================================================
--- pypy/build/bot2/pypybuildbot/master.py (original)
+++ pypy/build/bot2/pypybuildbot/master.py Wed Sep 17 19:07:39 2008
@@ -2,9 +2,6 @@
from buildbot.buildslave import BuildSlave
from buildbot.status.html import WebStatus
-from buildbot.process import factory
-from buildbot.steps import source, shell
-
# I really wanted to pass logPath to Site
from twisted.web.server import Site
@@ -18,19 +15,20 @@
status = WebStatus(httpPortNumber, allowForce=True)
-pypyOwnFactory = factory.BuildFactory()
-pypyOwnFactory.addStep(source.SVN("https://codespeak.net/svn/pypy/branch/pypy-pytrunk"))
-pypyOwnFactory.addStep(shell.ShellCommand(
- description="pytest",
- command="py/bin/py.test pypy/module/__builtin__ pypy/module/operator --session=FileLogSession --filelog=pytest.log".split(),
- logfiles={'pytestLog': 'pytest.log'}))
+import pypybuildbot.steps
+reload(pypybuildbot.steps)
+pypysteps = pypybuildbot.steps
+
+pypyOwnTestFactory = pypysteps.PyPyOwnTestFactory()
+pypyOwnTestFactoryWin = pypysteps.PyPyOwnTestFactory(platform="win32")
BuildmasterConfig = {
'slavePortnum': slavePortnum,
'change_source': [],
'schedulers': [Nightly("nightly",
- ["pypy-own-linux", "pypy-own-other-linux"], hour=19)],
+ ["pypy-own-linux", "pypy-own-other-linux",
+ "pypy-own-win"], hour=19)],
'status': [status],
'slaves': [BuildSlave(name, password)
@@ -41,13 +39,17 @@
{"name": "pypy-own-linux",
"slavenames": ["vitaly"],
"builddir": "pypy-own-linux",
- "factory": pypyOwnFactory
+ "factory": pypyOwnTestFactory
},
{"name": "pypy-own-other-linux",
"slavenames": ["fido"],
"builddir": "pypy-own-other-linux",
- "factory": pypyOwnFactory
- }
+ "factory": pypyOwnTestFactory
+ },
+ {"name": "pypy-own-win",
+ "slavenames": ['ebgoc'],
+ "builddir": "pypy-own-win",
+ "factory": pypyOwnTestFactoryWin}
],
'buildbotURL': 'http://localhost:%d/' % (httpPortNumber,),
Added: pypy/build/bot2/pypybuildbot/steps.py
==============================================================================
--- (empty file)
+++ pypy/build/bot2/pypybuildbot/steps.py Wed Sep 17 19:07:39 2008
@@ -0,0 +1,65 @@
+from buildbot.process import factory
+from buildbot.steps import source, shell
+from buildbot.status.builder import SUCCESS
+
+
+class FirstTime(shell.SetProperty):
+
+ def __init__(self, **kwds):
+ shell.SetProperty.__init__(self, description="first-time",
+ property="first-time")
+
+
+class PosixFirstTime(FirstTime):
+ command = "test -d pypy || echo yes"
+
+class WindowsFirstTime(FirstTime):
+ command = "if not exist pypy echo yes"
+
+
+class CondShellCommand(shell.ShellCommand):
+
+ def __init__(self, **kwds):
+ shell.ShellCommand.__init__(self, **kwds)
+ self.cond = kwds.get('cond', lambda props: True)
+
+ def start(self):
+ props = self.build.getProperties()
+ yes = self.cond(props)
+ if yes:
+ shell.ShellCommand.start(self)
+ else:
+ self.setStatus(None, SUCCESS)
+ self.finished(SUCCESS)
+
+# ________________________________________________________________
+
+def not_first_time(props):
+ first_time = props.getProperty("first-time")
+ return not first_time
+
+class PyPyOwnTestFactory(factory.BuildFactory):
+
+ def __init__(self, *a, **kw):
+ platform = kw.pop('platform', 'linux')
+ factory.BuildFactory.__init__(self, *a, **kw)
+
+ if platform == "win32":
+ first_time_check = WindowsFirstTime()
+ else:
+ first_time_check = PosixFirstTime()
+
+ self.addStep(first_time_check)
+ self.addStep(CondShellCommand(
+ description="wcrevert",
+ cond=not_first_time,
+ command = ["python", "py/bin/py.svnwcrevert", "."],
+ haltOnFailure=True))
+ self.addStep(source.SVN("https://codespeak.net/svn/pypy/"
+ "branch/pypy-pytrunk"))
+ self.addStep(shell.ShellCommand(
+ description="pytest",
+ command=["python", "py/bin/py.test",
+ "pypy/module/__builtin__", "pypy/module/operator",
+ "--session=FileLogSession", "--filelog=pytest.log"],
+ logfiles={'pytestLog': 'pytest.log'}))
More information about the Pypy-commit
mailing list