Example #1
0
 def evaluateCommand(self, cmd):
     """return command state"""
     result = ShellCommand.evaluateCommand(self, cmd)
     if not self.logObserver.success:
         return FAILURE
     else:
         return result
Example #2
0
    def evaluateCommand(self, cmd):
        """Detect errors while uploading

        If the setup.py script fails to upload a file to a Pypi server, it
        returns '0' as error code, but the output at least says if the upload
        has success or not.
        """

        result = ShellCommand.evaluateCommand(self, cmd)

        if result != SUCCESS:
            # It fails for some reason, we don't want to know more about it,
            # return this result
            return result

        output = cmd.logs['stdio'].getText()

        # Get the 'upload' output...
        upload_output = output.split('running upload')[-1]

        # ...and parse it to see if the upload has success or not
        if "server response (200)" in upload_output.lower():
            return SUCCESS
        else:
            return FAILURE
Example #3
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     if SUCCESS != superResult:
         return FAILURE
     if None != re.search('ERROR', cmd.logs['stdio'].getText()):
         return FAILURE
     return SUCCESS
Example #4
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     if self.leakStats['new']['leaks'] and int(
             self.leakStats['new']['leaks']) > int(
                 self.leakFailureThreshold):
         return WARNINGS
     return superResult
    def evaluateCommand(self, cmd):
        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        self.setProperty('develops',
                         " ".join(self.getLog('stdio').readlines()))

        return SUCCESS
    def evaluateCommand(self, cmd):
        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        if self.expected_package_version != self.current_version:
            return FAILURE
        else:
            return SUCCESS
Example #7
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     for line in cmd.logs['stdio'].readlines(channel=HEADER):
         if "command timed out" in line:
             self.addCompleteLog(
                 'timeout', 'buildbot.slave.commands.TimeoutError: ' +
                 line + "TinderboxPrint: " + self.name +
                 ' <em class="testfail">timeout</em><br/>\n')
             return WARNINGS
     return superResult
Example #8
0
 def evaluateCommand(self, cmd):
     """return command state"""
     result = ShellCommand.evaluateCommand(self, cmd)
     if result != SUCCESS:
         return result
     if self.errorCount or self.failedTestsCount > self.maxFailedTestCount:
         return FAILURE
     if self.warnCount or self.failedTestsCount:
         return WARNINGS
     return SUCCESS
Example #9
0
 def evaluateCommand(self, cmd):
     """return command state"""
     result = ShellCommand.evaluateCommand(self, cmd)
     if result != SUCCESS:
         return result
     elif self.myLogger.allFirstParentOfMaster:
         return SUCCESS
     elif self.myLogger.allInMaster:
         return WARNINGS # TODO should this succeed?
     else: # TODO - error messages?  I collected info in the logger...
         return WARNINGS
 def evaluateCommand(self, cmd):
     r = ShellCommand.evaluateCommand(self, cmd)
     if r != SUCCESS:
         return r
     if self.all_tests_passed == True:
         if len(self.testsFailed) > 0:
             return FAILURE
         else:
             return SUCCESS
     else:
         return FAILURE
Example #11
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     for line in cmd.logs['stdio'].readlines(channel=HEADER):
         if "command timed out" in line:
             self.addCompleteLog('timeout',
                                 'buildbot.slave.commands.TimeoutError: ' +
                                 line +
                                 "TinderboxPrint: " +
                                 self.name + ' <em class="testfail">timeout</em><br/>\n')
             return WARNINGS
     return superResult
Example #12
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     stdioText = cmd.logs['stdio'].getText()
     if SUCCESS != superResult:
         return FAILURE
     if None != re.search('ERROR', stdioText):
         return FAILURE
     if None != re.search('USAGE:', stdioText):
         return FAILURE
     if None != re.search('FAIL:', stdioText):
         return WARNINGS
     return SUCCESS
Example #13
0
 def evaluateCommand(self, cmd):
     """
     Called when command final status is required.
     """
     # twistedchecker will exit with non-zero on errors, but Twisted
     # code is not yet clean so there will always be errors.
     if self.worse:
         return WARNINGS
     if self.currentErrors:
         return SUCCESS
     else:
         # If no errors were reported then fallback to command status
         # code as the whole command might have fail to run.
         return ShellCommand.evaluateCommand(self, cmd)
