I'm new to Jenkins and I'm trying to schedule a Jenkins job to run Python unit tests. The modules being tested import gcloud.datastore
, but I'm getting an error: No module named gcloud.datastore
when trying to run the Jenkins job. I've installed the GCloud SDK Plugin for jenkins, but I'm not sure how to resolve the issue.
I'm running the following in Jenkins under Build->Virtualenv Builder
to install the dependencies for my tests and then run them. (I'm sure there's a better way to run the unit tests, but I'll work on that later.)
pip install -r /vagrant/requirements.txt
python /vagrant/run_test.py -A
The error occurs when executing run_test.py
. Since GCloud SDK can't be installed using pip, putting it in the requirements.txt
file doesn't work so I'm not sure how to do this.
GCloud SDK is installed on my VM in the directory /vagrant/google-cloud-sdk/bin/gcloud
, but Jenkins doesn't seem to care.
As a side note: the tests themselves mock the methods that access datastore so the gcloud.datastore
library isn't being used for them, but the project itself needs it.