[openstack-dev] [kolla] Getting test-requirements.txt into project images

Joshua Harlow harlowja at fastmail.com
Sat Dec 10 02:31:45 UTC 2016


Hi kolla folks,

I've got the following going (via jenkins):

"Cloning (and stashing) required repositories"
                      |
                      |
                      v
"Extracting project specific patches (and skippable tests) "
                      |
                      |
                      v
...
"Building heat images using kolla"
                      |
                      |
                      v
"(Unit) testing heat image"

Now the neat part is that the testing happens post-image being built (so 
that I can know that the patches we applied don't badly affect all the 
unit tests for the project *before* the image is pushed to our artifactory).

This all seems to go ok except for one small snag, and that snag is 
getting the projects (unit)test requirements into the image.

I've had to do the following (which seems sorta not so good):

{% block ${project}_base_footer %}
ADD plugins-archive /
RUN /var/lib/kolla/venv/bin/pip --no-cache-dir \
         install --upgrade -c requirements/upper-constraints.txt \
         -r ${project}/test-requirements.txt \
         -r ${project}/requirements.txt
RUN /var/lib/kolla/venv/bin/pip --no-cache-dir \
         install os-testr -c requirements/upper-constraints.txt
{% endblock %}

Where in the above ${project} is a variable that changes depending on 
which project we are building.

Is there any better way to request that `test-requirements.txt` gets 
installed?

Thoughts?

-Josh



More information about the OpenStack-dev mailing list