def makeFullScheduler(self, **kwargs):
        sched = self.attachScheduler(basic.SingleBranchScheduler(**kwargs),
                                     self.OBJECTID)

        # add a Clock to help checking timing issues
        self.clock = sched._reactor = task.Clock()
        return sched
Exemple #2
0
    def makeFullScheduler(self, **kwargs):
        sched = self.attachScheduler(basic.SingleBranchScheduler(**kwargs),
                                     self.SCHEDULERID,
                                     overrideBuildsetMethods=True)

        # add a Clock to help checking timing issues
        self.clock = sched._reactor = task.Clock()
        return sched
    def makeFullScheduler(self, **kwargs):
        self.master.db.insertTestData([fakedb.Builder(name=builderName) for builderName in kwargs['builderNames']])
        sched = self.attachScheduler(basic.SingleBranchScheduler(**kwargs),
                                     self.SCHEDULERID,
                                     overrideBuildsetMethods=True)

        # add a Clock to help checking timing issues
        self.clock = sched._reactor = task.Clock()
        return sched
Exemple #4
0
 def test_constructor_branch_forbidden(self):
     with self.assertRaises(config.ConfigErrors):
         basic.SingleBranchScheduler(name="tsched", treeStableTimer=60,
                                     branch='x')
Exemple #5
0
 def test_constructor_no_branch_but_filter(self):
     # this shouldn't fail
     basic.SingleBranchScheduler(name="tsched", treeStableTimer=60,
                                 builderNames=['a', 'b'], change_filter=mock.Mock())
Exemple #6
0
def ros_testbuild(c,
                  job_name,
                  url,
                  branch,
                  distro,
                  arch,
                  rosdistro,
                  machines,
                  othermirror,
                  keys,
                  token=None):

    # Change source is either GitPoller or GitPRPoller
    # TODO: make this configurable for svn/etc
    project_name = ''
    if token:
        project_name = '_'.join([job_name, rosdistro, 'prtestbuild'])
        c['change_source'].append(
            GitPRPoller(
                name=rosdistro + "_pr_poller",
                repourl=url,  # this may pose some problems
                project=project_name,
                token=token,
                pollInterval=15))
        # parse repo_url git@github:author/repo.git to repoOwner, repoName
        r_owner, r_name = (url.split(':')[1])[:-4].split('/')
        c['status'].append(
            status.GitHubStatus(token=token,
                                repoOwner=r_owner,
                                repoName=r_name))
    else:
        project_name = '_'.join([job_name, rosdistro, 'testbuild'])
        c['change_source'].append(
            NamedGitPoller(repourl=url,
                           name=rosdistro,
                           branch=branch,
                           project=project_name))

    c['schedulers'].append(
        basic.SingleBranchScheduler(
            name=project_name,
            builderNames=[
                project_name,
            ],
            change_filter=ChangeFilter(project=project_name)))

    # Directory which will be bind-mounted
    binddir = '/tmp/' + project_name

    f = BuildFactory()
    # Remove any old crud in /tmp folder
    f.addStep(ShellCommand(command=['rm', '-rf', binddir], hideStepIf=success))
    # Check out repository (to /tmp)
    f.addStep(
        Git(repourl=util.Property('repository', default=url),
            branch=util.Property('branch', default=branch),
            alwaysUseLatest=True,
            mode='full',
            workdir=binddir + '/src/' + job_name))
    # Download testbuild.py script from master
    f.addStep(
        FileDownload(name=job_name + '-grab-script',
                     mastersrc='scripts/testbuild.py',
                     slavedest=Interpolate('%(prop:workdir)s/testbuild.py'),
                     hideStepIf=success))
    # Update the cowbuilder
    f.addStep(
        ShellCommand(command=['cowbuilder-update.py', distro, arch] + keys,
                     hideStepIf=success))
    # Make and run tests in a cowbuilder
    f.addStep(
        TestBuild(name=job_name + '-build',
                  command=[
                      'sudo', 'cowbuilder', '--execute',
                      Interpolate('%(prop:workdir)s/testbuild.py'),
                      '--distribution', distro, '--architecture', arch,
                      '--bindmounts', binddir, '--basepath',
                      '/var/cache/pbuilder/base-' + distro + '-' + arch +
                      '.cow', '--override-config', '--othermirror',
                      othermirror, '--', binddir, rosdistro
                  ],
                  logfiles={'tests': binddir + '/testresults'},
                  descriptionDone=['make and test', job_name]))
    c['builders'].append(
        BuilderConfig(name=project_name, slavenames=machines, factory=f))
    # return the name of the job created
    return project_name
