Skip to content

Commit

Permalink
- Changed USERCANCEL to CANCELLED.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewongbb committed Nov 6, 2012
1 parent 7901094 commit 4fe54f8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
8 changes: 4 additions & 4 deletions master/buildbot/process/build.py
Expand Up @@ -23,7 +23,7 @@

from buildbot import interfaces, locks
from buildbot.status.results import SUCCESS, WARNINGS, FAILURE, EXCEPTION, \
RETRY, SKIPPED, USERCANCEL, worst_status
RETRY, SKIPPED, CANCELLED, worst_status
from buildbot.status.builder import Results
from buildbot.status.progress import BuildProgress
from buildbot.process import metrics, properties
Expand Down Expand Up @@ -437,7 +437,7 @@ def stepDone(self, result, step):
possible_overall_result = WARNINGS
if step.flunkOnWarnings:
possible_overall_result = FAILURE
elif result in (EXCEPTION, RETRY):
elif result in (EXCEPTION, RETRY, CANCELLED):
terminate = True

# if we skipped this step, then don't adjust the build status
Expand Down Expand Up @@ -482,7 +482,7 @@ def stopBuild(self, reason="<no reason given>"):
if self.currentStep:
self.currentStep.interrupt(reason)

self.result = USERCANCEL
self.result = CANCELLED

if self._acquiringLock:
lock, access, d = self._acquiringLock
Expand All @@ -498,7 +498,7 @@ def allStepsDone(self):
text = ["exception"]
elif self.result == RETRY:
text = ["retry"]
elif self.result == USERCANCEL:
elif self.result == CANCELLED:
text = ["usercancel"]
else:
text = ["build", "successful"]
Expand Down
11 changes: 6 additions & 5 deletions master/buildbot/status/mail.py
Expand Up @@ -49,7 +49,7 @@
from buildbot import interfaces, util, config
from buildbot.process.users import users
from buildbot.status import base
from buildbot.status.results import FAILURE, SUCCESS, WARNINGS, EXCEPTION, USERCANCEL, Results
from buildbot.status.results import FAILURE, SUCCESS, WARNINGS, EXCEPTION, CANCELLED, Results

VALID_EMAIL = re.compile("[a-zA-Z0-9\.\_\%\-\+]+@[a-zA-Z0-9\.\_\%\-]+.[a-zA-Z]{2,6}")

Expand Down Expand Up @@ -94,7 +94,7 @@ def defaultMessage(mode, name, build, results, master_status):
text += "The Buildbot has detected a passing build"
elif results == EXCEPTION:
text += "The Buildbot has detected a build exception"
elif results == USERCANCEL:
elif results == CANCELLED:
text += "The Build was cancelled by the user"

projects = []
Expand Down Expand Up @@ -146,7 +146,7 @@ def defaultMessage(mode, name, build, results, master_status):
text += "Build succeeded!\n"
elif results == WARNINGS:
text += "Build Had Warnings%s\n" % t
elif results == USERCANCEL:
elif results == CANCELLED:
text += "Build was cancelled by %s\n" % build.getResponsibleUsers()
else:
text += "BUILD FAILED%s\n" % t
Expand Down Expand Up @@ -186,7 +186,7 @@ class MailNotifier(base.StatusReceiverMultiService):
"subject", "sendToInterestedUsers", "customMesg",
"messageFormatter", "extraHeaders"]

possible_modes = ("change", "failing", "passing", "problem", "warnings", "exception")
possible_modes = ("change", "failing", "passing", "problem", "warnings", "exception", "cancelled")

