Ejemplo n.º 1
0
                    lines[lineIndex] = util.queuePrefix + ",".join(builds) + "\n"
                    util.writeStatus(lines)
                    return True

    return False


if __name__ == "__main__":
    os.chdir(sys.path[0])
    util.dlog("Start to run test")

    lockRunName = "lock-run"
    if util.hasLock(lockRunName):
        util.dlog("It's already running")
        quit()

    util.lock(lockRunName)

    hasUpdate = False
    while util.atomOp(getAvailable):
        hasUpdate = True
        if testMethod == "webmark":
            downloadBinary()
        runTest()
        util.atomOp(updateStatus)

    if not hasUpdate:
        util.dlog("Has no test to run")

    util.unlock(lockRunName)
Ejemplo n.º 2
0
                buildNumber = build[0]
                if buildNumber <= maxBuildNumber:
                    break
                
                buildDate = time.strptime(build[1], '%d-%b-%Y %H:%M')
                if buildDate <= startDate:
                    break
                
                if not newQueue:
                    newQueue = str(buildNumber)   
                else:
                    newQueue = newQueue + "," + str(buildNumber)
            
            # Update the queue
            if not newQueue:
                continue
            hasUpdate = True
            if not queue:
                line = "queue=" + newQueue
            else:
                line = "queue=" + newQueue + "," + queue
            lines[lineIndex] = line + '\n'
            util.dlog('Has an update: category=' + category + ' ' + line)
    
            
if __name__ == '__main__':  
    os.chdir(sys.path[0])
    util.dlog('Start to check update')
    checkUpdate()
    util.atomOp(updateStatus)