diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index c919739a96a..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,31 +0,0 @@ -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - if runtime.platformType == 'win32' - - # 'pass' generally means 'this won't be called' - ^ *pass *$ - -include = - master/* - slave/* - -omit = - # omit all of our tests - */test/* - # templates cause coverage errors - */templates/* diff --git a/.coveragerc b/.coveragerc new file mode 120000 index 00000000000..f79ebea890c --- /dev/null +++ b/.coveragerc @@ -0,0 +1 @@ +common/coveragerc \ No newline at end of file diff --git a/common/coveragerc b/common/coveragerc new file mode 100644 index 00000000000..c919739a96a --- /dev/null +++ b/common/coveragerc @@ -0,0 +1,31 @@ +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: + if runtime.platformType == 'win32' + + # 'pass' generally means 'this won't be called' + ^ *pass *$ + +include = + master/* + slave/* + +omit = + # omit all of our tests + */test/* + # templates cause coverage errors + */templates/* diff --git a/master/buildbot/process/process_twisted.py b/master/buildbot/process/process_twisted.py deleted file mode 100644 index 7b72bab76d3..00000000000 --- a/master/buildbot/process/process_twisted.py +++ /dev/null @@ -1,133 +0,0 @@ -# This file is part of Buildbot. Buildbot is free software: you can -# redistribute it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation, version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright Buildbot Team Members - - -# Build classes specific to the Twisted codebase - -from buildbot.process.base import Build -from buildbot.process.factory import BuildFactory -from buildbot.steps import shell -from buildbot.steps.python_twisted import HLint, ProcessDocs, BuildDebs, \ - Trial, RemovePYCs - -class TwistedBuild(Build): - workdir = "Twisted" # twisted's bin/trial expects to live in here - def isFileImportant(self, filename): - if filename.startswith("doc/fun/"): - return 0 - if filename.startswith("sandbox/"): - return 0 - return 1 - -class TwistedTrial(Trial): - tests = "twisted" - # the Trial in Twisted >=2.1.0 has --recurse on by default, and -to - # turned into --reporter=bwverbose . - recurse = False - trialMode = ["--reporter=bwverbose"] - testpath = None - trial = "./bin/trial" - -class TwistedBaseFactory(BuildFactory): - buildClass = TwistedBuild - # bin/trial expects its parent directory to be named "Twisted": it uses - # this to add the local tree to PYTHONPATH during tests - workdir = "Twisted" - - def __init__(self, source): - BuildFactory.__init__(self, [source]) - -class QuickTwistedBuildFactory(TwistedBaseFactory): - treeStableTimer = 30 - useProgress = 0 - - def __init__(self, source, python="python"): - TwistedBaseFactory.__init__(self, source) - if type(python) is str: - python = [python] - self.addStep(HLint, python=python[0]) - self.addStep(RemovePYCs) - for p in python: - cmd = [p, "setup.py", "build_ext", "-i"] - self.addStep(shell.Compile, command=cmd, flunkOnFailure=True) - self.addStep(TwistedTrial, python=p, testChanges=True) - -class FullTwistedBuildFactory(TwistedBaseFactory): - treeStableTimer = 5*60 - - def __init__(self, source, python="python", - processDocs=False, runTestsRandomly=False, - compileOpts=[], compileOpts2=[]): - TwistedBaseFactory.__init__(self, source) - if processDocs: - self.addStep(ProcessDocs) - - if type(python) == str: - python = [python] - assert isinstance(compileOpts, list) - assert isinstance(compileOpts2, list) - cmd = (python + compileOpts + ["setup.py", "build_ext"] - + compileOpts2 + ["-i"]) - - self.addStep(shell.Compile, command=cmd, flunkOnFailure=True) - self.addStep(RemovePYCs) - self.addStep(TwistedTrial, python=python, randomly=runTestsRandomly) - -class TwistedDebsBuildFactory(TwistedBaseFactory): - treeStableTimer = 10*60 - - def __init__(self, source, python="python"): - TwistedBaseFactory.__init__(self, source) - self.addStep(ProcessDocs, haltOnFailure=True) - self.addStep(BuildDebs, warnOnWarnings=True) - -class TwistedReactorsBuildFactory(TwistedBaseFactory): - treeStableTimer = 5*60 - - def __init__(self, source, - python="python", compileOpts=[], compileOpts2=[], - reactors=None): - TwistedBaseFactory.__init__(self, source) - - if type(python) == str: - python = [python] - assert isinstance(compileOpts, list) - assert isinstance(compileOpts2, list) - cmd = (python + compileOpts + ["setup.py", "build_ext"] - + compileOpts2 + ["-i"]) - - self.addStep(shell.Compile, command=cmd, warnOnFailure=True) - - if reactors == None: - reactors = [ - 'gtk2', - 'gtk', - #'kqueue', - 'poll', - 'c', - 'qt', - #'win32', - ] - for reactor in reactors: - flunkOnFailure = 1 - warnOnFailure = 0 - #if reactor in ['c', 'qt', 'win32']: - # # these are buggy, so tolerate failures for now - # flunkOnFailure = 0 - # warnOnFailure = 1 - self.addStep(RemovePYCs) # TODO: why? - self.addStep(TwistedTrial, name=reactor, python=python, - reactor=reactor, flunkOnFailure=flunkOnFailure, - warnOnFailure=warnOnFailure) diff --git a/master/buildbot/test/test_extra_coverage.py b/master/buildbot/test/test_extra_coverage.py new file mode 100644 index 00000000000..f4477183e43 --- /dev/null +++ b/master/buildbot/test/test_extra_coverage.py @@ -0,0 +1,65 @@ +# This file is part of Buildbot. Buildbot is free software: you can +# redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, version 2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright Buildbot Team Members + +# this file imports a number of source files that are not +# included in the coverage because none of the tests import +# them; this results in a more accurate total coverage percent. + +modules = [] # for the benefit of pyflakes + +from buildbot import buildslave +modules.extend([buildslave]) +from buildbot.changes import p4poller, svnpoller +modules.extend([p4poller, svnpoller]) +from buildbot.clients import base, sendchange, tryclient +modules.extend([base, sendchange, tryclient]) +from buildbot.process import mtrlogobserver, subunitlogobserver +modules.extend([mtrlogobserver, subunitlogobserver]) +from buildbot.scripts import checkconfig, logwatcher, reconfig, runner, startup +modules.extend([checkconfig, logwatcher, reconfig, runner, startup]) +from buildbot.status import client, html, status_gerrit, status_push +modules.extend([client, html, status_gerrit, status_push]) +from buildbot.status import tinderbox, words +modules.extend([tinderbox, words]) +from buildbot.status.web import baseweb, build, builder, buildstatus, changes +modules.extend([baseweb, build, builder, buildstatus, changes]) +from buildbot.status.web import console, feeds, grid, logs, olpb, root, slaves +modules.extend([console, feeds, grid, logs, olpb, root, slaves]) +from buildbot.status.web import status_json, step, tests, waterfall +modules.extend([status_json, step, tests, waterfall]) +from buildbot.steps import dummy, master, maxq, python, python_twisted, subunit +modules.extend([dummy, master, maxq, python, python_twisted, subunit]) +from buildbot.steps import trigger, vstudio +modules.extend([trigger, vstudio]) +from buildbot.steps.package.rpm import rpmbuild, rpmlint, rpmspec +modules.extend([rpmbuild, rpmlint, rpmspec]) +from buildbot.util import collections, eventual, loop, monkeypatches +modules.extend([collections, eventual, loop, monkeypatches]) + +# require gobject +#import buildbot.clients.gtkPanes +#import buildbot.clients.debug + +# requires mercurial +#import buildbot.changes.hgbuildbot + +# requires libboto +#import buildbot.ec2buildslave + +# requires libvirt +#import buildbot.libvirtbuildslave + +# requires pycrypto +#import buildbot.manhole diff --git a/slave/buildslave/test/test_extra_coverage.py b/slave/buildslave/test/test_extra_coverage.py new file mode 100644 index 00000000000..c803988d2b1 --- /dev/null +++ b/slave/buildslave/test/test_extra_coverage.py @@ -0,0 +1,23 @@ +# This file is part of Buildbot. Buildbot is free software: you can +# redistribute it and/or modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation, version 2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright Buildbot Team Members + +# this file imports a number of source files that are not +# included in the coverage because none of the tests import +# them; this results in a more accurate total coverage percent. + +modules = [] # for the benefit of pyflakes + +from buildslave.scripts import logwatcher, runner, startup +modules.extend([logwatcher, runner, startup])