Skip to content

Commit

Permalink
builddir and workdir properties should be strings, not tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
olof committed Aug 8, 2013
1 parent 3118974 commit e359d00
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/process/build.py
Expand Up @@ -199,7 +199,7 @@ def setupSlaveBuilder(self, slavebuilder):
if slavebuilder.slave.slave_basedir:
builddir = self.path_module.join(
slavebuilder.slave.slave_basedir,
self.builder.config.slavebuilddir),
self.builder.config.slavebuilddir)
self.setProperty("builddir", builddir, "slave")
self.setProperty("workdir", builddir, "slave (deprecated)")

Expand Down
25 changes: 24 additions & 1 deletion master/buildbot/test/unit/test_process_build.py
Expand Up @@ -25,7 +25,7 @@
from buildbot.test.fake.fakemaster import FakeBotMaster
from buildbot import config

from mock import Mock
from mock import Mock, call

class FakeChange:
properties = Properties()
Expand Down Expand Up @@ -235,6 +235,29 @@ def testBuildcanStartWithSlavebuilder(self):
slave_lock_1.release(slavebuilder1, counting_access)


def testBuilddirPropType(self):
import posixpath

b = self.build

slavebuilder = Mock()
b.build_status = Mock()
b.builder.config.slavebuilddir = 'test'
slavebuilder.slave.slave_basedir = "/srv/buildbot/slave"
slavebuilder.slave.path_module = posixpath
b.getProperties = Mock()
b.setProperty = Mock()

b.setupSlaveBuilder(slavebuilder)

expected_path = '/srv/buildbot/slave/test'

b.setProperty.assert_has_calls(
[call('workdir', expected_path, 'slave (deprecated)'),
call('builddir', expected_path, 'slave')],
any_order=True)


def testBuildLocksAcquired(self):
b = self.build

Expand Down

0 comments on commit e359d00

Please sign in to comment.