2

I have been attempting to add some functionality to one of the Openstack Charms and test my changes. In order to test to make sure I haven't broken any other functionality I have been attempting to run the provided test suite. Every openstack charm includes a tests directory which contains the steps for running tests. I have been running the following commands on a completely clean ubuntu 14.04.3 virtual machine that has had no other commands run on it (note that the code I am running it on is directly from the repository and does not contain my modifications):

sudo add-apt-repository ppa:juju/stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install charm-tools
sudo apt-get install juju-core
ssh-keygen -t rsa
juju init
juju switch local
bzr branch lp:~openstack-charmers/charms/trusty/neutron-api/next
cd next
make test

After the last command runs I end up with nearly all tests failing with the error

Traceback (most recent call last):
  File "tests/014-basic-precise-icehouse", line 5, in <module>
    from basic_deployment import NeutronAPIBasicDeployment
  File "/home/ubuntu/next/tests/basic_deployment.py", line 47, in <module>
    from charmhelpers.contrib.openstack.amulet.utils import (
  File "/home/ubuntu/next/tests/charmhelpers/contrib/openstack/amulet/utils.py", line 25, in <module>
    import cinderclient.v1.client as cinder_client 

Am I just missing some obvious configuration option or is the test suite broken for all openstack juju charms? So far I have downloaded a few other charm sets (nova-compute and neutron-api) and tried to run their tests and so far all have given this error.

1 Answer 1

1

We really appreciate contributions and we are happy to help guide developers toward a successful code merge. Unit test and Amulet test coverage are indeed going to help speed up the review process.

I can confirm that the issue that you described is a known issue. We have merge proposals in flight to address those amulet test dependency issues ahead of the 15.10 OpenStack charm release. In the mean time, Amulet test dependencies can be satisfied by editing the 00-setup file to make it look like the proposed 00-setup file.

To ensure a smooth review and landing of amulet test contributions, proposed amulet test additions should be in the form of new idempotent test_ methods in the tests/basic_deployment.py file. Each test_ method is exercised against and is expected to pass for all currently-supported Ubuntu + OpenStack combinations, regardless of test_ execution order.

The Ubuntu Cloud Archive page provides a chart which describes which combinations are supported at any given point in the release timeline.

To ensure a smooth review of added hook features, corresponding unit test coverage should be included so that those code features can be validated.

On the broader topic of contributing to the OpenStack charms in general, the OpenStack Charm Development Policy is worth reviewing.

Specifically, any proposed changes should be made against the "next" (development) charm branches, and not against the trunk or stable charm branches. In the case of neutron-api, that next branch would be:

lp:~openstack-charmers/charms/trusty/neutron-api/next

Thank you and feel free to reach out here, on freenode #juju, or on the Juju mailing list.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .