Exemple #1
0
 def setStepStateStrings(self, stepid, state_strings):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'state_strings', state_strings,
                           validation.ListValidator(validation.StringValidator()))
     self.stepStateStrings[stepid] = state_strings
     return defer.succeed(None)
Exemple #2
0
 def forget_about_it(self, name):
     validation.verifyType(self.testcase, 'scheduler name', name,
                           validation.StringValidator())
     if name not in self.schedulerIds:
         self.schedulerIds[name] = max(
             [0] + list(itervalues(self.schedulerIds))) + 1
     return defer.succeed(self.schedulerIds[name])
Exemple #3
0
 def findChangeSourceId(self, name):
     validation.verifyType(self.testcase, 'changesource name', name,
                           validation.StringValidator())
     if name not in self.changesourceIds:
         self.changesourceIds[name] = max(
             [0] + list(itervalues(self.changesourceIds))) + 1
     return defer.succeed(self.changesourceIds[name])
Exemple #4
0
 def setStepStateString(self, stepid, state_string):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'state_string', state_string,
                           validation.StringValidator())
     self.stepStateString[stepid] = state_string
     return defer.succeed(None)
Exemple #5
0
 def appendLog(self, logid, content):
     validation.verifyType(self.testcase, 'logid', logid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'content', content,
                           validation.StringValidator())
     self.testcase.assertEqual(content[-1], u'\n')
     self.logs[logid]['content'].append(content)
     return defer.succeed(None)
Exemple #6
0
 def reclaimBuildRequests(self, brids, _reactor=reactor):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     if not brids:
         defer.returnValue(True)
         return
     try:
         yield self.master.db.buildrequests.reclaimBuildRequests(
             brids=brids, _reactor=_reactor)
     except AlreadyClaimedError:
         defer.returnValue(False)
     self.claimedBuildRequests.update(set(brids))
     defer.returnValue(True)
Exemple #7
0
 def claimBuildRequests(self, brids, claimed_at=None):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'claimed_at', claimed_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     if not brids:
         return True
     try:
         yield self.master.db.buildrequests.claimBuildRequests(
             brids=brids, claimed_at=claimed_at)
     except AlreadyClaimedError:
         return False
     self.claimedBuildRequests.update(set(brids))
     return True
Exemple #8
0
 def addStepURL(self, stepid, name, url):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'url', url,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #9
0
 def addBuild(self, builderid, buildrequestid, workerid):
     validation.verifyType(self.testcase, 'builderid', builderid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'buildrequestid', buildrequestid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'workerid', workerid,
                           validation.IntValidator())
     return defer.succeed((10, 1))
Exemple #10
0
 def finishStep(self, stepid, results, hidden):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'hidden', hidden,
                           validation.BooleanValidator())
     return defer.succeed(None)
Exemple #11
0
 def completeBuildRequests(self, brids, results, complete_at=None, _reactor=reactor):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'complete_at', complete_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     return defer.succeed(True)
Exemple #12
0
 def completeBuildRequests(self, brids, results, complete_at=None, _reactor=reactor):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'complete_at', complete_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     return defer.succeed(True)
Exemple #13
0
 def addBuild(self, builderid, buildrequestid, workerid):
     validation.verifyType(self.testcase, 'builderid', builderid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'buildrequestid', buildrequestid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'workerid', workerid,
                           validation.IntValidator())
     return defer.succeed((10, 1))
Exemple #14
0
 def addStepURL(self, stepid, name, url):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'url', url,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #15
0
 def finishStep(self, stepid, results, hidden):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'hidden', hidden,
                           validation.BooleanValidator())
     return defer.succeed(None)
Exemple #16
0
 def addStepURL(self, stepid, name, url):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'url', url,
                           validation.StringValidator())
     self.stepUrls.setdefault(stepid, []).append((name, url))
     return defer.succeed(None)
Exemple #17
0
 def addStepURL(self, stepid, name, url):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'url', url,
                           validation.StringValidator())
     self.stepUrls.setdefault(stepid, []).append((name, url))
     return defer.succeed(None)
