summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-unit-test.sh
blob: 3112c9d36a474c620b92747e1af395b3f3463a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
# log info to console
echo "Starting unit tests for Apex..."
echo "---------------------------------------------------------------------------------------"
echo


pushd build/ > /dev/null
for pkg in yamllint rpmlint iproute epel-release python34-devel python34-nose python34-PyYAML python-pep8 python34-mock python34-pip; 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
done

# Make sure coverage is installed
if ! python3 -c "import coverage" &> /dev/null; then sudo pip3 install coverage; fi

make rpmlint
make python-pep8-check
make yamllint
make python-tests
popd > /dev/null

echo "--------------------------------------------------------"
echo "Unit Tests Done!"