Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add travis-ci tools to improve qa testing of addons
- Loading branch information
Showing
2 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
[buildout] | ||
package-src = | ||
|
||
[createzopecoverage] | ||
recipe = createzopecoverage | ||
|
||
[flake8] | ||
recipe = zc.recipe.egg | ||
eggs = | ||
flake8 | ||
${buildout:eggs} | ||
entry-points = flake8=flake8.run:main | ||
|
||
[python-validation-sh] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/bin/python-validation.sh | ||
mode = 755 | ||
input = inline: | ||
#! /bin/sh | ||
src=${buildout:package-src} | ||
pep8_ignores=E501 | ||
echo Validating Python files | ||
bin/flake8 --ignore=$pep8_ignores $src | ||
|
||
[coverage-sh] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/bin/coverage.sh | ||
mode = 755 | ||
input = inline: | ||
#! /bin/sh | ||
# 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 | ||
|
||
[css-validation-sh] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/bin/css-validation.sh | ||
mode = 755 | ||
input = inline: | ||
#! /bin/sh | ||
src=${buildout:package-src} | ||
css_ignores=! -name bootstrap\* ! -name jquery\* | ||
find $src -type f -name *.css $css_ignores | xargs csslint | ack-grep --passthru error | ||
|
||
[js-validation-sh] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/bin/js-validation.sh | ||
mode = 755 | ||
input = inline: | ||
#! /bin/sh | ||
src=${buildout:package-src} | ||
js_ignores=! -name bootstrap\* ! -name jquery\* | ||
find $src -type f -name *.js $js_ignores -exec jshint {} ';' | ack-grep --passthru error | ||
|
||
[python-validation-sh] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/bin/python-validation.sh | ||
mode = 755 | ||
input = inline: | ||
#! /bin/sh | ||
src=${buildout:package-src} | ||
pep8_ignores=E501,W404 | ||
echo Validating Python files | ||
bin/flake8 --ignore=$pep8_ignores $src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[buildout] | ||
extends = test-4.x.cfg buildout-cache.cfg | ||
extends = test-4.x.cfg buildout-cache.cfg qa.cfg | ||
parts = download install test | ||
plone-series = 4.2 | ||
package-name = | ||
package-extras = | ||
package-src = | ||
test-eggs = |