Example #1
0
 def as_testing(self, source):
     builder_configs = [b.as_config() for b in self.builders]
     buildbot_config_dict = {
         'buildbotNetUsageData': None,
         'workers': self.workers,
         'builders': builder_configs,
         'schedulers': self.schedulers,
         'db': {'db_url': 'sqlite://'},
         'protocols': {'pb': {'port': 'tcp:0:interface=127.0.0.1'}}
     }
     return BuildbotMasterConfig.loadFromDict(buildbot_config_dict,
                                              filename=source)
Example #2
0
    def as_buildbot(self, source):
        """Returns with the buildbot compatible buildmaster configuration"""

        if self.change_hook is None:
            hook_dialect_config = {}
        else:
            hook_dialect_config = self.change_hook._as_hook_dialect_config()

        buildbot_config_dict = {
            'buildbotNetUsageData': None,
            'title': self.title,
            'titleURL': self.url,
            'buildbotURL': self.url,
            'workers': self.workers,
            'builders': self.builders,
            'schedulers': self.schedulers,
            'services': self.reporters,
            'change_source': self.pollers,
            'secretsProviders': self.secret_providers or [],
            'protocols': {
                'pb': {
                    'port': self.worker_port
                }
            },
            'db': {
                'db_url': self.database_url
            },
            'www': {
                'port': self.webui_port,
                'change_hook_dialects': hook_dialect_config,
                'plugins': {
                    'waterfall_view': {},
                    'console_view': {},
                    'grid_view': {}
                }
            }
        }

        # buildbot raises errors for None or empty dict values so only set of
        # they are passed
        if self.auth is not None:
            buildbot_config_dict['www']['auth'] = self.auth
        if self.authz is not None:
            buildbot_config_dict['www']['authz'] = self.authz

        return BuildbotMasterConfig.loadFromDict(buildbot_config_dict,
                                                 filename=source)
Example #3
0
 def loadConfig(self):
     return MasterConfig.loadFromDict(self.config_dict, '<dict>')
Example #4
0
 def loadConfig(self):
     return MasterConfig.loadFromDict(self.config_dict, '<dict>')
 def expectNoConfigError(self):
     config = MasterConfig()
     config.loadFromDict(self.config_dict, "test")
Example #6
0
 def expectNoConfigError(self):
     config = MasterConfig()
     config.loadFromDict(self.config_dict, "test")