当前位置: 首页>>代码示例>>Python>>正文


Python Build.setBuilder方法代码示例

本文整理汇总了Python中buildbot.process.base.Build.setBuilder方法的典型用法代码示例。如果您正苦于以下问题:Python Build.setBuilder方法的具体用法?Python Build.setBuilder怎么用?Python Build.setBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在buildbot.process.base.Build的用法示例。


在下文中一共展示了Build.setBuilder方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testStopBuild

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
    def testStopBuild(self):
        r = FakeRequest()

        b = Build([r])
        b.setBuilder(Mock())

        step = Mock()
        step.return_value = step
        b.setStepFactories([(step, {})])

        slavebuilder = Mock()
        status = Mock()

        def startStep(*args, **kw):
            # Now interrupt the build
            b.stopBuild("stop it")
            return defer.Deferred()
        step.startStep = startStep

        b.startBuild(status, None, slavebuilder)

        self.assert_("Interrupted" in b.text)
        self.assertEqual(b.result, FAILURE)

        self.assert_( ('interrupt', ('stop it',), {}) in step.method_calls)
开发者ID:gvalkov,项目名称:buildbot,代码行数:27,代码来源:test_process_base.py

示例2: testBuildLocksAcquired

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
    def testBuildLocksAcquired(self):
        r = FakeRequest()

        b = Build([r])
        b.setBuilder(Mock())
        b.builder.botmaster = FakeMaster()
        slavebuilder = Mock()
        status = Mock()

        l = SlaveLock('lock')
        claimCount = [0]
        lock_access = l.access('counting')
        l.access = lambda mode: lock_access
        real_lock = b.builder.botmaster.getLockByID(l).getLock(slavebuilder)
        def claim(owner, access):
            claimCount[0] += 1
            return real_lock.old_claim(owner, access)
        real_lock.old_claim = real_lock.claim
        real_lock.claim = claim
        b.setLocks([l])

        step = Mock()
        step.return_value = step
        step.startStep.return_value = SUCCESS
        b.setStepFactories([(step, {})])

        b.startBuild(status, None, slavebuilder)

        self.assertEqual(b.result, SUCCESS)
        self.assert_( ('startStep', (b.remote,), {}) in step.method_calls)
        self.assertEquals(claimCount[0], 1)
开发者ID:gvalkov,项目名称:buildbot,代码行数:33,代码来源:test_process_base.py

示例3: testStopBuildWaitingForLocks

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
    def testStopBuildWaitingForLocks(self):
        r = FakeRequest()

        b = Build([r])
        b.setBuilder(Mock())
        b.builder.botmaster = FakeMaster()
        slavebuilder = Mock()
        status = Mock()

        l = SlaveLock('lock')
        lock_access = l.access('counting')
        l.access = lambda mode: lock_access
        real_lock = b.builder.botmaster.getLockByID(l).getLock(slavebuilder)
        b.setLocks([l])

        step = Mock()
        step.return_value = step
        step.startStep.return_value = SUCCESS
        b.setStepFactories([(step, {})])

        real_lock.claim(Mock(), l.access('counting'))

        def acquireLocks(res=None):
            retval = Build.acquireLocks(b, res)
            b.stopBuild('stop it')
            return retval
        b.acquireLocks = acquireLocks

        b.startBuild(status, None, slavebuilder)

        self.assert_( ('startStep', (b.remote,), {}) not in step.method_calls)
        self.assert_(b.currentStep is None)
        self.assertEqual(b.result, EXCEPTION)
        self.assert_( ('interrupt', ('stop it',), {}) not in step.method_calls)
开发者ID:Flumotion,项目名称:buildbot,代码行数:36,代码来源:test_process_base.py

示例4: makeBuildStep

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
def makeBuildStep(basedir, step_class=BuildStep, **kwargs):
    bss = setupBuildStepStatus(basedir)

    ss = SourceStamp()
    setup = {'name': "builder1", "slavename": "bot1",
             'builddir': "builddir", 'factory': None}
    b0 = Builder(setup, bss.getBuild().getBuilder())
    br = BuildRequest("reason", ss)
    b = Build([br])
    b.setBuilder(b0)
    s = step_class(**kwargs)
    s.setBuild(b)
    s.setStepStatus(bss)
    b.setupStatus(bss.getBuild())
    s.slaveVersion = fake_slaveVersion
    return s
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:18,代码来源:runutils.py

