-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.cfg
74 lines (58 loc) · 1.93 KB
/
test.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.0.x.cfg
http://good-py.appspot.com/release/plone/4.0.9
eggs-directory = buildout-cache/eggs
download-cache = buildout-cache/downloads
parts = download install test createcoverage coverage-sh
package-name = quintagroup.plonecomments
package-min-coverage = 50
allow-hosts =
*.plone.org
*.python.org
*.zope.org
docutils.sourceforge.net
effbot.org
prdownloads.sourceforge.net
plone-series = 4.0
basename = Plone-${versions:Plone}-UnifiedInstaller
filename = ${buildout:basename}.tgz
[download]
recipe = hexagonit.recipe.download
url = https://launchpad.net/plone/${buildout:plone-series}/${versions:Plone}/+download/${buildout:filename}
[install]
recipe = collective.recipe.cmd
on_install = true
cmds = tar jxvf ${download:location}/${buildout:basename}/packages/buildout-cache.tar.bz2 1>/dev/null
[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
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
[versions]
zc.buildout = 1.6.3