Skip to content

Commit

Permalink
Merge branch 'bug2125' of git://github.com/tomprince/buildbot
Browse files Browse the repository at this point in the history
* 'bug2125' of git://github.com/tomprince/buildbot:
  Document and test MakeDirectory.
  • Loading branch information
djmitche committed Jan 20, 2012
2 parents d4cedf8 + df5e866 commit 8986cee
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
39 changes: 39 additions & 0 deletions master/buildbot/test/unit/test_steps_slave.py
Expand Up @@ -162,3 +162,42 @@ def test_render(self):
self.expectOutcome(result=SUCCESS,
status_text=["RemoveDirectory"])
return self.runStep()

class TestMakeDirectory(steps.BuildStepMixin, unittest.TestCase):

def setUp(self):
return self.setUpBuildStep()

def tearDown(self):
return self.tearDownBuildStep()

def test_success(self):
self.setupStep(slave.MakeDirectory(dir="d"))
self.expectCommands(
ExpectLogged('mkdir', { 'dir' : 'd' })
+ 0
)
self.expectOutcome(result=SUCCESS,
status_text=["MakeDirectory"])
return self.runStep()

def test_failure(self):
self.setupStep(slave.MakeDirectory(dir="d"))
self.expectCommands(
ExpectLogged('mkdir', { 'dir' : 'd' })
+ 1
)
self.expectOutcome(result=FAILURE,
status_text=["Create failed."])
return self.runStep()

def test_render(self):
self.setupStep(slave.MakeDirectory(dir=properties.Property("x")))
self.properties.setProperty('x', 'XXX', 'here')
self.expectCommands(
ExpectLogged('mkdir', { 'dir' : 'XXX' })
+ 0
)
self.expectOutcome(result=SUCCESS,
status_text=["MakeDirectory"])
return self.runStep()
12 changes: 12 additions & 0 deletions master/docs/manual/cfg-buildsteps.rst
Expand Up @@ -1866,6 +1866,18 @@ This command recursively deletes a directory on the slave. ::

This step requires slave version 0.8.4 or later.

.. bb:step:: MakeDirectory
MakeDirectory
+++++++++++++++

This command creates a directory on the slave. ::

from buildbot.steps.slave import MakeDirectory
f.addStep(MakeDirectory(dir="build/build"))

This step requires slave version 0.8.5 or later.

.. _Python-BuildSteps:

Python BuildSteps
Expand Down

0 comments on commit 8986cee

Please sign in to comment.