rendered paste body[buildout]
# This buildout configuration is derived from the UI and the Hudson paper by
# Eric Steele from PloneConf 2010
#
# See
# http://www.slideshare.net/esteele/continuous-integration-testing-for-plone-using-hudson
# for his paper.
# base.cfg has a [zeoserver] section.
extends =
develop.cfg
buildout.cfg <--- leaving this out breaks the whole buildout,
despite "extends = buildout.cfg" in develop.cfg
extensions +=
mr.developer
# mr.developer settings:
always-checkout = force
sources = sources
auto-checkout = *
parts = <--- this is intended to overwrite the other ${buildout:parts}
instance
xmltest
coverage
report
pylint-bin
pylint
pyflakes-bin
pyflakes
pep8-bin
pep8
zptlint-bin
zptlint
xmllint
jstestdriver-download
jstestdriver-download-equiv
jstestdriver-download-qunit-adapter
jstestdriver-download-coverage
jstestdriver
test-all
# These values need to be overridden
package-name =
package-directories =
jstestdriver-directories =
browsers =
[instance] <--- This is done in order to have a non-ZEO Zope to run the tests
<= client1 <--- "base.cfg" from the UI has "zeo-client = true" - at least mine has
zeo-client = false
[xmltest]
recipe = collective.xmltestreport
eggs =
${test:eggs}
script = xmltest
defaults = ['--auto-color', '--auto-progress', '--xml']
[coverage]
recipe = zc.recipe.egg
eggs = coverage
initialization =
sys.argv = sys.argv[:] + ['run', 'bin/xmltest', '-k', '-q']
[report]
recipe = zc.recipe.egg
eggs = coverage
scripts = coverage=report
initialization =
eggs = '${buildout:eggs-directory}'
bin = '${buildout:directory}/bin'
exclude = '--omit=' + ','.join([eggs, sys.prefix, bin])
sys.argv = sys.argv[:] + ['xml', '-i', exclude]
[coverage-test]
recipe = zc.recipe.testrunner
eggs = ${test:eggs}
defaults = ['--coverage', '${buildout:directory}/coverage', '-v', '--auto-progress', '--xml']
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('coverage', 'report')
[pylint-bin]
recipe = zc.recipe.egg
eggs = logilab.pylintinstaller
extra-paths = ${secondary:location}/lib/python
entry-points = pylint-bin=pylint.lint:Run
arguments = sys.argv[1:]
arguments = [
'--output-format=parseable',
'--zope=y',
'--reports=y',
'--disable-msg=E0611,F0401,W0232,E1101,C0103,C0111,R0201,W0201,R0911,R0904,F0220,E1103,R0901,E0211,E0213,E1002,W0622',
'--generated-members=objects',
] + sys.argv[1:]
# Disable messages:
#
# E0611: No name %r in module %r. Used when a name cannot be found in a module.
# F0401: Unable to import %r (%s). Used when pylint has been unable to import a module.
# W0232: Class has no __init__ method. Used when a class has no __init__ method, neither its parent classes.
# C0103: Invalid name "%s" (should match %s). Used when the name doesn't match the regular expression associated to its type (constant, variable, class...).
# C0111: Message Missing docstring Description Used when a module, function, class or method has no docstring. Some special methods like init don't necessary require a docstring. Explanation
# R0201: Method could be a function
# W0201: Attribute %r defined outside __init__
# R0911: Too many return statements (%s/%s)
# E0211: Method has no argument
# - Reason: raises an error on zope.interface definitions
# E0213 Method should have "self" as first argument
# - Reason: raises an error on zope.interface definitions
# E1121 Too many positional arguments for function call
# - Reason: ???
# E1002 Use super on an old style class
# - Reason: super(CommentsViewlet, self).update() raises an error
# W0622 total_comments: Redefining built-in 'object'
# - Reason: top level def function will not work (e.g. for catalog indexers)
# ...
# See http://pylint-messages.wikidot.com/all-messages for a full list.
[pylint]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
if [ -s pylint.log ]; then
rm pylint.log
echo "Removing old pylint.log file"
fi
echo "Start pylint"
PACKAGES="${buildout:package-directories}"
for pkg in $PACKAGES
do
echo "Running pylint for $pkg"
find -L $pkg -regex ".*\.py" | xargs bin/pylint >> pylint.log
done
echo "finish"
output = ${buildout:directory}/bin/pylint
mode = 755
[pyflakes-bin]
recipe = zc.recipe.egg
eggs =
pyflakes
entry-points = pyflakes-bin=pyflakes.scripts.pyflakes:main
[pyflakes]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
if [ -s pyflakes.log ]; then
rm pyflakes.log
echo "Removing old pyflakes.log file"
fi
if [ -s pyflakes.log.tmp ]; then
rm pyflakes.log.tmp
fi
echo "Start pyflakes"
PACKAGES="${buildout:package-directories}"
for pkg in $PACKAGES
do
echo "Running pyflakes for $pkg"
find -L $pkg -regex ".*\.py" | xargs -r bin/pyflakes-bin >> pyflakes.log.tmp
done
cat pyflakes.log.tmp|sed 's:${buildout:directory}/::' > pyflakes.log
echo "finish"
output = ${buildout:directory}/bin/pyflakes
mode = 755
[pep8-bin]
recipe = zc.recipe.egg
eggs =
pep8
entry-points = pep8-bin=pep8:_main
[pep8]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
if [ -s pep8.log ]; then
rm pep8.log
echo "Removing old pep8.log file"
fi
if [ -s pep8.log.tmp ]; then
rm pep8.log.tmp
fi
echo "Start pep8"
PACKAGES="${buildout:package-directories}"
for pkg in $PACKAGES
do
echo "Running pep8 for $pkg"
find -L $pkg -regex ".*\.py" | xargs -r bin/pep8-bin >> pep8.log.tmp
done
cat pep8.log.tmp|sed 's:${buildout:directory}/::' > pep8.log
echo "finish"
output = ${buildout:directory}/bin/pep8
mode = 755
[zptlint-bin]
recipe = zc.recipe.egg
eggs =
zptlint
entry-points = zptlint-bin=zptlint:run
[zptlint]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
if [ -e zptlint.log ]; then
echo "Old zptlint.log file removed"
rm zptlint.log
fi
echo "Start zptlint"
PACKAGES="${buildout:package-directories}"
for pkg in $PACKAGES
do
echo "Running zptlint for $pkg"
find -L $pkg -regex ".*\.[c|z]?pt" | xargs -r bin/zptlint-bin | perl -p -e 's/\s+$/ /g;s/\s+/ /g;s/\*{3}s?/\n/g' | grep $pkg | sed 's:${buildout:directory}/::' >> zptlint.log
done
echo "finish"
output = ${buildout:directory}/bin/zptlint
mode = 755
[xmllint]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
if [ -e xmllint.log ]; then
echo "Removing existing xmllint.log file"
rm xmllint.log
fi
echo "Start xmllint"
for pkg in $PACKAGES
do
find -L $pkg ".*\.[c|z]?pt"| xargs xmllint --noout 2>&1| grep ${buildout:directory} | sed 's:${buildout:directory}/::' >> xmllint.log
done
if [ -s xmllint.log ]; then
echo "Errors were found:"
cat xmllint.log
echo "Errors were written to xmllint.log"
exit 1;
else
echo "No errors found"
fi
echo "finish"
output = ${buildout:directory}/bin/xmllint
mode = 755
[jstestdriver-download]
recipe = hexagonit.recipe.download
url = http://js-test-driver.googlecode.com/files/JsTestDriver-1.2.2.jar
download-only = True
destination = parts/jstestdriver
filename = JsTestDriver.jar
[jstestdriver-download-equiv]
recipe = hexagonit.recipe.download
url = http://js-test-driver.googlecode.com/svn/trunk/JsTestDriver/contrib/qunit/src/equiv.js
download-only = True
destination = parts/jstestdriver
filename = equiv.js
[jstestdriver-download-qunit-adapter]
recipe = hexagonit.recipe.download
url = http://js-test-driver.googlecode.com/svn/trunk/JsTestDriver/contrib/qunit/src/QUnitAdapter.js
download-only = True
destination = parts/jstestdriver
filename = QUnitAdapter.js
[jstestdriver-download-coverage]
recipe = hexagonit.recipe.download
url = http://js-test-driver.googlecode.com/files/coverage-1.2.2.jar
download-only = True
destination = parts/jstestdriver
filename = coverage.jar
[jstestdriver]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
echo "Start jstestdriver"
PACKAGES="${buildout:jstestdriver-directories}"
for pkg in $PACKAGES
do
echo "Running jstestdriver for $pkg"
java -jar ${buildout:directory}/parts/jstestdriver/JsTestDriver.jar --port 9876 --config $pkg/tests/jsTestDriver.conf --browser /usr/bin/firefox --tests all --verbose
done
echo "finish"
output = ${buildout:directory}/bin/jstestdriver
mode = 755
[test-all]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
bin/test --xml
bin/coverage
bin/report
bin/xmllint
bin/zptlint
bin/pep8
bin/pyflakes
bin/pylint
bin/jstestdriver
output = ${buildout:directory}/bin/test-all
mode = 755