/ tox.cover.sh
tox.cover.sh
 1  #!/bin/sh -xe
 2  
 3  # USAGE: ./tox.cover.sh [package]
 4  #
 5  # This script is used by tox.ini (and thus Travis CI) in order to
 6  # generate separate stats for each package. It should be removed once
 7  # those packages are moved to separate repo.
 8  #
 9  # -e makes sure we fail fast and don't submit coveralls submit
10  
11  if [ "xxx$1" = "xxx" ]; then
12    pkgs="letsencrypt acme letsencrypt_apache letsencrypt_nginx letshelp_letsencrypt"
13  else
14    pkgs="$@"
15  fi
16  
17  cover () {
18    if [ "$1" = "letsencrypt" ]; then
19      min=98
20    elif [ "$1" = "acme" ]; then
21      min=100
22    elif [ "$1" = "letsencrypt_apache" ]; then
23      min=100
24    elif [ "$1" = "letsencrypt_nginx" ]; then
25      min=97
26    elif [ "$1" = "letshelp_letsencrypt" ]; then
27      min=100
28    else
29      echo "Unrecognized package: $1"
30      exit 1
31    fi
32  
33    # "-c /dev/null" makes sure setup.cfg is not loaded (multiple
34    # --with-cover add up, --cover-erase must not be set for coveralls
35    # to get all the data); --with-cover scopes coverage to only
36    # specific package, positional argument scopes tests only to
37    # specific package directory; --cover-tests makes sure every tests
38    # is run (c.f. #403)
39    nosetests -c /dev/null --with-cover --cover-tests --cover-package  \
40              "$1" --cover-min-percentage="$min" "$1"
41  }
42  
43  rm -f .coverage  # --cover-erase is off, make sure stats are correct
44  for pkg in $pkgs
45  do
46    cover $pkg
47  done