Exemple #7
0
 def test_constructor_branch_forbidden(self):
     self.assertRaises(
         AssertionError, lambda: basic.SingleBranchScheduler(
             name="tsched", treeStableTimer=60, branch='x'))
Exemple #8
0
 def test_constructor_branch_mandatory(self):
     self.assertRaises(
         AssertionError,
         lambda: basic.SingleBranchScheduler(name="tsched",
                                             treeStableTimer=60))
 def Config(self):
     return {
         'projectName':
         "Strawberry",
         'projectURL':
         "https://www.strawberrymusicplayer.org/",
         'buildbotURL':
         "https://buildbot.strawberrymusicplayer.org/",
         'protocols': {
             "pb": {
                 "port": "tcp:9989:interface=0.0.0.0"
             }
         },
         'workers':
         self.workers,
         'builders':
         self.builders,
         'change_source': [
             builders.GitPoller("strawberry", "master"),
             builders.GitPoller("strawberry-mxe", "master"),
         ],
         'www': {
             'port':
             8010,
             'authz':
             util.Authz(
                 allowRules=[
                     util.AnyControlEndpointMatcher(role="admins",
                                                    defaultDeny=True)
                 ],
                 roleMatchers=[
                     util.RolesFromEmails(admins=["*****@*****.**"]),
                     util.RolesFromOwner(role="owner"),
                 ]),
             'auth':
             util.GitHubAuth(GITHUB_AUTH["clientid"],
                             GITHUB_AUTH["clientsecret"]),
             'plugins': {
                 'waterfall_view': True,
                 'console_view': True,
                 'grid_view': True,
             }
         },
         'schedulers': [
             basic.SingleBranchScheduler(
                 name="automatic",
                 change_filter=filter.ChangeFilter(project="strawberry",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=self.auto_builder_names,
             ),
             basic.SingleBranchScheduler(
                 name="mxe",
                 change_filter=filter.ChangeFilter(project="strawberry-mxe",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=[
                     'MXE',
                 ],
             ),
             forcesched.ForceScheduler(
                 name="force",
                 builderNames=[x['name'] for x in self.builders],
                 buttonName="Start Custom Build",
             ),
             #timed.Nightly(
             #  name="nightly",
             #  minute=0,
             #  branch="master",
             #  builderNames=[x['name'] for x in self.builders],
             #),
         ],
         'collapseRequests':
         False,
     }
schedulers = []

nightly = timed.Nightly(name="Nightly",
                        branch=None,
                        builderNames=["System_Update"],
                        minute=0,
                        hour=1)
schedulers.append(nightly)

weekly = timed.Nightly(
    name="Weekly",
    branch=None,
    minute=0,
    hour=2,
    dayOfWeek=7,  # 0 = Monday, 7 = Sunday
    builderNames=["JaCoCo_ITs_Linux"])
schedulers.append(weekly)

schedulers.append(
    basic.SingleBranchScheduler(
        name="JaCoCo_Checkin",
        branch=None,
        treeStableTimer=1,
        builderNames=[]  # TODO
    ))

schedulers.append(
    triggerable.Triggerable(name="JaCoCo_Deploy",
                            builderNames=["JaCoCo_Deploy"]))
Exemple #11
0
def ros_testbuild(c, job_name, url, branch, distro, arch, rosdistro, machines, othermirror, keys):

    # Change source is simply a GitPoller
    # TODO: make this configurable for svn/etc
    c['change_source'].append(
        NamedGitPoller(
            repourl = url,
            name = rosdistro,
            branch = branch,
            project = job_name+'_'+rosdistro+'_testbuild'
        )
    )
    c['schedulers'].append(
        basic.SingleBranchScheduler(
            name = job_name+'_'+rosdistro+'_testbuild',
            builderNames = [job_name+'_'+rosdistro+'_testbuild',],
            change_filter = ChangeFilter(project = job_name+'_'+rosdistro+'_testbuild')
        )
    )

    # Directory which will be bind-mounted
    binddir = '/tmp/'+job_name+'_'+rosdistro+'_testbuild'

    f = BuildFactory()
    # Remove any old crud in /tmp folder
    f.addStep(
        ShellCommand(
            command = ['rm', '-rf', binddir],
            hideStepIf = success
        )
    )
    # Check out repository (to /tmp)
    f.addStep(
        Git(
            repourl = url,
            branch = branch,
            alwaysUseLatest = True,
            mode = 'full',
            workdir = binddir+'/src/'+job_name
        )
    )
    # Download testbuild.py script from master
    f.addStep(
        FileDownload(
            name = job_name+'-grab-script',
            mastersrc = 'scripts/testbuild.py',
            slavedest = Interpolate('%(prop:workdir)s/testbuild.py'),
            hideStepIf = success
        )
    )
    # Update the cowbuilder
    f.addStep(
        ShellCommand(
            command = ['cowbuilder-update.py', distro, arch] + keys,
            hideStepIf = success
        )
    )
    # Make and run tests in a cowbuilder
    f.addStep(
        TestBuild(
            name = job_name+'-build',
            command = ['cowbuilder', '--execute', Interpolate('%(prop:workdir)s/testbuild.py'),
                       '--distribution', distro, '--architecture', arch,
                       '--bindmounts', binddir,
                       '--basepath', '/var/cache/pbuilder/base-'+distro+'-'+arch+'.cow',
                       '--override-config', '--othermirror', othermirror,
                       '--', binddir, rosdistro],
            logfiles = {'tests' : binddir+'/testresults' },
            env = {'DIST': distro},
            descriptionDone = ['make and test', job_name]
        )
    )
    c['builders'].append(
        BuilderConfig(
            name = job_name+'_'+rosdistro+'_testbuild',
            slavenames = machines,
            factory = f
        )
    )
    # return the name of the job created
    return job_name+'_'+rosdistro+'_testbuild'
Exemple #12
0
 def Config(self):
     return {
         'projectName':
         "Clementine",
         'projectURL':
         "http://www.clementine-player.org/",
         'buildbotURL':
         "http://buildbot.clementine-player.org/",
         'slavePortnum':
         9989,
         'slaves':
         self.slaves,
         'builders':
         self.builders,
         'change_source': [
             builders.GitPoller("Android-Remote"),
             builders.GitPoller("Clementine"),
             builders.GitPoller("Dependencies"),
             builders.GitPoller("Website"),
         ],
         'status': [
             html.WebStatus(
                 http_port="tcp:8010",
                 authz=authz.Authz(
                     forceBuild=True,
                     forceAllBuilds=True,
                     stopBuild=True,
                     stopAllBuilds=True,
                     cancelPendingBuild=True,
                     cancelAllPendingBuilds=True,
                     stopChange=True,
                 ),
             ),
             mail.MailNotifier(
                 fromaddr="*****@*****.**",
                 lookup="gmail.com",
                 mode="failing",
             ),
         ],
         'schedulers': [
             basic.SingleBranchScheduler(
                 name="automatic",
                 change_filter=filter.ChangeFilter(project="clementine",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=self.auto_builder_names,
             ),
             basic.SingleBranchScheduler(
                 name="dependencies",
                 change_filter=filter.ChangeFilter(project="dependencies",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=[
                     'Mac Dependencies',
                     'Windows Dependencies',
                 ],
             ),
             basic.SingleBranchScheduler(
                 name="website",
                 change_filter=filter.ChangeFilter(project="website",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=[
                     "Transifex website POT push",
                 ],
             ),
             basic.SingleBranchScheduler(
                 name="android-remote",
                 change_filter=filter.ChangeFilter(project="android-remote",
                                                   branch="master"),
                 treeStableTimer=2 * 60,
                 builderNames=[
                     "Android Remote",
                 ],
             ),
             forcesched.ForceScheduler(
                 name="force",
                 reason=forcesched.FixedParameter(name="reason",
                                                  default="force build"),
                 branch=forcesched.StringParameter(name="branch",
                                                   default="master"),
                 revision=forcesched.FixedParameter(name="revision",
                                                    default=""),
                 repository=forcesched.FixedParameter(name="repository",
                                                      default=""),
                 project=forcesched.FixedParameter(name="project",
                                                   default=""),
                 properties=[],
                 builderNames=[x['name'] for x in self.builders],
             ),
             timed.Nightly(
                 name="transifex_pull",
                 change_filter=filter.ChangeFilter(project="clementine",
                                                   branch="master"),
                 hour=10,
                 minute=0,
                 dayOfWeek=0,
                 branch="master",
                 builderNames=[
                     "Transifex PO pull",
                     "Transifex website PO pull",
                     "Transifex Android PO pull",
                 ],
             ),
         ],
     }