Auto: Daily job definition
[releng.git] / jjb / apex / apex-unit-test.sh
1 #!/bin/bash
2 set -o errexit
3 set -o nounset
4 set -o pipefail
5 # log info to console
6 echo "Starting unit tests for Apex..."
7 echo "---------------------------------------------------------------------------------------"
8 echo
9
10 PATH=$PATH:/usr/sbin
11
12
13 pushd build/ > /dev/null
14 for pkg in yamllint rpmlint iproute epel-release python34-devel python34-nose python34-PyYAML python-pep8 python34-mock python34-pip; do
15   if ! rpm -q ${pkg} > /dev/null; then
16     if ! sudo yum install -y ${pkg}; then
17       echo "Failed to install ${pkg} package..."
18       exit 1
19     fi
20   fi
21 done
22
23 # Make sure coverage is installed
24 if ! python3 -c "import coverage" &> /dev/null; then sudo pip3 install coverage; fi
25
26 make rpmlint
27 make python-pep8-check
28 make yamllint
29 make python-tests
30 popd > /dev/null
31
32 echo "--------------------------------------------------------"
33 echo "Unit Tests Done!"