Skip to content

Commit

Permalink
Merge branch 'master' of git+ssh://www.opensvc.com/home/opensvc/opensvc
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Feb 20, 2018
2 parents 5586734 + c7cc5e4 commit a466ca8
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion bin/pkg/make_tests
Expand Up @@ -2,14 +2,35 @@

# apt install python-nose-json python-nosehtmloutput python-nose-cov python-requests
# apt install python3-nose-json python3-nosehtmloutput python3-nose-cov python3-requests
# pip2 install nose NoseHTML nosehtmloutput nose-html nosehtmloutput-2 nose-json nose-cov
# pip3 install nose NoseHTML nosehtmloutput nose-html nosehtmloutput-2 nose-json nose-cov

VERSION="$1"
PATH_SCRIPT="$(cd $(/usr/bin/dirname $(which -- $0 || echo $0));pwd)"
PYTHONPATH=$PATH_SCRIPT/../../lib
export PYTHONPATH

function usage
{
echo "Usage : $0 2 # Python2 tests"
echo " $0 3 # Python3 tests"
exit 1
}

[[ -z $VERSION ]] && usage
[[ $VERSION -ne "2" && $VERSION -ne "3" ]] && usage

PATTERN=$(echo tests$VERSION\|tests-$VERSION)
NOSE=$(find /bin /usr/bin /usr/local/bin -type f -name \*nosetests\* | grep -E "$PATTERN"|tail -1)

[[ -z $NOSE ]] && {
echo "Error: nosetests for python $VERSION not found. exiting"
exit 1
}

(
cd $PATH_SCRIPT/../..
nosetests \
$NOSE \
--verbosity=2 \
--with-coverage \
--cover-html \
Expand Down

0 comments on commit a466ca8

Please sign in to comment.