How to run Python tests with Jenkins pipeline
From my point of view good solution is to use virtualenv there. Below is small snippet of code for a Jenkinsfile.
sh """
pip install --user virtualenv &&
virtualenv venv &&
. \$(pwd)/venv/bin/activate &&
pip install -r src/test_requirements.txt &&
export PYTHONPATH="src" &&
cd src/tests && nosetests -v
"""
Comments
Post a Comment