Exemple #18
0
    def completeTestResultSet(self, test_result_setid, tests_passed=None, tests_failed=None):
        validation.verifyType(self.testcase, 'test_result_setid', test_result_setid,
                              validation.IntValidator())
        validation.verifyType(self.testcase, 'tests_passed', tests_passed,
                              validation.NoneOk(validation.IntValidator()))
        validation.verifyType(self.testcase, 'tests_failed', tests_failed,
                              validation.NoneOk(validation.IntValidator()))

        yield self.master.db.test_result_sets.completeTestResultSet(test_result_setid,
                                                                    tests_passed, tests_failed)
Exemple #19
0
 def newLog(self, stepid, name, type):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'type', type,
                           validation.IdentifierValidator(1))
     logid = max([0] + self.logs.keys()) + 1
     self.logs[logid] = dict(name=name, type=type, content=[], finished=False)
     return defer.succeed(logid)
Exemple #20
0
 def newLog(self, stepid, name, type):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     validation.verifyType(self.testcase, 'type', type,
                           validation.IdentifierValidator(1))
     logid = max([0] + self.logs.keys()) + 1
     self.logs[logid] = dict(name=name, type=type, content=[], finished=False)
     return defer.succeed(logid)
Exemple #21
0
 def setBuildProperty(self, buildid, name, value, source):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     try:
         json.dumps(value)
     except (TypeError, ValueError):
         self.testcase.fail("Value for %s is not JSON-able" % name)
     validation.verifyType(self.testcase, 'source', source,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #22
0
 def setBuildProperty(self, buildid, name, value, source):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.StringValidator())
     try:
         json.dumps(value)
     except (TypeError, ValueError):
         self.testcase.fail("Value for %s is not JSON-able" % name)
     validation.verifyType(self.testcase, 'source', source,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #23
0
 def addURL(self, stepid, name, url, _racehook=None):
     validation.verifyType(self.t, 'stepid', stepid,
                           validation.IntValidator())
     validation.verifyType(self.t, 'name', name,
                           validation.IdentifierValidator(50))
     validation.verifyType(self.t, 'url', url, validation.StringValidator())
     b = self.steps.get(stepid)
     if b:
         urls = json.loads(b['urls_json'])
         url_item = dict(name=name, url=url)
         if url_item not in urls:
             urls.append(url_item)
         b['urls_json'] = json.dumps(urls)
     return defer.succeed(None)
Exemple #24
0
 def unclaimExpiredRequests(self, old, _reactor=reactor):
     validation.verifyType(
         self.testcase, "old", old, validation.IntValidator())
     return defer.succeed(None)
Exemple #25
0
 def findSchedulerId(self, name):
     validation.verifyType(self.testcase, 'scheduler name', name,
                           validation.StringValidator())
     if name not in self.schedulerIds:
         self.schedulerIds[name] = max([0] + self.schedulerIds.values()) + 1
     return defer.succeed(self.schedulerIds[name])
Exemple #26
0
 def unclaimBuildRequests(self, brids):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     self.claimedBuildRequests.difference_update(set(brids))
     if brids:
         yield self.master.db.buildrequests.unclaimBuildRequests(brids)
Exemple #27
0
 def findChangeSourceId(self, name):
     validation.verifyType(self.testcase, 'changesource name', name,
                           validation.StringValidator())
     if name not in self.changesourceIds:
         self.changesourceIds[name] = max([0] + self.changesourceIds.values()) + 1
     return defer.succeed(self.changesourceIds[name])
Exemple #28
0
 def findBuildslaveId(self, name):
     validation.verifyType(self.testcase, 'buildslave name', name,
                           validation.IdentifierValidator(50))
     # this needs to actually get inserted into the db (fake or real) since
     # getBuildslave will get called later
     return self.master.db.buildslaves.findBuildslaveId(name)
Exemple #29
0
 def finishBuild(self, buildid, results):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #30
0
 def setBuildStateString(self, buildid, state_string):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'state_string', state_string,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #31
0
 def setBuildStateString(self, buildid, state_string):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'state_string', state_string,
                           validation.StringValidator())
     return defer.succeed(None)
Exemple #32
0
 def addStep(self, buildid, name):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.IdentifierValidator(50))
     return defer.succeed((10, 1, name))
