Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

65 lines (53 sloc) 1.604 kb
[buildout]
parts = test coverage code-analysis createcoverage coverage-sh py
package-min-coverage = 80
develop = .
[test]
recipe = zc.recipe.testrunner
eggs = yafowil[test]
defaults = ['--auto-color', '--auto-progress']
[coverage]
recipe = zc.recipe.testrunner
eggs = ${test:eggs}
defaults = ['--coverage', '../../coverage', '-v', '--auto-progress']
[code-analysis]
recipe = plone.recipe.codeanalysis
directory = src
pre-commit-hook = True
flake8 = True
flake8-ignore = C901
return-status-codes = True
[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage
[coverage-sh]
recipe = collective.recipe.template
output = ${buildout:directory}/bin/coverage.sh
mode = 755
input = inline:
#! /bin/sh
# checks for report created with createcoverage and evaluate the result
DEFAULT=${buildout:package-min-coverage}
REPORT="htmlcov/index.html"
if [ "$#" -eq 1 ] && [ $1 -ge 0 ] && [ $1 -le 100 ]; then
MINIMUM=$1
else
echo "Invalid value for minimum coverage; using default: $DEFAULT%"
MINIMUM=$DEFAULT
fi
if [ ! -f "$REPORT" ]; then
bin/createcoverage run "bin/test -t yafowil"
fi
# find first percentage value in file (module test coverage) and return it
COVERAGE=`grep "[0-9]\{1,3\}[%]" $REPORT -m 1 -o | grep "[0-9]\{1,3\}" -o`
if [ $COVERAGE -lt $MINIMUM ]; then
echo "Insufficient test coverage: $COVERAGE% (minimum acceptable is $MINIMUM%)"
exit 1
else
echo "Current test coverage: $COVERAGE%"
exit 0
fi
[py]
recipe = zc.recipe.egg
eggs = ${test:eggs}
interpreter = py
Jump to Line
Something went wrong with that request. Please try again.