Exemplo n.º 1
0
def updateJob(jobID, branch, buildername, revision, delta=30):
    revList, buildList = titanic.runAnalysis(
        branch, buildername, revision, delta)

    buildRevs = ','.join(buildList)
    revs = ','.join(revList)

    data = {'id': jobID, 'buildrevs': buildRevs, 'analyzerevs': revs}
    headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
    r = requests.post(server + 'update', data=json.dumps(data), headers=headers)
    print r.status_code
    return r.status_code
Exemplo n.º 2
0
def updateJob(job, delta=30):
    revList, buildList = titanic.runAnalysis(
        job['branch'], job['buildername'], job['revision'], delta)
    revCount = len(revList)
    buildCount = len(buildList)
    retVal = 'updated'
    if(buildCount > 5 or revCount > 10 ):
        retVal = 'bounds-error'

    buildRevs = ','.join(buildList)
    revs = ','.join(revList)

    data = {'id': job['id'], 'buildrevs': buildRevs, 'analyzerevs': revs}
    headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
    r = requests.post(server + 'update', data=json.dumps(data), headers=headers)

    if r.status_code in [requests.codes.ok, requests.codes.accepted]:
        job['buildrevs'] = buildRevs
        job['analyzerevs'] = revs

    return job,retVal
Exemplo n.º 3
0
import titanic
import sys

buildername = 'Windows 7 32-bit mozilla-central debug test mochitest-1'
branch = 'mozilla-central'
delta = 30
revision = 'cd2acc7ab2f8'

revList, buildList = titanic.runAnalysis(
    branch, buildername, revision, delta)

for rev in buildList:
    if not (titanic.isBuildPending(branch, buildername, rev) \
            or titanic.isBuildRunning(branch, buildername, rev)):
        titanic.triggerBuild(branch, buildername, rev)
    else:
        if not titanic.isBuildSuccessful(branch, buildername, revision):
            print 'Builds are yet to be completed for revision ' + rev + ' ...'
            print 'If the builds have been running for a very long time make sure the builds have not failed!'

if buildList != []:
    sys.exit(1)

print 'All builds are completed. Starting Jobs...'

for rev in revList:
    if not (titanic.isJobPending(branch, buildername, rev) \
            or titanic.isJobRunning(branch, buildername, rev)):
        titanic.triggerJob(branch, buildername, rev)
    else:
        print 'Job has already been triggered'