示例5: makeBuildStep

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
def makeBuildStep(basedir, step_class=BuildStep, **kwargs):
    bss = setupBuildStepStatus(basedir)

    ss = SourceStamp()
    setup = {"name": "builder1", "slavename": "bot1", "builddir": "builddir", "factory": None}
    b0 = Builder(setup, bss.getBuild().getBuilder())
    b0.botmaster = FakeBotMaster()
    br = BuildRequest("reason", ss, "test_builder")
    b = Build([br])
    b.setBuilder(b0)
    s = step_class(**kwargs)
    s.setBuild(b)
    s.setStepStatus(bss)
    b.build_status = bss.getBuild()
    b.setupProperties()
    s.slaveVersion = fake_slaveVersion
    return s
开发者ID:sridhar,项目名称:buildbot,代码行数:19,代码来源:runutils.py

示例6: testRunSuccessfulBuild

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
    def testRunSuccessfulBuild(self):
        r = FakeRequest()

        b = Build([r])
        b.setBuilder(Mock())

        step = Mock()
        step.return_value = step
        step.startStep.return_value = SUCCESS
        b.setStepFactories([(step, {})])

        slavebuilder = Mock()
        status = Mock()

        b.startBuild(status, None, slavebuilder)

        self.assertEqual(b.result, SUCCESS)
        self.assert_( ('startStep', (b.remote,), {}) in step.method_calls)
开发者ID:gvalkov,项目名称:buildbot,代码行数:20,代码来源:test_process_base.py

示例7: makeBuildStep

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
def makeBuildStep(basedir, step_class=BuildStep, **kwargs):
    bss = setupBuildStepStatus(basedir)

    ss = SourceStamp()
    setup = {'name': "builder1", "slavename": "bot1",
             'builddir': "builddir", 'slavebuilddir': "slavebuilddir", 'factory': None}
    b0 = Builder(setup, bss.getBuild().getBuilder())
    b0.botmaster = FakeBotMaster()
    br = BuildRequest("reason", ss, 'test_builder')
    b = Build([br])
    b.setBuilder(b0)
    s = step_class(**kwargs)
    s.setBuild(b)
    s.setStepStatus(bss)
    b.build_status = bss.getBuild()
    b.setupProperties()
    s.slaveVersion = fake_slaveVersion
    s.step_status.setText(s.describe(False))
    return s
开发者ID:cmip,项目名称:buildbot,代码行数:21,代码来源:runutils.py

示例8: testStopBuildWaitingForStepLocks

# 需要导入模块: from buildbot.process.base import Build [as 别名]
# 或者: from buildbot.process.base.Build import setBuilder [as 别名]
    def testStopBuildWaitingForStepLocks(self):
        r = FakeRequest()

        b = Build([r])
        b.setBuilder(Mock())
        b.builder.botmaster = FakeMaster()
        slavebuilder = Mock()
        status = Mock()

        l = SlaveLock('lock')
        claimCount = [0]
        lock_access = l.access('counting')
        l.access = lambda mode: lock_access
        real_lock = b.builder.botmaster.getLockByID(l).getLock(slavebuilder)

        step = LoggingBuildStep(locks=[lock_access])
        def factory(*args):
            return step
        b.setStepFactories([(factory, {})])

        real_lock.claim(Mock(), l.access('counting'))

        gotLocks = [False]

        def acquireLocks(res=None):
            gotLocks[0] = True
            retval = LoggingBuildStep.acquireLocks(step, res)
            self.assert_(b.currentStep is step)
            b.stopBuild('stop it')
            return retval
        step.acquireLocks = acquireLocks
        step.setStepStatus = Mock()
        step.step_status = Mock()
        step.step_status.addLog().chunkSize = 10
        step.step_status.getLogs.return_value = []

        b.startBuild(status, None, slavebuilder)

        self.assertEqual(gotLocks, [True])
        self.assert_(('stepStarted', (), {}) in step.step_status.method_calls)
        self.assert_("Interrupted" in b.text, b.text)
        self.assertEqual(b.result, FAILURE)
开发者ID:gvalkov,项目名称:buildbot,代码行数:44,代码来源:test_process_base.py


注:本文中的buildbot.process.base.Build.setBuilder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。