2017-03-30 15:34:24 -05:00
#!/bin/sh
2017-03-31 11:45:56 -05:00
echo "EXECUTING: Python tests"
echo
2017-03-30 15:34:24 -05:00
echo " Creating Python ${ PYTHON_VERSION } virtual environment... "
echo
2018-06-25 11:00:21 -05:00
cd ${ WORKSPACE } /
2017-03-31 11:17:34 -05:00
2017-03-30 16:13:06 -05:00
PYTHON_SUFFIX = ""
2018-06-25 11:00:21 -05:00
if [ [ " ${ PYTHON_VERSION } " = = 3* ] ] ; then
2017-03-30 16:13:06 -05:00
PYTHON_SUFFIX = "3"
fi
2018-06-25 11:00:21 -05:00
if [ " ${ PYTHON_VERSION } " = = 2.6 -o " ${ PYTHON_VERSION } " = = 3.3 ] ; then
/usr/bin/virtualenv --no-wheel -p /usr/local/python-${ PYTHON_VERSION } /bin/python${ PYTHON_SUFFIX } ${ WORKSPACE } /pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; }
. ${ WORKSPACE } /pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; }
${ WORKSPACE } /pgadmin-venv/bin/pip install wheel = = 0.29.0 || { echo 'ERROR: Failed to install wheel 0.29.0.' ; exit 1; }
2017-09-11 05:06:29 -05:00
else
2018-06-25 11:00:21 -05:00
/usr/bin/virtualenv -p /usr/local/python-${ PYTHON_VERSION } /bin/python${ PYTHON_SUFFIX } ${ WORKSPACE } /pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; }
. ${ WORKSPACE } /pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; }
2017-09-11 05:06:29 -05:00
fi
2018-06-25 11:00:21 -05:00
${ WORKSPACE } /pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; }
${ WORKSPACE } /pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; }
2017-03-30 15:34:24 -05:00
2018-03-08 03:34:06 -06:00
echo "Running PEP-8 checks..."
echo
2018-03-15 05:53:26 -05:00
make check-pep8 || { echo 'ERROR: Error detected when running the Python PEP-8 checks.' ; exit 1; }
2018-03-08 03:34:06 -06:00
2017-03-31 11:45:56 -05:00
echo "Running regression tests..."
2017-03-30 15:34:24 -05:00
echo
2018-06-25 11:00:21 -05:00
${ WORKSPACE } /pgadmin-venv/bin/python ${ WORKSPACE } /web/regression/runtests.py --exclude feature_tests || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; }
2017-03-30 15:34:24 -05:00