示例#1
0
 def test_createJobfile_v5(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = 'someuser'
     comment = 'insightful comment'
     builderNames = ['runtests']
     properties = {'foo': 'bar'}
     job = tryclient.createJobfile(jobid, branch, baserev, patch_level,
                                   patch_body, repository, project, who,
                                   comment, builderNames, properties)
     jobstr = self.makeNetstring(
         '5',
         json.dumps({
             'jobid': jobid,
             'branch': branch,
             'baserev': baserev,
             'patch_level': patch_level,
             'patch_body': patch_body,
             'repository': repository,
             'project': project,
             'who': who,
             'comment': comment,
             'builderNames': builderNames,
             'properties': properties,
         }))
     self.assertEqual(job, jobstr)
 def test_createJobfile_v5(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = 'someuser'
     comment = 'insightful comment'
     builderNames = ['runtests']
     properties = {'foo': 'bar'}
     job = tryclient.createJobfile(
         jobid, branch, baserev, patch_level, patch_body, repository,
         project, who, comment, builderNames, properties)
     jobstr = self.makeNetstring(
         '5',
         json.dumps({
             'jobid': jobid, 'branch': branch, 'baserev': baserev,
             'patch_level': patch_level, 'patch_body': patch_body,
             'repository': repository, 'project': project, 'who': who,
             'comment': comment, 'builderNames': builderNames,
             'properties': properties,
         }))
     self.assertEqual(job, jobstr)
示例#3
0
 def test_createJobfile_v4(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = 'someuser'
     comment = 'insightful comment'
     builderNames = ['runtests']
     properties = {}
     job = tryclient.createJobfile(jobid, branch, baserev, patch_level,
                                   patch_body, repository, project, who,
                                   comment, builderNames, properties)
     jobstr = self.makeNetstring('4', jobid, branch, baserev,
                                 str(patch_level), patch_body, repository,
                                 project, who, comment, builderNames[0])
     self.assertEqual(job, jobstr)
示例#4
0
 def test_createJobfile_v2_two_builders(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = None
     comment = None
     builderNames = ['runtests', 'moretests']
     properties = {}
     job = tryclient.createJobfile(jobid, branch, baserev, patch_level,
                                   patch_body, repository, project, who,
                                   comment, builderNames, properties)
     jobstr = self.makeNetstring('2', jobid, branch, baserev,
                                 str(patch_level), patch_body, repository,
                                 project, builderNames[0], builderNames[1])
     self.assertEqual(job, jobstr)
 def test_createJobfile_v4(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = 'someuser'
     comment = 'insightful comment'
     builderNames = ['runtests']
     properties = {}
     job = tryclient.createJobfile(
         jobid, branch, baserev, patch_level, patch_body, repository,
         project, who, comment, builderNames, properties)
     jobstr = self.makeNetstring(
         '4', jobid, branch, baserev, str(patch_level), patch_body,
         repository, project, who, comment, builderNames[0])
     self.assertEqual(job, jobstr)
 def test_createJobfile_v2_two_builders(self):
     jobid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patch_level = 0
     patch_body = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = None
     comment = None
     builderNames = ['runtests', 'moretests']
     properties = {}
     job = tryclient.createJobfile(
         jobid, branch, baserev, patch_level, patch_body, repository,
         project, who, comment, builderNames, properties)
     jobstr = self.makeNetstring(
         '2', jobid, branch, baserev, str(patch_level), patch_body,
         repository, project, builderNames[0], builderNames[1])
     self.assertEqual(job, jobstr)
 def test_createJobfile_v3(self):
     bsid = '123-456'
     branch = 'branch'
     baserev = 'baserev'
     patchlevel = 0
     diff = 'diff...'
     repository = 'repo'
     project = 'proj'
     who = 'someuser'
     comment = None
     builderNames = ['runtests']
     properties = {}
     job = tryclient.createJobfile(
         bsid, branch, baserev, patchlevel, diff, repository, project, who,
         comment, builderNames, properties)
     jobstr = self.makeNetstring(
         '3', bsid, branch, baserev, str(patchlevel), diff, repository,
         project, who, builderNames[0])
     self.assertEqual(job, jobstr)
示例#8
0
 def testTryJobdir(self):
     self.master.basedir = "try_jobdir"
     os.mkdir(self.master.basedir)
     jobdir = "jobdir1"
     jobdir_abs = os.path.join(self.master.basedir, jobdir)
     self.createMaildir(jobdir_abs)
     s = scheduler.Try_Jobdir("try1", ["a", "b"], jobdir)
     self.addScheduler(s)
     self.failIf(self.master.sets)
     job1 = tryclient.createJobfile("buildsetID",
                                    "branch1", "123", 1, "diff",
                                    ["a", "b"])
     self.master.d = d = defer.Deferred()
     self.pushJob(jobdir_abs, job1)
     d.addCallback(self._testTryJobdir_1)
     # N.B.: if we don't have DNotify, we poll every 10 seconds, so don't
     # set a .timeout here shorter than that. TODO: make it possible to
     # set the polling interval, so we can make it shorter.
     return d
示例#9
0
 def _then(ign):
     job1 = tryclient.createJobfile("buildsetID",
                                    "branch1", "123", 1, "diff",
                                    "repository", "project",
                                    ["a", "b"])
     self.pushJob(jobdir_abs, job1)
示例#10
0
 def _then(ign):
     job1 = tryclient.createJobfile("buildsetID", "branch1", "123", 1,
                                    "diff", "repository", "project",
                                    ["a", "b"])
     self.pushJob(jobdir_abs, job1)