letsencrypt/tox.cover.sh
2015-10-06 18:58:06 +00:00

47 lines
1.3 KiB
Bash
Executable file

#!/bin/sh -xe
# USAGE: ./tox.cover.sh [package]
#
# This script is used by tox.ini (and thus Travis CI) in order to
# generate separate stats for each package. It should be removed once
# those packages are moved to separate repo.
#
# -e makes sure we fail fast and don't submit coveralls submit
if [ "xxx$1" = "xxx" ]; then
pkgs="letsencrypt acme letsencrypt_apache letsencrypt_nginx letshelp_letsencrypt"
else
pkgs="$@"
fi
cover () {
if [ "$1" = "letsencrypt" ]; then
min=98
elif [ "$1" = "acme" ]; then
min=100
elif [ "$1" = "letsencrypt_apache" ]; then
min=100
elif [ "$1" = "letsencrypt_nginx" ]; then
min=97
elif [ "$1" = "letshelp_letsencrypt" ]; then
min=100
else
echo "Unrecognized package: $1"
exit 1
fi
# "-c /dev/null" makes sure setup.cfg is not loaded (multiple
# --with-cover add up, --cover-erase must not be set for coveralls
# to get all the data); --with-cover scopes coverage to only
# specific package, positional argument scopes tests only to
# specific package directory; --cover-tests makes sure every tests
# is run (c.f. #403)
nosetests -c /dev/null --with-cover --cover-tests --cover-package \
"$1" --cover-min-percentage="$min" "$1"
}
rm -f .coverage # --cover-erase is off, make sure stats are correct
for pkg in $pkgs
do
cover $pkg
done