Skip to content

Commit

Permalink
Merge pull request #1600 from yetanotherion/master
Browse files Browse the repository at this point in the history
checkconfig: execute it in a reactor
  • Loading branch information
Mikhail Sobolev committed Mar 17, 2015
2 parents 3942fe5 + d78107d commit cf8821c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions master/buildbot/scripts/checkconfig.py
Expand Up @@ -18,6 +18,7 @@

from buildbot import config
from buildbot.scripts.base import getConfigFileFromTac
from buildbot.util import in_reactor


def _loadConfig(basedir, configFile, quiet):
Expand All @@ -36,6 +37,7 @@ def _loadConfig(basedir, configFile, quiet):
return 0


@in_reactor
def checkconfig(config):
quiet = config.get('quiet')
configFile = config.get('configFile', os.getcwd())
Expand Down
3 changes: 3 additions & 0 deletions master/buildbot/test/unit/test_scripts_checkconfig.py
Expand Up @@ -142,6 +142,9 @@ class TestCheckconfig(unittest.TestCase):

def setUp(self):
self.loadConfig = mock.Mock(spec=checkconfig._loadConfig, return_value=3)
# checkconfig is decorated with @in_reactor, so strip that decoration
# since the reactor is already running
self.patch(checkconfig, 'checkconfig', checkconfig.checkconfig._orig)
self.patch(checkconfig, '_loadConfig', self.loadConfig)

def test_checkconfig_default(self):
Expand Down

0 comments on commit cf8821c

Please sign in to comment.