"Fossies" - the Fresh Open Source Software Archive

Member "buildbot-2.5.1/buildbot/test/integration/test_integration_mastershell.py" (24 Nov 2019, 2112 Bytes) of package /linux/misc/buildbot-2.5.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "test_integration_mastershell.py": 2.3.1_vs_2.4.0.

    1 # This file is part of Buildbot.  Buildbot is free software: you can
    2 # redistribute it and/or modify it under the terms of the GNU General Public
    3 # License as published by the Free Software Foundation, version 2.
    4 #
    5 # This program is distributed in the hope that it will be useful, but WITHOUT
    6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    7 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    8 # details.
    9 #
   10 # You should have received a copy of the GNU General Public License along with
   11 # this program; if not, write to the Free Software Foundation, Inc., 51
   12 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   13 #
   14 # Copyright Buildbot Team Members
   15 
   16 
   17 from twisted.internet import defer
   18 
   19 from buildbot.test.util.integration import RunMasterBase
   20 
   21 
   22 # This integration test creates a master and worker environment,
   23 # with one builders and a shellcommand step
   24 # meant to be a template for integration steps
   25 class ShellMaster(RunMasterBase):
   26 
   27     @defer.inlineCallbacks
   28     def test_shell(self):
   29         yield self.setupConfig(masterConfig())
   30 
   31         change = dict(branch="master",
   32                       files=["foo.c"],
   33                       author="me@foo.com",
   34                       committer="me@foo.com",
   35                       comments="good stuff",
   36                       revision="HEAD",
   37                       project="none"
   38                       )
   39         build = yield self.doForceBuild(wantSteps=True, useChange=change, wantLogs=True)
   40         self.assertEqual(build['buildid'], 1)
   41 
   42 
   43 # master configuration
   44 def masterConfig():
   45     c = {}
   46     from buildbot.config import BuilderConfig
   47     from buildbot.process.factory import BuildFactory
   48     from buildbot.plugins import steps, schedulers
   49 
   50     c['schedulers'] = [
   51         schedulers.AnyBranchScheduler(
   52             name="sched",
   53             builderNames=["testy"])]
   54 
   55     f = BuildFactory()
   56     f.addStep(steps.MasterShellCommand(command='echo hello'))
   57     c['builders'] = [
   58         BuilderConfig(name="testy",
   59                       workernames=["local1"],
   60                       factory=f)]
   61     return c