Permalink
Browse files

refactor development configurations to include QA tools

  • Loading branch information...
1 parent f072b65 commit dfabef6d164e473f69c416a09e213c69e22c0720 @hvelarde hvelarde committed Dec 7, 2012
Showing with 50 additions and 8 deletions.
  1. +4 −8 buildout.cfg
  2. +27 −0 coverage.sh
  3. +18 −0 quality-assurance.cfg
  4. +1 −0 travis.cfg
View
@@ -1,19 +1,15 @@
[buildout]
extends =
http://svn.plone.org/svn/collective/buildout/plonetest/test-4.x.cfg
+ quality-assurance.cfg
versions.cfg
package-name = collective.newsflash
package-extras = [test]
+eggs = iw.debug
+zcml = iw.debug
-parts += createzopecoverage omelette
-
-[createzopecoverage]
-recipe = createzopecoverage
-
-[instance]
-eggs += iw.debug
-zcml += iw.debug
+parts += omelette
[omelette]
recipe = collective.recipe.omelette
View
@@ -0,0 +1,27 @@
+#! /bin/sh
+# checks for report created with createzopecoverage and evaluate the result
+
+# default minimum coverage is 80%
+DEFAULT=80
+REPORT="coverage/reports/all.html"
+
+if [ "$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/createzopecoverage 1>/dev/null
+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
+ exit 0
+fi
View
@@ -0,0 +1,18 @@
+[buildout]
+parts +=
+ createzopecoverage
+ pep8
+ pyflakes
+
+[createzopecoverage]
+recipe = createzopecoverage
+
+[pep8]
+recipe = zc.recipe.egg
+eggs = pep8
+
+[pyflakes]
+recipe = zc.recipe.egg
+scripts = pyflakes
+eggs = pyflakes
+entry-points = pyflakes=pyflakes.scripts.pyflakes:main
View
@@ -1,6 +1,7 @@
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/travis-4.x.cfg
+ quality-assurance.cfg
versions.cfg
package-name = collective.newsflash

0 comments on commit dfabef6

Please sign in to comment.