summaryrefslogtreecommitdiffstats
path: root/ci/test.sh
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-06-14 10:06:05 -0400
committerTim Rozet <trozet@redhat.com>2016-06-14 14:18:30 -0400
commit6d2432ec2e5b84073c3d3a3aa591c64c4380534a (patch)
treef6423604e090909352eebf7f2b732393ab44013d /ci/test.sh
parent2ad6cb27db57a090d7b0e7fcf85aa363f9237684 (diff)
Fixes unit tests
Change-Id: If6a8366dec49cff85ba94c13e70a1796e7b6ca47 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'ci/test.sh')
-rwxr-xr-xci/test.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/ci/test.sh b/ci/test.sh
index 0f2bc046..22f9120b 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -10,19 +10,22 @@
set -e
-# Make sure python is installed
-if ! rpm -q python34-devel > /dev/null; then
- sudo yum install -y epel-release
- if ! sudo yum install -y python34-devel; then
- echo "Failed to install python34-devel package..."
- exit 1
+# Make sure python dependencies are installed
+for pkg in epel-release python34-devel python34-nose; do
+ if ! rpm -q ${pkg} > /dev/null; then
+ if ! sudo yum install -y ${pkg}; then
+ echo "Failed to install ${pkg} package..."
+ exit 1
fi
-fi
+ fi
+done
# Make sure coverage is installed
if ! python3 -c "import coverage" &> /dev/null; then sudo easy_install-3.4 coverage; fi
+pushd ../build/ > /dev/null
make python-tests
+popd > /dev/null
pushd ../tests/ > /dev/null
percent=$(coverage3 report --include '*lib/python/*' -m | grep TOTAL | tr -s ' ' | awk '{ print $4 }' | cut -d % -f 1)
if [[ percent -lt 80 ]]; then
@@ -30,4 +33,4 @@ if [[ percent -lt 80 ]]; then
echo "Does not meet 80% requirement"
exit 1
fi
-popd > /dev/nul
+popd > /dev/null