Exemple #33
0
    def addTestResultSet(self, builderid, buildid, stepid, description,
                         category, value_unit):
        validation.verifyType(self.testcase, 'builderid', builderid,
                              validation.IntValidator())
        validation.verifyType(self.testcase, 'buildid', buildid,
                              validation.IntValidator())
        validation.verifyType(self.testcase, 'stepid', stepid,
                              validation.IntValidator())
        validation.verifyType(self.testcase, 'description', description,
                              validation.StringValidator())
        validation.verifyType(self.testcase, 'category', category,
                              validation.StringValidator())
        validation.verifyType(self.testcase, 'value_unit', value_unit,
                              validation.StringValidator())

        test_result_setid = \
            yield self.master.db.test_result_sets.addTestResultSet(builderid, buildid, stepid,
                                                                   description, category,
                                                                   value_unit)
        return test_result_setid
Exemple #34
0
 def unclaimExpiredRequests(self, old, _reactor=reactor):
     validation.verifyType(
         self.testcase, "old", old, validation.IntValidator())
     return defer.succeed(None)
Exemple #35
0
 def finishLog(self, logid):
     validation.verifyType(self.testcase, 'logid', logid,
                           validation.IntValidator())
     self.logs[logid]['finished'] = True
     return defer.succeed(None)
Exemple #36
0
 def findBuilderId(self, name):
     validation.verifyType(self.testcase, 'builder name', name,
                           validation.StringValidator())
     return self.master.db.builders.findBuilderId(name)
Exemple #37
0
 def findBuilderId(self, name):
     validation.verifyType(self.testcase, 'builder name', name,
                           validation.StringValidator())
     return self.master.db.builders.findBuilderId(name)
Exemple #38
0
 def unclaimBuildRequests(self, brids):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     self.claimedBuildRequests.difference_update(set(brids))
     if brids:
         yield self.master.db.buildrequests.unclaimBuildRequests(brids)
Exemple #39
0
 def generateNewBuildEvent(self, buildid):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #40
0
 def findBuildslaveId(self, name):
     validation.verifyType(self.testcase, 'buildslave name', name,
                           validation.IdentifierValidator(50))
     # this needs to actually get inserted into the db (fake or real) since
     # getBuildslave will get called later
     return self.master.db.buildslaves.findBuildslaveId(name)
Exemple #41
0
 def finishBuild(self, buildid, results):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #42
0
 def generateNewBuildEvent(self, buildid):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #43
0
 def addStep(self, buildid, name):
     validation.verifyType(self.testcase, 'buildid', buildid,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name,
                           validation.IdentifierValidator(50))
     return defer.succeed((10, 1, name))
Exemple #44
0
 def startStep(self, stepid):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #45
0
 def startStep(self, stepid):
     validation.verifyType(self.testcase, 'stepid', stepid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #46
0
 def finishLog(self, logid):
     validation.verifyType(self.testcase, 'logid', logid,
                           validation.IntValidator())
     self.logs[logid]['finished'] = True
     return defer.succeed(None)
Exemple #47
0
 def compressLog(self, logid):
     validation.verifyType(self.testcase, 'logid', logid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #48
0
 def findWorkerId(self, name):
     validation.verifyType(self.testcase, 'worker name', name,
                           validation.IdentifierValidator(50))
     # this needs to actually get inserted into the db (fake or real) since
     # getWorker will get called later
     return self.master.db.workers.findWorkerId(name)
Exemple #49
0
 def compressLog(self, logid):
     validation.verifyType(self.testcase, 'logid', logid,
                           validation.IntValidator())
     return defer.succeed(None)
Exemple #50
0
 def findBuilderId(self, name):
     validation.verifyType(self.testcase, 'builder name', name,
                           validation.StringValidator())
     if name not in self.builderIds:
         self.builderIds[name] = max([0] + self.builderIds.values()) + 1
     return defer.succeed(self.builderIds[name])
Exemple #51
0
 def findWorkerId(self, name):
     validation.verifyType(self.testcase, 'worker name', name,
                           validation.IdentifierValidator(50))
     # this needs to actually get inserted into the db (fake or real) since
     # getWorker will get called later
     return self.master.db.workers.findWorkerId(name)
Exemple #52
0
 def setBuildData(self, buildid, name, value, source):
     validation.verifyType(self.testcase, 'buildid', buildid, validation.IntValidator())
     validation.verifyType(self.testcase, 'name', name, validation.StringValidator())
     validation.verifyType(self.testcase, 'value', value, validation.BinaryValidator())
     validation.verifyType(self.testcase, 'source', source, validation.StringValidator())
     yield self.master.db.build_data.setBuildData(buildid, name, value, source)