Skip to content
Browse files

Initial import

  • Loading branch information...
0 parents commit 44564d408961bfa89ce543f40bedea4dc5ac6d9b @rail rail committed
Showing with 860 additions and 0 deletions.
  1. +13 −0 .hgignore
  2. +19 −0 db-cleanup.py
  3. +25 −0 master/Makefile
  4. +33 −0 master/buildbot.tac
  5. +124 −0 master/master.cfg
  6. +231 −0 master/preproduction_factory.py
  7. +323 −0 pylint/pylintrc
  8. +15 −0 slave/Makefile
  9. +39 −0 slave/buildbot.tac
  10. +38 −0 ve-setup.sh
13 .hgignore
@@ -0,0 +1,13 @@
+syntax: regexp
+
+^buildbot/
+^buildbot-configs/
+^buildbotcustom/
+/public_html/
+^sandbox/
+/test-masters/
+/info/
+\.pyc$
+\.log(\.\d+)?$
+state\.sqlite
+twistd\.pid
19 db-cleanup.py
@@ -0,0 +1,19 @@
+#!/builds/buildbot/preproduction/sandbox/bin/python
+
+import sys
+import sqlalchemy
+from sqlalchemy import MetaData
+
+sys.path.append('/builds/buildbot/scheduler-master')
+from passwords import BBDB_URL
+
+engine = sqlalchemy.create_engine(BBDB_URL)
+db = sqlalchemy.MetaData()
+db.reflect(bind=engine)
+db.bind = engine
+
+for t in db.sorted_tables:
+ if t.name != 'version':
+ print 'Deleting %s...' % (t.name,),
+ t.delete().execute()
+ print "Done"
25 master/Makefile
@@ -0,0 +1,25 @@
+# -*- makefile -*-
+
+export PATH=$(shell pwd)/../sandbox/bin:/bin:/usr/bin
+export PYTHONPATH=$(shell pwd)/..
+
+start:
+ buildbot start .
+
+restart:
+ buildbot restart .
+
+stop:
+ buildbot stop .
+
+reconfig:
+ buildbot reconfig
+
+check:
+ buildbot checkconfig
+
+log:
+ if [ -e twistd.log ]; \
+ then tail -F twistd.log; \
+ else echo "Nothing to tail."; \
+ fi
33 master/buildbot.tac
@@ -0,0 +1,33 @@
+
+import os
+
+from twisted.application import service
+from buildbot.master import BuildMaster
+
+basedir = r'.'
+rotateLength = 1000000
+maxRotatedFiles = None
+
+# if this is a relocatable tac file, get the directory containing the TAC
+if basedir == '.':
+ import os.path
+ basedir = os.path.abspath(os.path.dirname(__file__))
+
+application = service.Application('buildmaster')
+try:
+ from twisted.python.logfile import LogFile
+ from twisted.python.log import ILogObserver, FileLogObserver
+ logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
+ maxRotatedFiles=maxRotatedFiles)
+ application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
+except ImportError:
+ # probably not yet twisted 8.2.0 and beyond, can't set log yet
+ pass
+
+configfile = r'master.cfg'
+
+m = BuildMaster(basedir, configfile)
+m.setServiceParent(application)
+m.log_rotation.rotateLength = rotateLength
+m.log_rotation.maxRotatedFiles = maxRotatedFiles
+
124 master/master.cfg
@@ -0,0 +1,124 @@
+# -*- python -*-
+# ex: set syntax=python:
+
+import buildbotcustom.changes.hgpoller
+reload(buildbotcustom.changes.hgpoller)
+
+from buildbot.buildslave import BuildSlave
+from buildbot.status import html, mail
+from buildbot.status.web import auth, authz
+from buildbot.changes.pb import PBChangeSource
+from buildbot.scheduler import Scheduler
+from buildbot.schedulers.timed import Nightly
+from buildbotcustom.changes.hgpoller import HgPoller
+from buildbot.config import BuilderConfig
+
+import preproduction_factory
+reload(preproduction_factory)
+from preproduction_factory import PPBuildFactory
+
+config = {}
+# TODO: move vars to config.py
+# TODO: move steps to class
+# TODO: diff pre and production configs, compare with master copy
+HG_HOST = 'hg.mozilla.org'
+repos = {'build/buildbot': 'default',
+ 'build/buildbotcustom': 'default',
+ 'build/buildbot-configs': 'default',
+ 'build/tools': 'default'}
+
+c = BuildmasterConfig = {}
+c['projectName'] = "Mozilla"
+c['projectURL'] = "http://www.mozilla.org"
+c['buildbotURL'] = "http://preproduction-master.build.mozilla.org:8710/"
+c['db_url'] = "sqlite:///state.sqlite"
+c['slavePortnum'] = 9710
+c['slaves'] = [BuildSlave("myself", "passwd")]
+
+
+c['change_source'] = []
+c['mergeRequests'] = lambda b, r1, r2: False
+c['change_source'].append(PBChangeSource())
+for repo in repos.keys():
+ c['change_source'].append(HgPoller(
+ hgURL='http://%s/' % HG_HOST,
+ branch=repo,
+ tipsOnly=1,
+ pollInterval=10*60
+ ))
+####### SCHEDULERS
+
+## configure the Schedulers
+
+c['schedulers'] = []
+c['schedulers'].append(Scheduler(name="all",
+ treeStableTimer=None,
+ builderNames=["test-masters"]))
+c['schedulers'].append(Nightly(name='weekly',
+ dayOfWeek=0,
+ hour=[1],
+ builderNames=['setup-masters']))
+
+####### BUILDERS
+
+
+f = PPBuildFactory(HG_HOST)
+for repo, branch in repos.iteritems():
+ f.update_repo(repo, branch)
+
+f.setup_virtualenv()
+f.test_masters()
+f.bbc_pylint()
+f.tools_pylint()
+for project in ('buildbotcustom',):
+ f.coverage(project)
+f.run_on_master('/builds/buildbot/buildbotcustom/buildbotcustom', 'hg pull -u')
+f.run_on_master('/builds/buildbot/buildbot-configs', 'hg pull -u')
+f.run_on_master('/builds/buildbot/scheduler-master', 'make reconfig')
+f.run_on_master('/builds/buildbot/builder-master', 'make reconfig')
+f.run_on_master('/builds/buildbot/tests-master', 'make reconfig')
+
+test_masters_builder = BuilderConfig(name='test-masters',
+ slavename='myself',
+ builddir='test-masters',
+ factory=f)
+
+w = PPBuildFactory(HG_HOST)
+w.setup_virtualenv(workdir='/builds/buildbot/scheduler-master/sandbox')
+w.setup_virtualenv(workdir='/builds/buildbot/builder-master/sandbox')
+w.setup_virtualenv(workdir='/builds/buildbot/tests-master/sandbox')
+w.run_on_master('/builds/buildbot/scheduler-master', 'make stop')
+w.run_on_master('/builds/buildbot/builder-master', 'make stop')
+w.run_on_master('/builds/buildbot/tests-master', 'make stop')
+w.run_on_master('/builds/buildbot/preproduction', './db-cleanup.py')
+w.run_on_master('/builds/buildbot/scheduler-master', 'make start')
+w.run_on_master('/builds/buildbot/builder-master', 'make start')
+w.run_on_master('/builds/buildbot/tests-master', 'make start')
+
+setup_masters = {'name': 'setup-masters',
+ 'slavename': 'myself',
+ 'builddir': 'setup-masters',
+ 'factory': w,
+ }
+
+c['builders'] = [test_masters_builder, setup_masters]
+
+
+c['status'] = []
+authz_cfg=authz.Authz(
+ gracefulShutdown = True,
+ forceBuild = True,
+ forceAllBuilds = True,
+ pingBuilder = True,
+ stopBuild = True,
+ stopAllBuilds = True,
+ cancelPendingBuild = True,
+)
+c['status'].append(html.WebStatus(http_port=8710, authz=authz_cfg))
+
+c['status'].append(
+ mail.MailNotifier(fromaddr="cltbld@preproduction-master.build.mozilla.org",
+ extraRecipients=["release@mozilla.com"],
+ sendToInterestedUsers=False,
+ mode='change',
+ ))
231 master/preproduction_factory.py
@@ -0,0 +1,231 @@
+import re
+import textwrap
+from buildbot.process.factory import BuildFactory
+from buildbot.steps.shell import ShellCommand, SetProperty
+from buildbot.process.properties import WithProperties
+from buildbot.steps.python import PyLint
+from buildbot.steps.master import MasterShellCommand
+try:
+ import cStringIO
+ StringIO = cStringIO.StringIO
+except ImportError:
+ from StringIO import StringIO
+
+
+class PyLintExtended(PyLint):
+
+ def __init__(self, project='', **kwargs):
+ self.parent_class = PyLint
+ self.parent_class.__init__(self, **kwargs)
+ self.project = project
+ self.addFactoryArguments(project=project)
+
+ def createSummary(self, log):
+ self.parent_class.createSummary(self, log)
+ key = 'pylint-%s' % self.project
+ if not self.build.getProperties().has_key(key):
+ self.setProperty(key, {})
+ props = self.getProperty(key)
+ for msg, fullmsg in self.MESSAGES.items():
+ props[fullmsg] = self.getProperty('pylint-%s' % fullmsg)
+ props['total'] = self.getProperty('pylint-total')
+
+ score_re = re.compile(r'Your code has been rated at ([\d.]+)/([\d.]+) \(previous run: ([\d.]+)/([\d.]+)\)')
+ for line in StringIO(log.getText()).readlines():
+ m = score_re.match(line)
+ if m:
+ score, prevScore = m.groups()[0], m.groups()[2]
+ props['score'] = float(score)
+ props['prev-score'] = float(prevScore)
+
+ self.setProperty(key, props)
+
+
+class PPBuildFactory(BuildFactory):
+ veCommand = textwrap.dedent("""
+ unset CC
+ unset CXX
+ VE_VER=1.4.9
+ export PIP_DOWNLOAD_CACHE=$PWD/cache
+ mkdir -p $PIP_DOWNLOAD_CACHE
+ wget -O- http://pypi.python.org/packages/source/v/virtualenv/virtualenv-${VE_VER}.tar.gz \
+ | tar -xz virtualenv-${VE_VER}/virtualenv.py || exit 1
+
+ PYTHON=/tools/python/bin/python
+ $PYTHON virtualenv-${VE_VER}/virtualenv.py --distribute --no-site-packages . || exit 1
+ rm -rf virtualenv-${VE_VER}
+ PYTHON=$PWD/bin/python
+ PATH=$PWD/bin:$PATH
+ $PYTHON -c 'import json' 2>/dev/null || \
+ $PYTHON -c 'import simplejson' || \
+ ./bin/pip install simplejson || exit 1
+ $PYTHON -c 'import sqlite3, sys; assert sys.version_info >= (2,6)' 2>/dev/null \
+ || $PYTHON -c 'import pysqlite2.dbapi2' || \
+ ./bin/pip install pysqlite || exit 1;
+ ./bin/pip install Twisted || exit 1;
+ ./bin/pip install jinja2 || exit 1;
+ ./bin/pip install mock || exit 1;
+ ./bin/pip install coverage || exit 1;
+ ./bin/pip install nose || exit 1;
+ ./bin/pip install pylint || exit 1;
+ ./bin/pip install sqlalchemy || exit 1;
+ ./bin/pip install argparse || exit 1;
+ ./bin/pip install django || exit 1;
+ ./bin/pip install pycrypto || exit 1;
+ ./bin/pip install pyasn1 || exit 1;
+ ./bin/pip install mysql-python || exit 1;
+ ./bin/pip install pyopenssl==0.10 || exit 1;
+ hg clone http://hg.mozilla.org/build/buildbot
+ (cd buildbot/master; $PYTHON setup.py develop install) || exit 1;
+ (cd buildbot/slave; $PYTHON setup.py develop install) || exit 1;
+ rm -rf buildbot
+ """)
+
+ def __init__(self, hgHost, **kwargs):
+ self.parent_class = BuildFactory
+ self.parent_class.__init__(self, **kwargs)
+ #self.addFactoryArguments(hgHost=hgHost)
+ self.hgHost = hgHost
+ self.addStep(SetProperty(name='set_topdir',
+ command=['pwd'],
+ property='topdir',
+ workdir='.',
+ ))
+ self.addStep(ShellCommand(name='rm_pyc',
+ command=['bash', '-c',
+ 'find . -name "*.pyc" -exec rm -f {} ";"'],
+ workdir=".",
+ ))
+
+ def update_repo(self, repo, branch):
+ workdir = repo.split("/")[-1]
+ repourl = 'http://%s/%s' % (self.hgHost, repo)
+ self.addStep(
+ ShellCommand(name='%s_update' % workdir,
+ command=['bash', '-c',
+ 'if test -d %(workdir)s; then hg -R %(workdir)s pull; \
+ else hg clone --noupdate %(repourl)s %(workdir)s; fi && \
+ hg -R %(workdir)s up -C --rev %(branch)s' % locals()],
+ timeout=3*60,
+ descriptionDone="%s source" % workdir,
+ workdir='.',
+ ))
+ self.addStep(
+ SetProperty(name='set_%s_revision' % workdir,
+ command=['hg', 'identify', '-i'],
+ property='%s_revision' % workdir,
+ workdir=workdir,
+ ))
+ if repo == 'build/tools':
+ self.addStep(
+ ShellCommand(
+ name='sync_tools_repo',
+ timeout=3*60,
+ workdir='tools',
+ command='hg push -e "ssh -i ~cltbld/.ssh/ffxbld_dsa -l prepr-ffxbld" ssh://hg.mozilla.org/users/prepr-ffxbld/tools'
+ ))
+
+ def setup_virtualenv(self, workdir='sandbox'):
+ self.addStep(
+ ShellCommand(name='rm_old_sandbox',
+ command=['rm', '-rf', 'bin', 'lib', 'include'],
+ workdir=workdir,
+ ))
+ self.addStep(
+ ShellCommand(
+ name='setup_sandbox',
+ command=self.veCommand,
+ workdir=workdir,
+ haltOnFailure=True,
+ ))
+
+ def test_masters(self):
+ self.addStep(ShellCommand(name='test_masters',
+ command=['./test-masters.sh', '-8'],
+ env = {
+ 'PYTHONPATH': WithProperties('%(topdir)s'),
+ 'PATH': WithProperties('%(topdir)s/sandbox/bin:/bin:/usr/bin'),
+ },
+ workdir="buildbot-configs",
+ ))
+
+ def bbc_pylint(self):
+ self.addStep(PyLintExtended(
+ command=["sandbox/bin/pylint",
+ '--rcfile=buildbotcustom/.pylintrc',
+ 'buildbotcustom'],
+ workdir='.',
+ flunkOnFailure=False,
+ name='buildbotcustom_pylint',
+ project='buildbotcustom',
+ ))
+
+ def tools_pylint(self):
+ # TODO: move pylintrc to tools
+ self.addStep(PyLintExtended(
+ command='../../../sandbox/bin/pylint --rcfile=../../.pylintrc *',
+ workdir='tools/lib/python',
+ flunkOnFailure=False,
+ name='tools_lib_pylint',
+ project='tools_lib',
+ ))
+ self.addStep(PyLintExtended(
+ command='find buildbot-helpers buildfarm \
+ clobberer release stage \
+ -name \'*.py\' -type f -print0 | \
+ xargs -0 ../sandbox/bin/pylint \
+ --rcfile=.pylintrc',
+ workdir="tools",
+ env = {'PYTHONPATH':
+ WithProperties('%(topdir)s:%(topdir)s/tools/lib/python')},
+ flunkOnFailure=False,
+ name='tools_scripts_pylint',
+ project='tools_scripts',
+ ))
+
+ def run_on_master(self, master_dir, cmd):
+ self.addStep(MasterShellCommand(name='master_cmd',
+ command='bash --login -c \'cd "%s" && %s\'' % (master_dir,
+ cmd)
+ ))
+
+ def coverage(self, project):
+ self.addStep(
+ ShellCommand(name='rm_old_coverage_%s' % project,
+ command=['rm', '-f', '.coverage'],
+ workdir=project,
+ ))
+ self.addStep(
+ ShellCommand(name='generate_coverage_%s' % project,
+ command=['../sandbox/bin/coverage', 'run', '--branch',
+ '--source=.',
+ WithProperties('--omit="%(topdir)s/sandbox/*,/usr/*,/tools/*,*/test/*"'),
+ '../sandbox/bin/nosetests'],
+ workdir=project,
+ flunkOnFailure=False,
+ ))
+ self.addStep(
+ ShellCommand(name='rm_old_coverage_html_%s' % project,
+ command=['rm', '-fr', '../html/%s' % project],
+ workdir=project,
+ ))
+ self.addStep(
+ ShellCommand(name='generate_coverage_html_%s' % project,
+ command=['../sandbox/bin/coverage', 'html', '-d',
+ '../html/%s' % project, '--ignore-errors'],
+ workdir=project,
+ ))
+ self.addStep(
+ ShellCommand(name='fix_permissions_%s' % project,
+ command=['chmod', 'u=rwX,g=rX,o=rX', '-R',
+ 'html/%s' % project],
+ workdir='.',
+ ))
+ self.addStep(
+ ShellCommand(name='upload_coverage_html_%s' % project,
+ command=['rsync', '-av', '--delete', '-e',
+ 'ssh -i ~/.ssh/id_rsa -l cltbld -o BatchMode=yes',
+ 'html/%s/' % project,
+ 'preproduction-stage.build.mozilla.org:/var/www/html/coverage/%s/' % project],
+ workdir='.',
+ ))
323 pylint/pylintrc
@@ -0,0 +1,323 @@
+# lint Python modules using external checkers.
+#
+# This is the main checker controlling the other ones and the reports
+# generation. It is itself both a raw checker and an astng checker in order
+# to:
+# * handle message activation / deactivation at the module level
+# * handle some basic but necessary stats'data (number of classes, methods...)
+#
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add <file or directory> to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=.hg
+ignore=test
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+# C0111: Missing docstring
+# C0302: Too many lines in module (%s) Used when a module has too much lines,
+# reducing its readibility.
+# R0902: Too many instance attributes (N/7)
+# R0913: Too many arguments (N/5)
+disable-msg=C0111,C0302,R0902,R0913
+
+
+[REPORTS]
+
+# Set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+# output-format=text
+# output-format=colorized
+output-format=parseable
+
+# Include message's id in output
+include-ids=yes
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells whether to display a full report or only the messages
+reports=yes
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamically set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, add a predefined set of Zope acquired attributes
+# to generated-members.
+zope=yes
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E0201 when accessed.
+generated-members=REQUEST,acl_users,aq_parent
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assignment
+#
+[VARIABLES]
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=_|dummy
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branches, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__
+
+# Regular expression which should only match correct module names
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+#class-rgx=[A-Z_][a-zA-Z0-9]+$
+class-rgx=[A-Z][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+#function-rgx=[a-z_][a-z0-9_]{2,30}$
+function-rgx=[a-z_][a-zA-Z0-9_]*$
+
+# Regular expression which should only match correct method names
+#method-rgx=[a-z_][a-z0-9_]{2,30}$
+method-rgx=[a-z_][a-zA-Z0-9_]*$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=[a-z_][a-zA-Z0-9_]{2,30}$
+
+# Regular expression which should only match correct argument names
+#argument-rgx=[a-z_][a-z0-9_]{2,30}$
+argument-rgx=[a-z][a-zA-Z0-9_]*$
+
+# Regular expression which should only match correct variable names
+#variable-rgx=[a-z_][a-z0-9_]{2,30}$
+variable-rgx=[a-z_][a-zA-Z0-9_]*$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,ex,Run,_,PLATFORMS,SUITES,ACTIVE_UNITTEST_PLATFORMS,PLATFORMS,SUITES
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,bar,baz,toto,tutu,tata
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,apply,input
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existent members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=80
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string=' '
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
15 slave/Makefile
@@ -0,0 +1,15 @@
+# -*- makefile -*-
+
+export PATH=$(shell pwd)/../sandbox/bin:/bin:/usr/bin
+
+start:
+ buildslave start .
+
+stop:
+ buildslave stop .
+
+log:
+ if [ -e twistd.log ]; \
+ then tail -F twistd.log; \
+ else echo "Nothing to tail."; \
+ fi
39 slave/buildbot.tac
@@ -0,0 +1,39 @@
+
+import os
+
+from twisted.application import service
+from buildslave.bot import BuildSlave
+
+basedir = r'.'
+rotateLength = 1000000
+maxRotatedFiles = None
+
+# if this is a relocatable tac file, get the directory containing the TAC
+if basedir == '.':
+ import os.path
+ basedir = os.path.abspath(os.path.dirname(__file__))
+
+application = service.Application('buildslave')
+try:
+ from twisted.python.logfile import LogFile
+ from twisted.python.log import ILogObserver, FileLogObserver
+ logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
+ maxRotatedFiles=maxRotatedFiles)
+ application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
+except ImportError:
+ # probably not yet twisted 8.2.0 and beyond, can't set log yet
+ pass
+
+buildmaster_host = 'localhost'
+port = 9710
+slavename = 'myself'
+passwd = 'passwd'
+keepalive = 600
+usepty = 0
+umask = None
+maxdelay = 300
+
+s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
+ keepalive, usepty, umask=umask, maxdelay=maxdelay)
+s.setServiceParent(application)
+
38 ve-setup.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+mkdir -p sandbox
+cd sandbox
+rm -rf bin lib include
+unset CC
+unset CXX
+export PIP_DOWNLOAD_CACHE=$PWD/cache
+mkdir -p $PIP_DOWNLOAD_CACHE
+VE_VER=1.4.9
+wget -O- http://pypi.python.org/packages/source/v/virtualenv/virtualenv-${VE_VER}.tar.gz | tar -xz virtualenv-${VE_VER}/virtualenv.py || exit 1
+
+PYTHON=/tools/python/bin/python
+PYTHON=python
+$PYTHON virtualenv-${VE_VER}/virtualenv.py --distribute --no-site-packages . || exit 1
+rm -rf virtualenv-${VE_VER}
+PYTHON=$PWD/bin/python
+PATH=$PWD/bin:$PATH
+$PYTHON -c 'import json' 2>/dev/null || $PYTHON -c 'import simplejson' || ./bin/pip install simplejson || exit 1
+$PYTHON -c 'import sqlite3, sys; assert sys.version_info >= (2,6)' 2>/dev/null || $PYTHON -c 'import pysqlite2.dbapi2' || ./bin/pip install pysqlite || exit 1;
+./bin/pip install Twisted || exit 1;
+./bin/pip install jinja2 || exit 1;
+./bin/pip install mock || exit 1;
+./bin/pip install coverage || exit 1;
+./bin/pip install nose || exit 1;
+./bin/pip install pylint || exit 1;
+./bin/pip install sqlalchemy || exit 1;
+./bin/pip install argparse || exit 1;
+./bin/pip install django || exit 1;
+./bin/pip install pycrypto || exit 1;
+./bin/pip install pyasn1 || exit 1;
+./bin/pip install mysql-python || exit 1;
+./bin/pip install mercurial || exit 1;
+./bin/pip install pyopenssl==0.10 || exit 1;
+hg clone http://hg.mozilla.org/build/buildbot
+(cd buildbot/master; $PYTHON setup.py develop install) || exit 1;
+(cd buildbot/slave; $PYTHON setup.py develop install) || exit 1;
+rm -rf buildbot

0 comments on commit 44564d4

Please sign in to comment.
Something went wrong with that request. Please try again.