From ab3893ff4d202549bf79e5671cc9e6f18376cbfd Mon Sep 17 00:00:00 2001 From: Daniel Mizyrycki Date: Thu, 4 Jul 2013 20:28:54 -0700 Subject: [PATCH] testing, issue #776: Ensure docker-ci test docker code as it was at commit time --- testing/buildbot/master.cfg | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/testing/buildbot/master.cfg b/testing/buildbot/master.cfg index 48df5835f7..dd3f7c5f19 100644 --- a/testing/buildbot/master.cfg +++ b/testing/buildbot/master.cfg @@ -5,6 +5,7 @@ from buildbot.schedulers.basic import SingleBranchScheduler from buildbot.changes import filter from buildbot.config import BuilderConfig from buildbot.process.factory import BuildFactory +from buildbot.process.properties import Interpolate from buildbot.steps.shell import ShellCommand from buildbot.status import html from buildbot.status.web import authz, auth @@ -15,20 +16,20 @@ PORT_MASTER = 9989 # Port where buildbot master listen buildworkers TEST_USER = 'buildbot' # Credential to authenticate build triggers TEST_PWD = 'docker' # Credential to authenticate build triggers BUILDER_NAME = 'docker' -BUILDPASSWORD = 'pass-docker' # Credential to authenticate buildworkers -GITHUB_DOCKER = "github.com/dotcloud/docker" -DOCKER_PATH = "/data/docker" -BUILDER_PATH = "/data/buildbot/slave/{0}/build".format(BUILDER_NAME) +GITHUB_DOCKER = 'github.com/dotcloud/docker' +DOCKER_PATH = '/data/docker' +BUILDER_PATH = '/data/buildbot/slave/{0}/build'.format(BUILDER_NAME) DOCKER_BUILD_PATH = BUILDER_PATH + '/src/github.com/dotcloud/docker' +BUILDBOT_PWD = 'pass-docker' c = BuildmasterConfig = {} c['title'] = "Docker" c['titleURL'] = "waterfall" -c['buildbotURL'] = "http://0.0.0.0:{0}/".format(PORT_WEB) +c['buildbotURL'] = "http://docker-ci.dotcloud.com/" c['db'] = {'db_url':"sqlite:///state.sqlite"} -c['slaves'] = [BuildSlave('buildworker', BUILDPASSWORD)] +c['slaves'] = [BuildSlave('buildworker', BUILDBOT_PWD)] c['slavePortnum'] = PORT_MASTER c['schedulers'] = [ForceScheduler(name='trigger',builderNames=[BUILDER_NAME])] @@ -36,14 +37,12 @@ c['schedulers'].append(SingleBranchScheduler(name="all", change_filter=filter.ChangeFilter(branch='master'),treeStableTimer=None, builderNames=[BUILDER_NAME])) -# Docker test command -test_cmd = ("cd /tmp; rm -rf {0}; export GOPATH={0}; go get -d {1}; cd {2}; " - "go test").format(BUILDER_PATH,GITHUB_DOCKER,DOCKER_BUILD_PATH) - # Builder factory = BuildFactory() -factory.addStep(ShellCommand(description='Docker',logEnviron=False, - usePTY=True,command=test_cmd)) +factory.addStep(ShellCommand(description='Docker',logEnviron=False,usePTY=True, + command=["sh", "-c", Interpolate("cd ..; rm -rf build; export GOPATH={0}; " + "go get -d {1}; cd {2}; git reset --hard %(src::revision:-unknown)s; " + "go test -v".format(BUILDER_PATH,GITHUB_DOCKER,DOCKER_BUILD_PATH))])) c['builders'] = [BuilderConfig(name=BUILDER_NAME,slavenames=['buildworker'], factory=factory)]