def __init__(self, fromaddr, mode=("failing", "passing", "warnings"),
categories=None, builders=None, addLogs=False,
Expand Down Expand Up @@ -231,6 +231,7 @@ def __init__(self, fromaddr, mode=("failing", "passing", "warnings"),
when the previous build passed
- "warnings": send mail if a build contain warnings
- "exception": send mail if a build fails due to an exception
- "cancelled": send mail if a build is cancelled
- "all": always send mail
Defaults to ("failing", "passing", "warnings").
Expand Down Expand Up @@ -455,7 +456,7 @@ def isMailNeeded(self, build, results):
return True
if "exception" in self.mode and results == EXCEPTION:
return True
if "usercancel" in self.mode and results == USERCANCEL:
if "usercancel" in self.mode and results == CANCELLED:
return True

return False
Expand Down
8 changes: 4 additions & 4 deletions master/buildbot/status/results.py
Expand Up @@ -13,12 +13,12 @@
#
# Copyright Buildbot Team Members

SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION, RETRY, USERCANCEL = range(7)
SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION, RETRY, CANCELLED = range(7)
Results = ["success", "warnings", "failure", "skipped", "exception", "retry", "usercancel"]

def worst_status(a, b):
# SUCCESS > WARNINGS > FAILURE > EXCEPTION > RETRY > USERCANCEL
# USERCANCEL needs to be considered the worst.
for s in (USERCANCEL, RETRY, EXCEPTION, FAILURE, WARNINGS, SKIPPED, SUCCESS):
# SUCCESS > WARNINGS > FAILURE > EXCEPTION > RETRY > CANCELLED
# CANCELLED needs to be considered the worst.
for s in (CANCELLED, RETRY, EXCEPTION, FAILURE, WARNINGS, SKIPPED, SUCCESS):
if s in (a, b):
return s
4 changes: 2 additions & 2 deletions master/buildbot/status/tinderbox.py
Expand Up @@ -22,7 +22,7 @@

from buildbot import interfaces
from buildbot.status import mail
from buildbot.status.results import SUCCESS, WARNINGS, EXCEPTION, RETRY, USERCANCEL
from buildbot.status.results import SUCCESS, WARNINGS, EXCEPTION, RETRY, CANCELLED
from buildbot.steps.shell import WithProperties

import gzip, bz2, base64, re, cStringIO
Expand Down Expand Up @@ -184,7 +184,7 @@ def buildMessage(self, name, build, results):
elif results in (EXCEPTION, RETRY):
res = "exception"
text += res
elif results == USERCANCEL:
elif results == CANCELLED:
res = "usercancel"
text += res
else:
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/status/words.py
Expand Up @@ -28,7 +28,7 @@
from buildbot.interfaces import IStatusReceiver
from buildbot.sourcestamp import SourceStamp
from buildbot.status import base
from buildbot.status.results import SUCCESS, WARNINGS, FAILURE, EXCEPTION, RETRY, USERCANCEL
from buildbot.status.results import SUCCESS, WARNINGS, FAILURE, EXCEPTION, RETRY, CANCELLED
from buildbot.process.properties import Properties

# twisted.internet.ssl requires PyOpenSSL, so be resilient if it's missing
Expand Down Expand Up @@ -404,7 +404,7 @@ def buildStarted(self, builderName, build):
FAILURE: ("Failure", 'RED'),
EXCEPTION: ("Exception", 'PURPLE'),
RETRY: ("Retry", 'AQUA_LIGHT'),
USERCANCEL: ("UserCancel", 'PINK'),
CANCELLED: ("UserCancel", 'PINK'),
}

def getResultsDescriptionAndColor(self, results):
Expand Down
8 changes: 4 additions & 4 deletions master/buildbot/test/unit/test_process_build.py
Expand Up @@ -19,7 +19,7 @@
from buildbot import interfaces
from buildbot.process.build import Build
from buildbot.process.properties import Properties
from buildbot.status.results import FAILURE, SUCCESS, WARNINGS, RETRY, EXCEPTION
from buildbot.status.results import FAILURE, SUCCESS, WARNINGS, RETRY, EXCEPTION, CANCELLED
from buildbot.locks import SlaveLock
from buildbot.process.buildstep import LoggingBuildStep

Expand Down Expand Up @@ -142,7 +142,7 @@ def startStep(*args, **kw):

b.startBuild(FakeBuildStatus(), None, slavebuilder)

self.assertEqual(b.result, EXCEPTION)
self.assertEqual(b.result, CANCELLED)

self.assert_( ('interrupt', ('stop it',), {}) in step.method_calls)

Expand Down Expand Up @@ -183,7 +183,7 @@ def startStep2(*args, **kw):

d = b.startBuild(FakeBuildStatus(), None, slavebuilder)
def check(ign):
self.assertEqual(b.result, EXCEPTION)
self.assertEqual(b.result, CANCELLED)
self.assert_( ('interrupt', ('stop it',), {}) in step1.method_calls)
self.assert_(step2Started[0])
d.addCallback(check)
Expand Down Expand Up @@ -332,7 +332,7 @@ def acquireLocks(res=None):
self.assert_( ('startStep', (slavebuilder.remote,), {})
not in step.method_calls)
self.assert_(b.currentStep is None)
self.assertEqual(b.result, EXCEPTION)
self.assertEqual(b.result, CANCELLED)
self.assert_( ('interrupt', ('stop it',), {}) not in step.method_calls)

def testStopBuildWaitingForLocks_lostRemote(self):
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/test/unit/test_status_mail.py
Expand Up @@ -17,7 +17,7 @@
from mock import Mock
from buildbot import config
from twisted.trial import unittest
from buildbot.status.results import SUCCESS, FAILURE, WARNINGS, EXCEPTION
from buildbot.status.results import SUCCESS, FAILURE, WARNINGS, EXCEPTION, USERCANCEL
from buildbot.status.mail import MailNotifier
from twisted.internet import defer
from buildbot.test.fake import fakedb
Expand Down
2 changes: 1 addition & 1 deletion master/docs/developer/results.rst
Expand Up @@ -38,7 +38,7 @@ external tools, so the values are fixed.
Value: 4; color: purple; a run that should be retried, usually due to a
slave disconnection.

.. py:data:: USERCANCEL
.. py:data:: CANCELLED
Value: 5; color: pink; a run that was cancelled by the user.

Expand Down

0 comments on commit 4fe54f8

Please sign in to comment.