PYENV_HOME=$WORKSPACE/.pyenv/
# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
rm -rf $PYENV_HOME
fi
# Create virtualenv and install necessary packages
virtualenv --no-site-packages $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet httplib2 --upgrade --force-reinstall
pip install --quiet pytest
pip install --quiet pytest-cov
pip install --quiet pylint
python $WORKSPACE/setup.py install
python $WORKSPACE/setup.py develop
pylint -f parseable $WORKSPACE/ats_processor/ | tee pylint.out
py.test $WORKSPACE --junitxml test_results.xml
py.test --cov=$WORKSPACE/ats_processor --cov-report term-missing --cov-report xml
The point of this script is that it uses virtualenv to create a self-contained python execution environment, including using pip to install all necessary packages. This ensures that you are testing with the latest version of each package.
No comments:
Post a Comment