Example #14
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     if SUCCESS != superResult:
         return FAILURE
     stdioText = cmd.logs['stdio'].getText()
     if None != re.search('ERROR', stdioText):
         return FAILURE
     if None != re.search('USAGE:', stdioText):
         return FAILURE
     configFileMatch = re.search('outputName\s*=\s*(\w*?.yml)', stdioText)
     if not configFileMatch:
         return FAILURE
     else:
         self.setProperty("configFile", configFileMatch.group(1))
     return SUCCESS
Example #15
0
    def evaluateCommand(self, cmd):

        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        regex_pkg_name = re.compile(r"^\s*-\s*Package name\s*:\s*(.+)$")

        for line in self.getLog("stdio").readlines():
            m = regex_pkg_name.match(line)
            if m is not None:
                path = os.path.join("pkg", m.group(1))
                self.setProperty("package-path", path)
                return SUCCESS
        else:
            return FAILURE
Example #16
0
    def evaluateCommand(self, cmd):
        """Evaluate if the doc builder has generated an error or not."""

        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        output = cmd.logs['stdio'].getText()

        for regex in self.regexes_error:
            if filter_sphinx_errors(regex.findall(output)):
                return FAILURE

        if filter_sphinx_warnings(self.regex_warning.findall(output)):
            return WARNINGS
        else:
            return SUCCESS
    def evaluateCommand(self, cmd):
        """Evaluate if buildout has generated an error or not.

        buildout returns 0 even if an error has occured (for example if a
        dependency can't be installed). So, we need to parse the stdout, in
        order to look for error messages.
        """

        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        output = cmd.logs['stdio'].getText()
        if self.regex_error.search(output):
            return FAILURE
        else:
            return SUCCESS
    def evaluateCommand(self, cmd):
        result = ShellCommand.evaluateCommand(self, cmd)
        if result != SUCCESS:
            return result

        r = re.compile('.*-r(?P<rev>[0-9]+).*') # Need to get the revision number
        rev_pkg = lambda pkg: int(r.match(pkg).group('rev'))

        packages = sorted(self.getLog('stdio').readlines(),
                          cmp=lambda x, y: cmp(rev_pkg(x),
                                               rev_pkg(y))
                         )

        try:
            latest = packages[-1]
        except IndexError:
            return FAILURE

        url = os.path.join(self.url, latest).strip()
        self.descriptionDone = [latest]
        self.setProperty('package-uri', url)
        self.addCompleteLog('url', url)
        return SUCCESS
Example #19
0
 def evaluateCommand(self, cmd):
     if self.worse:
         return WARNINGS
     return ShellCommand.evaluateCommand(self, cmd)
Example #20
0
 def evaluateCommand(self, cmd):
     result = ShellCommand.evaluateCommand(self, cmd)
     self._parse_result(cmd, result)
     return result
 def evaluateCommand(self, cmd):
     rc = ShellCommand.evaluateCommand(self, cmd)
     if self.not_uploaded:
         rc = WARNINGS
     return rc
Example #22
0
 def evaluateCommand(self, cmd):
     result = ShellCommand.evaluateCommand(self, cmd)
     self._parse_result(cmd, result)
     return result
Example #23
0
 def evaluateCommand(self, cmd):
     if self.worse:
         return WARNINGS
     return ShellCommand.evaluateCommand(self, cmd)
Example #24
0
 def evaluateCommand(self, cmd):
     result = ShellCommand.evaluateCommand(self, cmd)
     if None != re.search('File exists', cmd.logs['stdio'].getText()):
         result = SUCCESS
     return result
Example #25
0
 def evaluateCommand(self, cmd):
     rc = ShellCommand.evaluateCommand(self, cmd)
     if self.not_uploaded:
         rc = WARNINGS
     return rc
Example #26
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     if self.leakStats['new']['leaks'] and int(self.leakStats['new']['leaks']) > int(self.leakFailureThreshold):
         return WARNINGS
     return superResult
Example #27
0
 def evaluateCommand(self, cmd):
     result = ShellCommand.evaluateCommand(self, cmd)
     if None != re.search('File exists', cmd.logs['stdio'].getText()):
         result = SUCCESS
     return result
Example #28
0
 def evaluateCommand(self, cmd):
     superResult = ShellCommand.evaluateCommand(self, cmd)
     if SUCCESS != superResult:
         return FAILURE
     return SUCCESS
 def evaluateCommand(self, cmd):
     result = ShellCommand.evaluateCommand(self, cmd)
     if result != SUCCESS:
         return result
     else:
         return SUCCESS